Kiln » Kiln Extensions
Clone URL:  
test-kiln.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
#!/usr/bin/env python # # Test basic kiln interaction import os import common import hgtest import kilntest hgt = common.BfilesTester() hgt.updaterc({'extensions': [('kilnauth', kilntest.KILNAUTHPATH)]}) hgt.announce('setup') token = kilntest.gettoken() kilntest.deletetest(hgt, token) test = kilntest.createtest(hgt, token) # Don't log this because command depends on path to kiln which can change hgt.hg(['clone', test[0], 'repo1'], stdout='''no changes found updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved ''', log=False) os.chdir('repo1') os.mkdir('a') os.mkdir('a/b') os.mkdir('a/b/c') os.chdir('a') hgt.writefile('n1', 'n1') hgt.writefile('b/n2', 'n2') hgt.writefile('b/c/n3', 'n3') hgt.writefile('../n4', 'n4') hgt.writefile('b1', 'b1') hgt.writefile('b/b2', 'b2') hgt.writefile('b/c/b3', 'b3') hgt.writefile('../b4', 'b4') hgt.hg(['add', 'n1', 'b/n2', 'b/c/n3', '../n4']) hgt.hg(['add', '--bf'], stdout='''adding b/b2 as bfile adding b/c/b3 as bfile adding b1 as bfile adding ../b4 as bfile ''') hgt.hg(['commit', '-m', 'add files']) hgt.hg(['out', '--bf'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes changeset: 0:da6857b8d2bf tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add files searching for changes kbfiles to upload: a/b1 b4 a/b/b2 a/b/c/b3 ''' % kilntest.KILNURL) hgt.hg(['summary', '--remote', '--bf'], stdout='''parent: 0:da6857b8d2bf tip add files branch: default commit: 4 unknown (clean) update: (current) remote: 1 outgoing searching for changes kbfiles: 4 to upload ''') hgt.hg(['push'], stdout='''pushing to %s/Repo/Test/Test/Test searching for changes searching for changes remote: kiln: successfully pushed one changeset ''' % kilntest.KILNURL) hgt.hg(['out', '--bf'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes no changes found searching for changes kbfiles: No remote repo ''' % kilntest.KILNURL) os.chdir('../..') hgt.hg(['clone', test[0], 'repo2'], log=False, stdout='''requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 8 changes to 8 files updating to branch default 8 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed bfiles 4 big files updated, 0 removed ''') os.chdir('repo2') hgt.hg(['in'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes no changes found ''' % kilntest.KILNURL, status=1) hgt.hg(['out', '--bf'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes no changes found searching for changes kbfiles: No remote repo ''' % kilntest.KILNURL) hgt.writefile('n4', 'n44') hgt.writefile('b4', 'b44') hgt.hg(['commit', '-m', 'edit n4 and b4']) hgt.hg(['out', '--bf'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes changeset: 1:8499483c24d0 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: edit n4 and b4 searching for changes kbfiles to upload: b4 ''' % kilntest.KILNURL) hgt.hg(['push'], stdout='''pushing to %s/Repo/Test/Test/Test searching for changes searching for changes remote: kiln: successfully pushed one changeset ''' % kilntest.KILNURL) os.chdir('../repo1') hgt.hg(['in'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes changeset: 1:8499483c24d0 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: edit n4 and b4 ''' % kilntest.KILNURL) hgt.hg(['out'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes no changes found ''' % kilntest.KILNURL) hgt.hg(['mv', 'n4', 'b4', 'a']) hgt.hg(['commit', '-m', 'move n4 and b4']) hgt.hg(['out', '--bf'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes changeset: 1:6b693340d9c6 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: move n4 and b4 searching for changes kbfiles to upload: a/b4 ''' % kilntest.KILNURL) # A line of the output message from the below command changes from stdout # to stderr at some version after Mercurial 1.6. Just don't check stdout/stderr. hgt.hg(['push'], stdout=hgtest.ANYTHING, stderr=hgtest.ANYTHING, status=[1, 255]) hgt.hg(['pull'], stdout='''pulling from %s/Repo/Test/Test/Test searching for changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files (+1 heads) (run 'hg heads' to see heads, 'hg merge' to merge) ''' % kilntest.KILNURL) hgt.hg(['merge'], stdout='''merging a/b4 and b4 to a/b4 merging a/n4 and n4 to a/n4 0 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) getting changed bfiles 1 big files updated, 0 removed ''') hgt.hg(['commit', '-m', 'merge']) hgt.hg(['out', '--bf'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes changeset: 1:6b693340d9c6 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: move n4 and b4 changeset: 3:01193a291cb0 tag: tip parent: 1:6b693340d9c6 parent: 2:8499483c24d0 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: merge searching for changes kbfiles to upload: a/b4 ''' % kilntest.KILNURL) hgt.hg(['summary', '--remote', '--bf'], stdout='''parent: 3:01193a291cb0 tip merge branch: default commit: 4 unknown (clean) update: (current) remote: 2 outgoing searching for changes kbfiles: 1 to upload ''') hgt.hg(['push'], stdout='''pushing to %s/Repo/Test/Test/Test searching for changes searching for changes remote: kiln: successfully pushed 2 changesets ''' % kilntest.KILNURL) os.chdir('../repo2') hgt.hg(['out', '--bf'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes no changes found searching for changes kbfiles: No remote repo ''' % kilntest.KILNURL) hgt.hg(['in'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes changeset: 2:6b693340d9c6 parent: 0:da6857b8d2bf user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: move n4 and b4 changeset: 3:01193a291cb0 tag: tip parent: 2:6b693340d9c6 parent: 1:8499483c24d0 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: merge ''' % kilntest.KILNURL) hgt.hg(['pull'], stdout='''pulling from %s/Repo/Test/Test/Test searching for changes adding changesets adding manifests adding file changes added 2 changesets with 4 changes to 2 files (run 'hg update' to get a working copy) ''' % kilntest.KILNURL) hgt.hg(['in'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes no changes found ''' % kilntest.KILNURL, status=1) hgt.hg(['up'], stdout='''2 files updated, 0 files merged, 2 files removed, 0 files unresolved getting changed bfiles 1 big files updated, 1 removed ''') os.chdir('..') common.checkrepos(hgt, 'repo1', 'repo2', [0, 3]) os.chdir('repo2') hgt.writefile('a/n1', 'n11') hgt.writefile('a/b1', 'b11') hgt.hg(['commit', '-m', 'edit n1 and b1']) hgt.hg(['out', '--bf'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes changeset: 4:fdb0cdc62a97 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: edit n1 and b1 searching for changes kbfiles to upload: a/b1 ''' % kilntest.KILNURL) os.chdir('../repo1') hgt.hg(['pull', '../repo2'], stdout='''pulling from ../repo2 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files (run 'hg update' to get a working copy) ''') hgt.hg(['up'], stdout='''2 files updated, 0 files merged, 0 files removed, 0 files unresolved getting changed bfiles 1 big files updated, 0 removed ''') hgt.writefile('a/b/n2', 'n22') hgt.writefile('a/b/b2', 'b22') hgt.hg(['commit', '-m', 'edit n22 and b22']) hgt.hg(['out', '--bf'], stdout='''comparing with %s/Repo/Test/Test/Test searching for changes changeset: 4:fdb0cdc62a97 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: edit n1 and b1 changeset: 5:f79826fcf061 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: edit n22 and b22 searching for changes kbfiles to upload: a/b1 a/b/b2 ''' % kilntest.KILNURL) hgt.hg(['summary', '--remote', '--bf'], stdout='''parent: 5:f79826fcf061 tip edit n22 and b22 branch: default commit: 4 unknown (clean) update: (current) remote: 2 outgoing searching for changes kbfiles: 2 to upload ''') hgt.hg(['push'], stdout='''pushing to %s/Repo/Test/Test/Test searching for changes searching for changes remote: kiln: successfully pushed 2 changesets ''' % kilntest.KILNURL) os.chdir('../repo2') hgt.hg(['pull'], stdout='''pulling from %s/Repo/Test/Test/Test searching for changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files (run 'hg update' to get a working copy) ''' % kilntest.KILNURL) os.chdir('..') common.checkrepos(hgt, 'repo1', 'repo2', [0, 3, 4, 5])