##// END OF EJS Templates
tests: replace "cp -r" with "cp -R"...
Jun Wu -
r30556:c059286a default
parent child Browse files
Show More
@@ -1,897 +1,897 b''
1 $ hg init
1 $ hg init
2
2
3 no bookmarks
3 no bookmarks
4
4
5 $ hg bookmarks
5 $ hg bookmarks
6 no bookmarks set
6 no bookmarks set
7
7
8 $ hg bookmarks -Tjson
8 $ hg bookmarks -Tjson
9 [
9 [
10 ]
10 ]
11
11
12 bookmark rev -1
12 bookmark rev -1
13
13
14 $ hg bookmark X
14 $ hg bookmark X
15
15
16 list bookmarks
16 list bookmarks
17
17
18 $ hg bookmarks
18 $ hg bookmarks
19 * X -1:000000000000
19 * X -1:000000000000
20
20
21 list bookmarks with color
21 list bookmarks with color
22
22
23 $ hg --config extensions.color= --config color.mode=ansi \
23 $ hg --config extensions.color= --config color.mode=ansi \
24 > bookmarks --color=always
24 > bookmarks --color=always
25 \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m -1:000000000000\x1b[0m (esc)
25 \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m -1:000000000000\x1b[0m (esc)
26
26
27 $ echo a > a
27 $ echo a > a
28 $ hg add a
28 $ hg add a
29 $ hg commit -m 0
29 $ hg commit -m 0
30
30
31 bookmark X moved to rev 0
31 bookmark X moved to rev 0
32
32
33 $ hg bookmarks
33 $ hg bookmarks
34 * X 0:f7b1eb17ad24
34 * X 0:f7b1eb17ad24
35
35
36 look up bookmark
36 look up bookmark
37
37
38 $ hg log -r X
38 $ hg log -r X
39 changeset: 0:f7b1eb17ad24
39 changeset: 0:f7b1eb17ad24
40 bookmark: X
40 bookmark: X
41 tag: tip
41 tag: tip
42 user: test
42 user: test
43 date: Thu Jan 01 00:00:00 1970 +0000
43 date: Thu Jan 01 00:00:00 1970 +0000
44 summary: 0
44 summary: 0
45
45
46
46
47 second bookmark for rev 0, command should work even with ui.strict on
47 second bookmark for rev 0, command should work even with ui.strict on
48
48
49 $ hg --config ui.strict=1 bookmark X2
49 $ hg --config ui.strict=1 bookmark X2
50
50
51 bookmark rev -1 again
51 bookmark rev -1 again
52
52
53 $ hg bookmark -r null Y
53 $ hg bookmark -r null Y
54
54
55 list bookmarks
55 list bookmarks
56
56
57 $ hg bookmarks
57 $ hg bookmarks
58 X 0:f7b1eb17ad24
58 X 0:f7b1eb17ad24
59 * X2 0:f7b1eb17ad24
59 * X2 0:f7b1eb17ad24
60 Y -1:000000000000
60 Y -1:000000000000
61
61
62 $ echo b > b
62 $ echo b > b
63 $ hg add b
63 $ hg add b
64 $ hg commit -m 1
64 $ hg commit -m 1
65
65
66 $ hg bookmarks -Tjson
66 $ hg bookmarks -Tjson
67 [
67 [
68 {
68 {
69 "active": false,
69 "active": false,
70 "bookmark": "X",
70 "bookmark": "X",
71 "node": "f7b1eb17ad24730a1651fccd46c43826d1bbc2ac",
71 "node": "f7b1eb17ad24730a1651fccd46c43826d1bbc2ac",
72 "rev": 0
72 "rev": 0
73 },
73 },
74 {
74 {
75 "active": true,
75 "active": true,
76 "bookmark": "X2",
76 "bookmark": "X2",
77 "node": "925d80f479bb026b0fb3deb27503780b13f74123",
77 "node": "925d80f479bb026b0fb3deb27503780b13f74123",
78 "rev": 1
78 "rev": 1
79 },
79 },
80 {
80 {
81 "active": false,
81 "active": false,
82 "bookmark": "Y",
82 "bookmark": "Y",
83 "node": "0000000000000000000000000000000000000000",
83 "node": "0000000000000000000000000000000000000000",
84 "rev": -1
84 "rev": -1
85 }
85 }
86 ]
86 ]
87
87
88 bookmarks revset
88 bookmarks revset
89
89
90 $ hg log -r 'bookmark()'
90 $ hg log -r 'bookmark()'
91 changeset: 0:f7b1eb17ad24
91 changeset: 0:f7b1eb17ad24
92 bookmark: X
92 bookmark: X
93 user: test
93 user: test
94 date: Thu Jan 01 00:00:00 1970 +0000
94 date: Thu Jan 01 00:00:00 1970 +0000
95 summary: 0
95 summary: 0
96
96
97 changeset: 1:925d80f479bb
97 changeset: 1:925d80f479bb
98 bookmark: X2
98 bookmark: X2
99 tag: tip
99 tag: tip
100 user: test
100 user: test
101 date: Thu Jan 01 00:00:00 1970 +0000
101 date: Thu Jan 01 00:00:00 1970 +0000
102 summary: 1
102 summary: 1
103
103
104 $ hg log -r 'bookmark(Y)'
104 $ hg log -r 'bookmark(Y)'
105 $ hg log -r 'bookmark(X2)'
105 $ hg log -r 'bookmark(X2)'
106 changeset: 1:925d80f479bb
106 changeset: 1:925d80f479bb
107 bookmark: X2
107 bookmark: X2
108 tag: tip
108 tag: tip
109 user: test
109 user: test
110 date: Thu Jan 01 00:00:00 1970 +0000
110 date: Thu Jan 01 00:00:00 1970 +0000
111 summary: 1
111 summary: 1
112
112
113 $ hg log -r 'bookmark("re:X")'
113 $ hg log -r 'bookmark("re:X")'
114 changeset: 0:f7b1eb17ad24
114 changeset: 0:f7b1eb17ad24
115 bookmark: X
115 bookmark: X
116 user: test
116 user: test
117 date: Thu Jan 01 00:00:00 1970 +0000
117 date: Thu Jan 01 00:00:00 1970 +0000
118 summary: 0
118 summary: 0
119
119
120 changeset: 1:925d80f479bb
120 changeset: 1:925d80f479bb
121 bookmark: X2
121 bookmark: X2
122 tag: tip
122 tag: tip
123 user: test
123 user: test
124 date: Thu Jan 01 00:00:00 1970 +0000
124 date: Thu Jan 01 00:00:00 1970 +0000
125 summary: 1
125 summary: 1
126
126
127 $ hg log -r 'bookmark("literal:X")'
127 $ hg log -r 'bookmark("literal:X")'
128 changeset: 0:f7b1eb17ad24
128 changeset: 0:f7b1eb17ad24
129 bookmark: X
129 bookmark: X
130 user: test
130 user: test
131 date: Thu Jan 01 00:00:00 1970 +0000
131 date: Thu Jan 01 00:00:00 1970 +0000
132 summary: 0
132 summary: 0
133
133
134
134
135 $ hg log -r 'bookmark(unknown)'
135 $ hg log -r 'bookmark(unknown)'
136 abort: bookmark 'unknown' does not exist!
136 abort: bookmark 'unknown' does not exist!
137 [255]
137 [255]
138 $ hg log -r 'bookmark("literal:unknown")'
138 $ hg log -r 'bookmark("literal:unknown")'
139 abort: bookmark 'unknown' does not exist!
139 abort: bookmark 'unknown' does not exist!
140 [255]
140 [255]
141 $ hg log -r 'bookmark("re:unknown")'
141 $ hg log -r 'bookmark("re:unknown")'
142 abort: no bookmarks exist that match 'unknown'!
142 abort: no bookmarks exist that match 'unknown'!
143 [255]
143 [255]
144 $ hg log -r 'present(bookmark("literal:unknown"))'
144 $ hg log -r 'present(bookmark("literal:unknown"))'
145 $ hg log -r 'present(bookmark("re:unknown"))'
145 $ hg log -r 'present(bookmark("re:unknown"))'
146
146
147 $ hg help revsets | grep 'bookmark('
147 $ hg help revsets | grep 'bookmark('
148 "bookmark([name])"
148 "bookmark([name])"
149
149
150 bookmarks X and X2 moved to rev 1, Y at rev -1
150 bookmarks X and X2 moved to rev 1, Y at rev -1
151
151
152 $ hg bookmarks
152 $ hg bookmarks
153 X 0:f7b1eb17ad24
153 X 0:f7b1eb17ad24
154 * X2 1:925d80f479bb
154 * X2 1:925d80f479bb
155 Y -1:000000000000
155 Y -1:000000000000
156
156
157 bookmark rev 0 again
157 bookmark rev 0 again
158
158
159 $ hg bookmark -r 0 Z
159 $ hg bookmark -r 0 Z
160
160
161 $ hg update X
161 $ hg update X
162 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
162 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
163 (activating bookmark X)
163 (activating bookmark X)
164 $ echo c > c
164 $ echo c > c
165 $ hg add c
165 $ hg add c
166 $ hg commit -m 2
166 $ hg commit -m 2
167 created new head
167 created new head
168
168
169 bookmarks X moved to rev 2, Y at rev -1, Z at rev 0
169 bookmarks X moved to rev 2, Y at rev -1, Z at rev 0
170
170
171 $ hg bookmarks
171 $ hg bookmarks
172 * X 2:db815d6d32e6
172 * X 2:db815d6d32e6
173 X2 1:925d80f479bb
173 X2 1:925d80f479bb
174 Y -1:000000000000
174 Y -1:000000000000
175 Z 0:f7b1eb17ad24
175 Z 0:f7b1eb17ad24
176
176
177 rename nonexistent bookmark
177 rename nonexistent bookmark
178
178
179 $ hg bookmark -m A B
179 $ hg bookmark -m A B
180 abort: bookmark 'A' does not exist
180 abort: bookmark 'A' does not exist
181 [255]
181 [255]
182
182
183 rename to existent bookmark
183 rename to existent bookmark
184
184
185 $ hg bookmark -m X Y
185 $ hg bookmark -m X Y
186 abort: bookmark 'Y' already exists (use -f to force)
186 abort: bookmark 'Y' already exists (use -f to force)
187 [255]
187 [255]
188
188
189 force rename to existent bookmark
189 force rename to existent bookmark
190
190
191 $ hg bookmark -f -m X Y
191 $ hg bookmark -f -m X Y
192
192
193 list bookmarks
193 list bookmarks
194
194
195 $ hg bookmark
195 $ hg bookmark
196 X2 1:925d80f479bb
196 X2 1:925d80f479bb
197 * Y 2:db815d6d32e6
197 * Y 2:db815d6d32e6
198 Z 0:f7b1eb17ad24
198 Z 0:f7b1eb17ad24
199
199
200 bookmarks from a revset
200 bookmarks from a revset
201 $ hg bookmark -r '.^1' REVSET
201 $ hg bookmark -r '.^1' REVSET
202 $ hg bookmark -r ':tip' TIP
202 $ hg bookmark -r ':tip' TIP
203 $ hg up -q TIP
203 $ hg up -q TIP
204 $ hg bookmarks
204 $ hg bookmarks
205 REVSET 0:f7b1eb17ad24
205 REVSET 0:f7b1eb17ad24
206 * TIP 2:db815d6d32e6
206 * TIP 2:db815d6d32e6
207 X2 1:925d80f479bb
207 X2 1:925d80f479bb
208 Y 2:db815d6d32e6
208 Y 2:db815d6d32e6
209 Z 0:f7b1eb17ad24
209 Z 0:f7b1eb17ad24
210
210
211 $ hg bookmark -d REVSET
211 $ hg bookmark -d REVSET
212 $ hg bookmark -d TIP
212 $ hg bookmark -d TIP
213
213
214 rename without new name or multiple names
214 rename without new name or multiple names
215
215
216 $ hg bookmark -m Y
216 $ hg bookmark -m Y
217 abort: new bookmark name required
217 abort: new bookmark name required
218 [255]
218 [255]
219 $ hg bookmark -m Y Y2 Y3
219 $ hg bookmark -m Y Y2 Y3
220 abort: only one new bookmark name allowed
220 abort: only one new bookmark name allowed
221 [255]
221 [255]
222
222
223 delete without name
223 delete without name
224
224
225 $ hg bookmark -d
225 $ hg bookmark -d
226 abort: bookmark name required
226 abort: bookmark name required
227 [255]
227 [255]
228
228
229 delete nonexistent bookmark
229 delete nonexistent bookmark
230
230
231 $ hg bookmark -d A
231 $ hg bookmark -d A
232 abort: bookmark 'A' does not exist
232 abort: bookmark 'A' does not exist
233 [255]
233 [255]
234
234
235 bookmark name with spaces should be stripped
235 bookmark name with spaces should be stripped
236
236
237 $ hg bookmark ' x y '
237 $ hg bookmark ' x y '
238
238
239 list bookmarks
239 list bookmarks
240
240
241 $ hg bookmarks
241 $ hg bookmarks
242 X2 1:925d80f479bb
242 X2 1:925d80f479bb
243 Y 2:db815d6d32e6
243 Y 2:db815d6d32e6
244 Z 0:f7b1eb17ad24
244 Z 0:f7b1eb17ad24
245 * x y 2:db815d6d32e6
245 * x y 2:db815d6d32e6
246
246
247 look up stripped bookmark name
247 look up stripped bookmark name
248
248
249 $ hg log -r '"x y"'
249 $ hg log -r '"x y"'
250 changeset: 2:db815d6d32e6
250 changeset: 2:db815d6d32e6
251 bookmark: Y
251 bookmark: Y
252 bookmark: x y
252 bookmark: x y
253 tag: tip
253 tag: tip
254 parent: 0:f7b1eb17ad24
254 parent: 0:f7b1eb17ad24
255 user: test
255 user: test
256 date: Thu Jan 01 00:00:00 1970 +0000
256 date: Thu Jan 01 00:00:00 1970 +0000
257 summary: 2
257 summary: 2
258
258
259
259
260 reject bookmark name with newline
260 reject bookmark name with newline
261
261
262 $ hg bookmark '
262 $ hg bookmark '
263 > '
263 > '
264 abort: bookmark names cannot consist entirely of whitespace
264 abort: bookmark names cannot consist entirely of whitespace
265 [255]
265 [255]
266
266
267 $ hg bookmark -m Z '
267 $ hg bookmark -m Z '
268 > '
268 > '
269 abort: bookmark names cannot consist entirely of whitespace
269 abort: bookmark names cannot consist entirely of whitespace
270 [255]
270 [255]
271
271
272 bookmark with reserved name
272 bookmark with reserved name
273
273
274 $ hg bookmark tip
274 $ hg bookmark tip
275 abort: the name 'tip' is reserved
275 abort: the name 'tip' is reserved
276 [255]
276 [255]
277
277
278 $ hg bookmark .
278 $ hg bookmark .
279 abort: the name '.' is reserved
279 abort: the name '.' is reserved
280 [255]
280 [255]
281
281
282 $ hg bookmark null
282 $ hg bookmark null
283 abort: the name 'null' is reserved
283 abort: the name 'null' is reserved
284 [255]
284 [255]
285
285
286
286
287 bookmark with existing name
287 bookmark with existing name
288
288
289 $ hg bookmark X2
289 $ hg bookmark X2
290 abort: bookmark 'X2' already exists (use -f to force)
290 abort: bookmark 'X2' already exists (use -f to force)
291 [255]
291 [255]
292
292
293 $ hg bookmark -m Y Z
293 $ hg bookmark -m Y Z
294 abort: bookmark 'Z' already exists (use -f to force)
294 abort: bookmark 'Z' already exists (use -f to force)
295 [255]
295 [255]
296
296
297 bookmark with name of branch
297 bookmark with name of branch
298
298
299 $ hg bookmark default
299 $ hg bookmark default
300 abort: a bookmark cannot have the name of an existing branch
300 abort: a bookmark cannot have the name of an existing branch
301 [255]
301 [255]
302
302
303 $ hg bookmark -m Y default
303 $ hg bookmark -m Y default
304 abort: a bookmark cannot have the name of an existing branch
304 abort: a bookmark cannot have the name of an existing branch
305 [255]
305 [255]
306
306
307 bookmark with integer name
307 bookmark with integer name
308
308
309 $ hg bookmark 10
309 $ hg bookmark 10
310 abort: cannot use an integer as a name
310 abort: cannot use an integer as a name
311 [255]
311 [255]
312
312
313 incompatible options
313 incompatible options
314
314
315 $ hg bookmark -m Y -d Z
315 $ hg bookmark -m Y -d Z
316 abort: --delete and --rename are incompatible
316 abort: --delete and --rename are incompatible
317 [255]
317 [255]
318
318
319 $ hg bookmark -r 1 -d Z
319 $ hg bookmark -r 1 -d Z
320 abort: --rev is incompatible with --delete
320 abort: --rev is incompatible with --delete
321 [255]
321 [255]
322
322
323 $ hg bookmark -r 1 -m Z Y
323 $ hg bookmark -r 1 -m Z Y
324 abort: --rev is incompatible with --rename
324 abort: --rev is incompatible with --rename
325 [255]
325 [255]
326
326
327 force bookmark with existing name
327 force bookmark with existing name
328
328
329 $ hg bookmark -f X2
329 $ hg bookmark -f X2
330
330
331 force bookmark back to where it was, should deactivate it
331 force bookmark back to where it was, should deactivate it
332
332
333 $ hg bookmark -fr1 X2
333 $ hg bookmark -fr1 X2
334 $ hg bookmarks
334 $ hg bookmarks
335 X2 1:925d80f479bb
335 X2 1:925d80f479bb
336 Y 2:db815d6d32e6
336 Y 2:db815d6d32e6
337 Z 0:f7b1eb17ad24
337 Z 0:f7b1eb17ad24
338 x y 2:db815d6d32e6
338 x y 2:db815d6d32e6
339
339
340 forward bookmark to descendant without --force
340 forward bookmark to descendant without --force
341
341
342 $ hg bookmark Z
342 $ hg bookmark Z
343 moving bookmark 'Z' forward from f7b1eb17ad24
343 moving bookmark 'Z' forward from f7b1eb17ad24
344
344
345 list bookmarks
345 list bookmarks
346
346
347 $ hg bookmark
347 $ hg bookmark
348 X2 1:925d80f479bb
348 X2 1:925d80f479bb
349 Y 2:db815d6d32e6
349 Y 2:db815d6d32e6
350 * Z 2:db815d6d32e6
350 * Z 2:db815d6d32e6
351 x y 2:db815d6d32e6
351 x y 2:db815d6d32e6
352
352
353 revision but no bookmark name
353 revision but no bookmark name
354
354
355 $ hg bookmark -r .
355 $ hg bookmark -r .
356 abort: bookmark name required
356 abort: bookmark name required
357 [255]
357 [255]
358
358
359 bookmark name with whitespace only
359 bookmark name with whitespace only
360
360
361 $ hg bookmark ' '
361 $ hg bookmark ' '
362 abort: bookmark names cannot consist entirely of whitespace
362 abort: bookmark names cannot consist entirely of whitespace
363 [255]
363 [255]
364
364
365 $ hg bookmark -m Y ' '
365 $ hg bookmark -m Y ' '
366 abort: bookmark names cannot consist entirely of whitespace
366 abort: bookmark names cannot consist entirely of whitespace
367 [255]
367 [255]
368
368
369 invalid bookmark
369 invalid bookmark
370
370
371 $ hg bookmark 'foo:bar'
371 $ hg bookmark 'foo:bar'
372 abort: ':' cannot be used in a name
372 abort: ':' cannot be used in a name
373 [255]
373 [255]
374
374
375 $ hg bookmark 'foo
375 $ hg bookmark 'foo
376 > bar'
376 > bar'
377 abort: '\n' cannot be used in a name
377 abort: '\n' cannot be used in a name
378 [255]
378 [255]
379
379
380 the bookmark extension should be ignored now that it is part of core
380 the bookmark extension should be ignored now that it is part of core
381
381
382 $ echo "[extensions]" >> $HGRCPATH
382 $ echo "[extensions]" >> $HGRCPATH
383 $ echo "bookmarks=" >> $HGRCPATH
383 $ echo "bookmarks=" >> $HGRCPATH
384 $ hg bookmarks
384 $ hg bookmarks
385 X2 1:925d80f479bb
385 X2 1:925d80f479bb
386 Y 2:db815d6d32e6
386 Y 2:db815d6d32e6
387 * Z 2:db815d6d32e6
387 * Z 2:db815d6d32e6
388 x y 2:db815d6d32e6
388 x y 2:db815d6d32e6
389
389
390 test summary
390 test summary
391
391
392 $ hg summary
392 $ hg summary
393 parent: 2:db815d6d32e6 tip
393 parent: 2:db815d6d32e6 tip
394 2
394 2
395 branch: default
395 branch: default
396 bookmarks: *Z Y x y
396 bookmarks: *Z Y x y
397 commit: (clean)
397 commit: (clean)
398 update: 1 new changesets, 2 branch heads (merge)
398 update: 1 new changesets, 2 branch heads (merge)
399 phases: 3 draft
399 phases: 3 draft
400
400
401 test id
401 test id
402
402
403 $ hg id
403 $ hg id
404 db815d6d32e6 tip Y/Z/x y
404 db815d6d32e6 tip Y/Z/x y
405
405
406 test rollback
406 test rollback
407
407
408 $ echo foo > f1
408 $ echo foo > f1
409 $ hg bookmark tmp-rollback
409 $ hg bookmark tmp-rollback
410 $ hg ci -Amr
410 $ hg ci -Amr
411 adding f1
411 adding f1
412 $ hg bookmarks
412 $ hg bookmarks
413 X2 1:925d80f479bb
413 X2 1:925d80f479bb
414 Y 2:db815d6d32e6
414 Y 2:db815d6d32e6
415 Z 2:db815d6d32e6
415 Z 2:db815d6d32e6
416 * tmp-rollback 3:2bf5cfec5864
416 * tmp-rollback 3:2bf5cfec5864
417 x y 2:db815d6d32e6
417 x y 2:db815d6d32e6
418 $ hg rollback
418 $ hg rollback
419 repository tip rolled back to revision 2 (undo commit)
419 repository tip rolled back to revision 2 (undo commit)
420 working directory now based on revision 2
420 working directory now based on revision 2
421 $ hg bookmarks
421 $ hg bookmarks
422 X2 1:925d80f479bb
422 X2 1:925d80f479bb
423 Y 2:db815d6d32e6
423 Y 2:db815d6d32e6
424 Z 2:db815d6d32e6
424 Z 2:db815d6d32e6
425 * tmp-rollback 2:db815d6d32e6
425 * tmp-rollback 2:db815d6d32e6
426 x y 2:db815d6d32e6
426 x y 2:db815d6d32e6
427 $ hg bookmark -f Z -r 1
427 $ hg bookmark -f Z -r 1
428 $ hg rollback
428 $ hg rollback
429 repository tip rolled back to revision 2 (undo bookmark)
429 repository tip rolled back to revision 2 (undo bookmark)
430 $ hg bookmarks
430 $ hg bookmarks
431 X2 1:925d80f479bb
431 X2 1:925d80f479bb
432 Y 2:db815d6d32e6
432 Y 2:db815d6d32e6
433 Z 2:db815d6d32e6
433 Z 2:db815d6d32e6
434 * tmp-rollback 2:db815d6d32e6
434 * tmp-rollback 2:db815d6d32e6
435 x y 2:db815d6d32e6
435 x y 2:db815d6d32e6
436 $ hg bookmark -d tmp-rollback
436 $ hg bookmark -d tmp-rollback
437
437
438 activate bookmark on working dir parent without --force
438 activate bookmark on working dir parent without --force
439
439
440 $ hg bookmark --inactive Z
440 $ hg bookmark --inactive Z
441 $ hg bookmark Z
441 $ hg bookmark Z
442
442
443 test clone
443 test clone
444
444
445 $ hg bookmark -r 2 -i @
445 $ hg bookmark -r 2 -i @
446 $ hg bookmark -r 2 -i a@
446 $ hg bookmark -r 2 -i a@
447 $ hg bookmarks
447 $ hg bookmarks
448 @ 2:db815d6d32e6
448 @ 2:db815d6d32e6
449 X2 1:925d80f479bb
449 X2 1:925d80f479bb
450 Y 2:db815d6d32e6
450 Y 2:db815d6d32e6
451 * Z 2:db815d6d32e6
451 * Z 2:db815d6d32e6
452 a@ 2:db815d6d32e6
452 a@ 2:db815d6d32e6
453 x y 2:db815d6d32e6
453 x y 2:db815d6d32e6
454 $ hg clone . cloned-bookmarks
454 $ hg clone . cloned-bookmarks
455 updating to bookmark @
455 updating to bookmark @
456 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
456 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
457 $ hg -R cloned-bookmarks bookmarks
457 $ hg -R cloned-bookmarks bookmarks
458 * @ 2:db815d6d32e6
458 * @ 2:db815d6d32e6
459 X2 1:925d80f479bb
459 X2 1:925d80f479bb
460 Y 2:db815d6d32e6
460 Y 2:db815d6d32e6
461 Z 2:db815d6d32e6
461 Z 2:db815d6d32e6
462 a@ 2:db815d6d32e6
462 a@ 2:db815d6d32e6
463 x y 2:db815d6d32e6
463 x y 2:db815d6d32e6
464
464
465 test clone with pull protocol
465 test clone with pull protocol
466
466
467 $ hg clone --pull . cloned-bookmarks-pull
467 $ hg clone --pull . cloned-bookmarks-pull
468 requesting all changes
468 requesting all changes
469 adding changesets
469 adding changesets
470 adding manifests
470 adding manifests
471 adding file changes
471 adding file changes
472 added 3 changesets with 3 changes to 3 files (+1 heads)
472 added 3 changesets with 3 changes to 3 files (+1 heads)
473 updating to bookmark @
473 updating to bookmark @
474 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
474 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
475 $ hg -R cloned-bookmarks-pull bookmarks
475 $ hg -R cloned-bookmarks-pull bookmarks
476 * @ 2:db815d6d32e6
476 * @ 2:db815d6d32e6
477 X2 1:925d80f479bb
477 X2 1:925d80f479bb
478 Y 2:db815d6d32e6
478 Y 2:db815d6d32e6
479 Z 2:db815d6d32e6
479 Z 2:db815d6d32e6
480 a@ 2:db815d6d32e6
480 a@ 2:db815d6d32e6
481 x y 2:db815d6d32e6
481 x y 2:db815d6d32e6
482
482
483 delete multiple bookmarks at once
483 delete multiple bookmarks at once
484
484
485 $ hg bookmark -d @ a@
485 $ hg bookmark -d @ a@
486
486
487 test clone with a bookmark named "default" (issue3677)
487 test clone with a bookmark named "default" (issue3677)
488
488
489 $ hg bookmark -r 1 -f -i default
489 $ hg bookmark -r 1 -f -i default
490 $ hg clone . cloned-bookmark-default
490 $ hg clone . cloned-bookmark-default
491 updating to branch default
491 updating to branch default
492 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
492 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
493 $ hg -R cloned-bookmark-default bookmarks
493 $ hg -R cloned-bookmark-default bookmarks
494 X2 1:925d80f479bb
494 X2 1:925d80f479bb
495 Y 2:db815d6d32e6
495 Y 2:db815d6d32e6
496 Z 2:db815d6d32e6
496 Z 2:db815d6d32e6
497 default 1:925d80f479bb
497 default 1:925d80f479bb
498 x y 2:db815d6d32e6
498 x y 2:db815d6d32e6
499 $ hg -R cloned-bookmark-default parents -q
499 $ hg -R cloned-bookmark-default parents -q
500 2:db815d6d32e6
500 2:db815d6d32e6
501 $ hg bookmark -d default
501 $ hg bookmark -d default
502
502
503 test clone with a specific revision
503 test clone with a specific revision
504
504
505 $ hg clone -r 925d80 . cloned-bookmarks-rev
505 $ hg clone -r 925d80 . cloned-bookmarks-rev
506 adding changesets
506 adding changesets
507 adding manifests
507 adding manifests
508 adding file changes
508 adding file changes
509 added 2 changesets with 2 changes to 2 files
509 added 2 changesets with 2 changes to 2 files
510 updating to branch default
510 updating to branch default
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
512 $ hg -R cloned-bookmarks-rev bookmarks
512 $ hg -R cloned-bookmarks-rev bookmarks
513 X2 1:925d80f479bb
513 X2 1:925d80f479bb
514
514
515 test clone with update to a bookmark
515 test clone with update to a bookmark
516
516
517 $ hg clone -u Z . ../cloned-bookmarks-update
517 $ hg clone -u Z . ../cloned-bookmarks-update
518 updating to branch default
518 updating to branch default
519 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
519 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
520 $ hg -R ../cloned-bookmarks-update bookmarks
520 $ hg -R ../cloned-bookmarks-update bookmarks
521 X2 1:925d80f479bb
521 X2 1:925d80f479bb
522 Y 2:db815d6d32e6
522 Y 2:db815d6d32e6
523 * Z 2:db815d6d32e6
523 * Z 2:db815d6d32e6
524 x y 2:db815d6d32e6
524 x y 2:db815d6d32e6
525
525
526 create bundle with two heads
526 create bundle with two heads
527
527
528 $ hg clone . tobundle
528 $ hg clone . tobundle
529 updating to branch default
529 updating to branch default
530 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
530 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
531 $ echo x > tobundle/x
531 $ echo x > tobundle/x
532 $ hg -R tobundle add tobundle/x
532 $ hg -R tobundle add tobundle/x
533 $ hg -R tobundle commit -m'x'
533 $ hg -R tobundle commit -m'x'
534 $ hg -R tobundle update -r -2
534 $ hg -R tobundle update -r -2
535 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
535 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
536 $ echo y > tobundle/y
536 $ echo y > tobundle/y
537 $ hg -R tobundle branch test
537 $ hg -R tobundle branch test
538 marked working directory as branch test
538 marked working directory as branch test
539 (branches are permanent and global, did you want a bookmark?)
539 (branches are permanent and global, did you want a bookmark?)
540 $ hg -R tobundle add tobundle/y
540 $ hg -R tobundle add tobundle/y
541 $ hg -R tobundle commit -m'y'
541 $ hg -R tobundle commit -m'y'
542 $ hg -R tobundle bundle tobundle.hg
542 $ hg -R tobundle bundle tobundle.hg
543 searching for changes
543 searching for changes
544 2 changesets found
544 2 changesets found
545 $ hg unbundle tobundle.hg
545 $ hg unbundle tobundle.hg
546 adding changesets
546 adding changesets
547 adding manifests
547 adding manifests
548 adding file changes
548 adding file changes
549 added 2 changesets with 2 changes to 2 files (+1 heads)
549 added 2 changesets with 2 changes to 2 files (+1 heads)
550 (run 'hg heads' to see heads, 'hg merge' to merge)
550 (run 'hg heads' to see heads, 'hg merge' to merge)
551
551
552 update to active bookmark if it's not the parent
552 update to active bookmark if it's not the parent
553
553
554 $ hg summary
554 $ hg summary
555 parent: 2:db815d6d32e6
555 parent: 2:db815d6d32e6
556 2
556 2
557 branch: default
557 branch: default
558 bookmarks: *Z Y x y
558 bookmarks: *Z Y x y
559 commit: 1 added, 1 unknown (new branch head)
559 commit: 1 added, 1 unknown (new branch head)
560 update: 2 new changesets (update)
560 update: 2 new changesets (update)
561 phases: 5 draft
561 phases: 5 draft
562 $ hg update
562 $ hg update
563 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
563 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
564 updating bookmark Z
564 updating bookmark Z
565 $ hg bookmarks
565 $ hg bookmarks
566 X2 1:925d80f479bb
566 X2 1:925d80f479bb
567 Y 2:db815d6d32e6
567 Y 2:db815d6d32e6
568 * Z 3:125c9a1d6df6
568 * Z 3:125c9a1d6df6
569 x y 2:db815d6d32e6
569 x y 2:db815d6d32e6
570
570
571 pull --update works the same as pull && update
571 pull --update works the same as pull && update
572
572
573 $ hg bookmark -r3 Y
573 $ hg bookmark -r3 Y
574 moving bookmark 'Y' forward from db815d6d32e6
574 moving bookmark 'Y' forward from db815d6d32e6
575 $ cp -r ../cloned-bookmarks-update ../cloned-bookmarks-manual-update
575 $ cp -R ../cloned-bookmarks-update ../cloned-bookmarks-manual-update
576 $ cp -r ../cloned-bookmarks-update ../cloned-bookmarks-manual-update-with-divergence
576 $ cp -R ../cloned-bookmarks-update ../cloned-bookmarks-manual-update-with-divergence
577
577
578 (manual version)
578 (manual version)
579
579
580 $ hg -R ../cloned-bookmarks-manual-update update Y
580 $ hg -R ../cloned-bookmarks-manual-update update Y
581 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
581 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
582 (activating bookmark Y)
582 (activating bookmark Y)
583 $ hg -R ../cloned-bookmarks-manual-update pull .
583 $ hg -R ../cloned-bookmarks-manual-update pull .
584 pulling from .
584 pulling from .
585 searching for changes
585 searching for changes
586 adding changesets
586 adding changesets
587 adding manifests
587 adding manifests
588 adding file changes
588 adding file changes
589 added 2 changesets with 2 changes to 2 files (+1 heads)
589 added 2 changesets with 2 changes to 2 files (+1 heads)
590 updating bookmark Y
590 updating bookmark Y
591 updating bookmark Z
591 updating bookmark Z
592 (run 'hg heads' to see heads, 'hg merge' to merge)
592 (run 'hg heads' to see heads, 'hg merge' to merge)
593
593
594 (# tests strange but with --date crashing when bookmark have to move)
594 (# tests strange but with --date crashing when bookmark have to move)
595
595
596 $ hg -R ../cloned-bookmarks-manual-update update -d 1986
596 $ hg -R ../cloned-bookmarks-manual-update update -d 1986
597 abort: revision matching date not found
597 abort: revision matching date not found
598 [255]
598 [255]
599 $ hg -R ../cloned-bookmarks-manual-update update
599 $ hg -R ../cloned-bookmarks-manual-update update
600 updating to active bookmark Y
600 updating to active bookmark Y
601 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
601 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
602
602
603 (all in one version)
603 (all in one version)
604
604
605 $ hg -R ../cloned-bookmarks-update update Y
605 $ hg -R ../cloned-bookmarks-update update Y
606 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
606 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
607 (activating bookmark Y)
607 (activating bookmark Y)
608 $ hg -R ../cloned-bookmarks-update pull --update .
608 $ hg -R ../cloned-bookmarks-update pull --update .
609 pulling from .
609 pulling from .
610 searching for changes
610 searching for changes
611 adding changesets
611 adding changesets
612 adding manifests
612 adding manifests
613 adding file changes
613 adding file changes
614 added 2 changesets with 2 changes to 2 files (+1 heads)
614 added 2 changesets with 2 changes to 2 files (+1 heads)
615 updating bookmark Y
615 updating bookmark Y
616 updating bookmark Z
616 updating bookmark Z
617 updating to active bookmark Y
617 updating to active bookmark Y
618 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
618 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
619
619
620 We warn about divergent during bare update to the active bookmark
620 We warn about divergent during bare update to the active bookmark
621
621
622 $ hg -R ../cloned-bookmarks-manual-update-with-divergence update Y
622 $ hg -R ../cloned-bookmarks-manual-update-with-divergence update Y
623 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
623 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
624 (activating bookmark Y)
624 (activating bookmark Y)
625 $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks -r X2 Y@1
625 $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks -r X2 Y@1
626 $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks
626 $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks
627 X2 1:925d80f479bb
627 X2 1:925d80f479bb
628 * Y 2:db815d6d32e6
628 * Y 2:db815d6d32e6
629 Y@1 1:925d80f479bb
629 Y@1 1:925d80f479bb
630 Z 2:db815d6d32e6
630 Z 2:db815d6d32e6
631 x y 2:db815d6d32e6
631 x y 2:db815d6d32e6
632 $ hg -R ../cloned-bookmarks-manual-update-with-divergence pull
632 $ hg -R ../cloned-bookmarks-manual-update-with-divergence pull
633 pulling from $TESTTMP
633 pulling from $TESTTMP
634 searching for changes
634 searching for changes
635 adding changesets
635 adding changesets
636 adding manifests
636 adding manifests
637 adding file changes
637 adding file changes
638 added 2 changesets with 2 changes to 2 files (+1 heads)
638 added 2 changesets with 2 changes to 2 files (+1 heads)
639 updating bookmark Y
639 updating bookmark Y
640 updating bookmark Z
640 updating bookmark Z
641 (run 'hg heads' to see heads, 'hg merge' to merge)
641 (run 'hg heads' to see heads, 'hg merge' to merge)
642 $ hg -R ../cloned-bookmarks-manual-update-with-divergence update
642 $ hg -R ../cloned-bookmarks-manual-update-with-divergence update
643 updating to active bookmark Y
643 updating to active bookmark Y
644 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
644 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
645 1 other divergent bookmarks for "Y"
645 1 other divergent bookmarks for "Y"
646
646
647 test wrongly formated bookmark
647 test wrongly formated bookmark
648
648
649 $ echo '' >> .hg/bookmarks
649 $ echo '' >> .hg/bookmarks
650 $ hg bookmarks
650 $ hg bookmarks
651 X2 1:925d80f479bb
651 X2 1:925d80f479bb
652 Y 3:125c9a1d6df6
652 Y 3:125c9a1d6df6
653 * Z 3:125c9a1d6df6
653 * Z 3:125c9a1d6df6
654 x y 2:db815d6d32e6
654 x y 2:db815d6d32e6
655 $ echo "Ican'thasformatedlines" >> .hg/bookmarks
655 $ echo "Ican'thasformatedlines" >> .hg/bookmarks
656 $ hg bookmarks
656 $ hg bookmarks
657 malformed line in .hg/bookmarks: "Ican'thasformatedlines"
657 malformed line in .hg/bookmarks: "Ican'thasformatedlines"
658 X2 1:925d80f479bb
658 X2 1:925d80f479bb
659 Y 3:125c9a1d6df6
659 Y 3:125c9a1d6df6
660 * Z 3:125c9a1d6df6
660 * Z 3:125c9a1d6df6
661 x y 2:db815d6d32e6
661 x y 2:db815d6d32e6
662
662
663 test missing revisions
663 test missing revisions
664
664
665 $ echo "925d80f479bc z" > .hg/bookmarks
665 $ echo "925d80f479bc z" > .hg/bookmarks
666 $ hg book
666 $ hg book
667 no bookmarks set
667 no bookmarks set
668
668
669 test stripping a non-checked-out but bookmarked revision
669 test stripping a non-checked-out but bookmarked revision
670
670
671 $ hg log --graph
671 $ hg log --graph
672 o changeset: 4:9ba5f110a0b3
672 o changeset: 4:9ba5f110a0b3
673 | branch: test
673 | branch: test
674 | tag: tip
674 | tag: tip
675 | parent: 2:db815d6d32e6
675 | parent: 2:db815d6d32e6
676 | user: test
676 | user: test
677 | date: Thu Jan 01 00:00:00 1970 +0000
677 | date: Thu Jan 01 00:00:00 1970 +0000
678 | summary: y
678 | summary: y
679 |
679 |
680 | @ changeset: 3:125c9a1d6df6
680 | @ changeset: 3:125c9a1d6df6
681 |/ user: test
681 |/ user: test
682 | date: Thu Jan 01 00:00:00 1970 +0000
682 | date: Thu Jan 01 00:00:00 1970 +0000
683 | summary: x
683 | summary: x
684 |
684 |
685 o changeset: 2:db815d6d32e6
685 o changeset: 2:db815d6d32e6
686 | parent: 0:f7b1eb17ad24
686 | parent: 0:f7b1eb17ad24
687 | user: test
687 | user: test
688 | date: Thu Jan 01 00:00:00 1970 +0000
688 | date: Thu Jan 01 00:00:00 1970 +0000
689 | summary: 2
689 | summary: 2
690 |
690 |
691 | o changeset: 1:925d80f479bb
691 | o changeset: 1:925d80f479bb
692 |/ user: test
692 |/ user: test
693 | date: Thu Jan 01 00:00:00 1970 +0000
693 | date: Thu Jan 01 00:00:00 1970 +0000
694 | summary: 1
694 | summary: 1
695 |
695 |
696 o changeset: 0:f7b1eb17ad24
696 o changeset: 0:f7b1eb17ad24
697 user: test
697 user: test
698 date: Thu Jan 01 00:00:00 1970 +0000
698 date: Thu Jan 01 00:00:00 1970 +0000
699 summary: 0
699 summary: 0
700
700
701 $ hg book should-end-on-two
701 $ hg book should-end-on-two
702 $ hg co --clean 4
702 $ hg co --clean 4
703 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
703 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
704 (leaving bookmark should-end-on-two)
704 (leaving bookmark should-end-on-two)
705 $ hg book four
705 $ hg book four
706 $ hg --config extensions.mq= strip 3
706 $ hg --config extensions.mq= strip 3
707 saved backup bundle to * (glob)
707 saved backup bundle to * (glob)
708 should-end-on-two should end up pointing to revision 2, as that's the
708 should-end-on-two should end up pointing to revision 2, as that's the
709 tipmost surviving ancestor of the stripped revision.
709 tipmost surviving ancestor of the stripped revision.
710 $ hg log --graph
710 $ hg log --graph
711 @ changeset: 3:9ba5f110a0b3
711 @ changeset: 3:9ba5f110a0b3
712 | branch: test
712 | branch: test
713 | bookmark: four
713 | bookmark: four
714 | tag: tip
714 | tag: tip
715 | user: test
715 | user: test
716 | date: Thu Jan 01 00:00:00 1970 +0000
716 | date: Thu Jan 01 00:00:00 1970 +0000
717 | summary: y
717 | summary: y
718 |
718 |
719 o changeset: 2:db815d6d32e6
719 o changeset: 2:db815d6d32e6
720 | bookmark: should-end-on-two
720 | bookmark: should-end-on-two
721 | parent: 0:f7b1eb17ad24
721 | parent: 0:f7b1eb17ad24
722 | user: test
722 | user: test
723 | date: Thu Jan 01 00:00:00 1970 +0000
723 | date: Thu Jan 01 00:00:00 1970 +0000
724 | summary: 2
724 | summary: 2
725 |
725 |
726 | o changeset: 1:925d80f479bb
726 | o changeset: 1:925d80f479bb
727 |/ user: test
727 |/ user: test
728 | date: Thu Jan 01 00:00:00 1970 +0000
728 | date: Thu Jan 01 00:00:00 1970 +0000
729 | summary: 1
729 | summary: 1
730 |
730 |
731 o changeset: 0:f7b1eb17ad24
731 o changeset: 0:f7b1eb17ad24
732 user: test
732 user: test
733 date: Thu Jan 01 00:00:00 1970 +0000
733 date: Thu Jan 01 00:00:00 1970 +0000
734 summary: 0
734 summary: 0
735
735
736
736
737 no-op update doesn't deactivate bookmarks
737 no-op update doesn't deactivate bookmarks
738
738
739 $ hg bookmarks
739 $ hg bookmarks
740 * four 3:9ba5f110a0b3
740 * four 3:9ba5f110a0b3
741 should-end-on-two 2:db815d6d32e6
741 should-end-on-two 2:db815d6d32e6
742 $ hg up four
742 $ hg up four
743 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
743 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
744 $ hg up
744 $ hg up
745 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
745 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
746 $ hg sum
746 $ hg sum
747 parent: 3:9ba5f110a0b3 tip
747 parent: 3:9ba5f110a0b3 tip
748 y
748 y
749 branch: test
749 branch: test
750 bookmarks: *four
750 bookmarks: *four
751 commit: 2 unknown (clean)
751 commit: 2 unknown (clean)
752 update: (current)
752 update: (current)
753 phases: 4 draft
753 phases: 4 draft
754
754
755 test clearing divergent bookmarks of linear ancestors
755 test clearing divergent bookmarks of linear ancestors
756
756
757 $ hg bookmark Z -r 0
757 $ hg bookmark Z -r 0
758 $ hg bookmark Z@1 -r 1
758 $ hg bookmark Z@1 -r 1
759 $ hg bookmark Z@2 -r 2
759 $ hg bookmark Z@2 -r 2
760 $ hg bookmark Z@3 -r 3
760 $ hg bookmark Z@3 -r 3
761 $ hg book
761 $ hg book
762 Z 0:f7b1eb17ad24
762 Z 0:f7b1eb17ad24
763 Z@1 1:925d80f479bb
763 Z@1 1:925d80f479bb
764 Z@2 2:db815d6d32e6
764 Z@2 2:db815d6d32e6
765 Z@3 3:9ba5f110a0b3
765 Z@3 3:9ba5f110a0b3
766 * four 3:9ba5f110a0b3
766 * four 3:9ba5f110a0b3
767 should-end-on-two 2:db815d6d32e6
767 should-end-on-two 2:db815d6d32e6
768 $ hg bookmark Z
768 $ hg bookmark Z
769 moving bookmark 'Z' forward from f7b1eb17ad24
769 moving bookmark 'Z' forward from f7b1eb17ad24
770 $ hg book
770 $ hg book
771 * Z 3:9ba5f110a0b3
771 * Z 3:9ba5f110a0b3
772 Z@1 1:925d80f479bb
772 Z@1 1:925d80f479bb
773 four 3:9ba5f110a0b3
773 four 3:9ba5f110a0b3
774 should-end-on-two 2:db815d6d32e6
774 should-end-on-two 2:db815d6d32e6
775
775
776 test clearing only a single divergent bookmark across branches
776 test clearing only a single divergent bookmark across branches
777
777
778 $ hg book foo -r 1
778 $ hg book foo -r 1
779 $ hg book foo@1 -r 0
779 $ hg book foo@1 -r 0
780 $ hg book foo@2 -r 2
780 $ hg book foo@2 -r 2
781 $ hg book foo@3 -r 3
781 $ hg book foo@3 -r 3
782 $ hg book foo -r foo@3
782 $ hg book foo -r foo@3
783 $ hg book
783 $ hg book
784 * Z 3:9ba5f110a0b3
784 * Z 3:9ba5f110a0b3
785 Z@1 1:925d80f479bb
785 Z@1 1:925d80f479bb
786 foo 3:9ba5f110a0b3
786 foo 3:9ba5f110a0b3
787 foo@1 0:f7b1eb17ad24
787 foo@1 0:f7b1eb17ad24
788 foo@2 2:db815d6d32e6
788 foo@2 2:db815d6d32e6
789 four 3:9ba5f110a0b3
789 four 3:9ba5f110a0b3
790 should-end-on-two 2:db815d6d32e6
790 should-end-on-two 2:db815d6d32e6
791
791
792 pull --update works the same as pull && update (case #2)
792 pull --update works the same as pull && update (case #2)
793
793
794 It is assumed that "hg pull" itself doesn't update current active
794 It is assumed that "hg pull" itself doesn't update current active
795 bookmark ('Y' in tests below).
795 bookmark ('Y' in tests below).
796
796
797 $ hg pull -q ../cloned-bookmarks-update
797 $ hg pull -q ../cloned-bookmarks-update
798 divergent bookmark Z stored as Z@2
798 divergent bookmark Z stored as Z@2
799
799
800 (pulling revision on another named branch with --update updates
800 (pulling revision on another named branch with --update updates
801 neither the working directory nor current active bookmark: "no-op"
801 neither the working directory nor current active bookmark: "no-op"
802 case)
802 case)
803
803
804 $ echo yy >> y
804 $ echo yy >> y
805 $ hg commit -m yy
805 $ hg commit -m yy
806
806
807 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
807 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
808 * Y 3:125c9a1d6df6
808 * Y 3:125c9a1d6df6
809 $ hg -R ../cloned-bookmarks-update pull . --update
809 $ hg -R ../cloned-bookmarks-update pull . --update
810 pulling from .
810 pulling from .
811 searching for changes
811 searching for changes
812 adding changesets
812 adding changesets
813 adding manifests
813 adding manifests
814 adding file changes
814 adding file changes
815 added 1 changesets with 1 changes to 1 files
815 added 1 changesets with 1 changes to 1 files
816 divergent bookmark Z stored as Z@default
816 divergent bookmark Z stored as Z@default
817 adding remote bookmark foo
817 adding remote bookmark foo
818 adding remote bookmark four
818 adding remote bookmark four
819 adding remote bookmark should-end-on-two
819 adding remote bookmark should-end-on-two
820 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
820 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
821 $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n"
821 $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n"
822 3:125c9a1d6df6
822 3:125c9a1d6df6
823 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
823 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
824 * Y 3:125c9a1d6df6
824 * Y 3:125c9a1d6df6
825
825
826 (pulling revision on current named/topological branch with --update
826 (pulling revision on current named/topological branch with --update
827 updates the working directory and current active bookmark)
827 updates the working directory and current active bookmark)
828
828
829 $ hg update -C -q 125c9a1d6df6
829 $ hg update -C -q 125c9a1d6df6
830 $ echo xx >> x
830 $ echo xx >> x
831 $ hg commit -m xx
831 $ hg commit -m xx
832
832
833 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
833 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
834 * Y 3:125c9a1d6df6
834 * Y 3:125c9a1d6df6
835 $ hg -R ../cloned-bookmarks-update pull . --update
835 $ hg -R ../cloned-bookmarks-update pull . --update
836 pulling from .
836 pulling from .
837 searching for changes
837 searching for changes
838 adding changesets
838 adding changesets
839 adding manifests
839 adding manifests
840 adding file changes
840 adding file changes
841 added 1 changesets with 1 changes to 1 files
841 added 1 changesets with 1 changes to 1 files
842 divergent bookmark Z stored as Z@default
842 divergent bookmark Z stored as Z@default
843 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
843 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
844 updating bookmark Y
844 updating bookmark Y
845 $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n"
845 $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n"
846 6:81dcce76aa0b
846 6:81dcce76aa0b
847 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
847 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
848 * Y 6:81dcce76aa0b
848 * Y 6:81dcce76aa0b
849
849
850 $ cd ..
850 $ cd ..
851
851
852 ensure changelog is written before bookmarks
852 ensure changelog is written before bookmarks
853 $ hg init orderrepo
853 $ hg init orderrepo
854 $ cd orderrepo
854 $ cd orderrepo
855 $ touch a
855 $ touch a
856 $ hg commit -Aqm one
856 $ hg commit -Aqm one
857 $ hg book mybook
857 $ hg book mybook
858 $ echo a > a
858 $ echo a > a
859
859
860 $ cat > $TESTTMP/pausefinalize.py <<EOF
860 $ cat > $TESTTMP/pausefinalize.py <<EOF
861 > from mercurial import extensions, localrepo
861 > from mercurial import extensions, localrepo
862 > import os, time
862 > import os, time
863 > def transaction(orig, self, desc, report=None):
863 > def transaction(orig, self, desc, report=None):
864 > tr = orig(self, desc, report)
864 > tr = orig(self, desc, report)
865 > def sleep(*args, **kwargs):
865 > def sleep(*args, **kwargs):
866 > retry = 20
866 > retry = 20
867 > while retry > 0 and not os.path.exists("$TESTTMP/unpause"):
867 > while retry > 0 and not os.path.exists("$TESTTMP/unpause"):
868 > retry -= 1
868 > retry -= 1
869 > time.sleep(0.5)
869 > time.sleep(0.5)
870 > if os.path.exists("$TESTTMP/unpause"):
870 > if os.path.exists("$TESTTMP/unpause"):
871 > os.remove("$TESTTMP/unpause")
871 > os.remove("$TESTTMP/unpause")
872 > # It is important that this finalizer start with 'a', so it runs before
872 > # It is important that this finalizer start with 'a', so it runs before
873 > # the changelog finalizer appends to the changelog.
873 > # the changelog finalizer appends to the changelog.
874 > tr.addfinalize('a-sleep', sleep)
874 > tr.addfinalize('a-sleep', sleep)
875 > return tr
875 > return tr
876 >
876 >
877 > def extsetup(ui):
877 > def extsetup(ui):
878 > # This extension inserts an artifical pause during the transaction
878 > # This extension inserts an artifical pause during the transaction
879 > # finalizer, so we can run commands mid-transaction-close.
879 > # finalizer, so we can run commands mid-transaction-close.
880 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
880 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
881 > transaction)
881 > transaction)
882 > EOF
882 > EOF
883 $ hg commit -qm two --config extensions.pausefinalize=$TESTTMP/pausefinalize.py &
883 $ hg commit -qm two --config extensions.pausefinalize=$TESTTMP/pausefinalize.py &
884 $ sleep 2
884 $ sleep 2
885 $ hg log -r .
885 $ hg log -r .
886 changeset: 0:867bc5792c8c
886 changeset: 0:867bc5792c8c
887 bookmark: mybook
887 bookmark: mybook
888 tag: tip
888 tag: tip
889 user: test
889 user: test
890 date: Thu Jan 01 00:00:00 1970 +0000
890 date: Thu Jan 01 00:00:00 1970 +0000
891 summary: one
891 summary: one
892
892
893 $ hg bookmarks
893 $ hg bookmarks
894 * mybook 0:867bc5792c8c
894 * mybook 0:867bc5792c8c
895 $ touch $TESTTMP/unpause
895 $ touch $TESTTMP/unpause
896
896
897 $ cd ..
897 $ cd ..
@@ -1,505 +1,505 b''
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 Enable obsolete
3 Enable obsolete
4
4
5 $ cat >> $HGRCPATH << EOF
5 $ cat >> $HGRCPATH << EOF
6 > [ui]
6 > [ui]
7 > logtemplate= {rev}:{node|short} {desc|firstline}
7 > logtemplate= {rev}:{node|short} {desc|firstline}
8 > [phases]
8 > [phases]
9 > publish=False
9 > publish=False
10 > [experimental]
10 > [experimental]
11 > evolution=createmarkers,allowunstable
11 > evolution=createmarkers,allowunstable
12 > [extensions]
12 > [extensions]
13 > histedit=
13 > histedit=
14 > rebase=
14 > rebase=
15 > EOF
15 > EOF
16
16
17 Test that histedit learns about obsolescence not stored in histedit state
17 Test that histedit learns about obsolescence not stored in histedit state
18 $ hg init boo
18 $ hg init boo
19 $ cd boo
19 $ cd boo
20 $ echo a > a
20 $ echo a > a
21 $ hg ci -Am a
21 $ hg ci -Am a
22 adding a
22 adding a
23 $ echo a > b
23 $ echo a > b
24 $ echo a > c
24 $ echo a > c
25 $ echo a > c
25 $ echo a > c
26 $ hg ci -Am b
26 $ hg ci -Am b
27 adding b
27 adding b
28 adding c
28 adding c
29 $ echo a > d
29 $ echo a > d
30 $ hg ci -Am c
30 $ hg ci -Am c
31 adding d
31 adding d
32 $ echo "pick `hg log -r 0 -T '{node|short}'`" > plan
32 $ echo "pick `hg log -r 0 -T '{node|short}'`" > plan
33 $ echo "pick `hg log -r 2 -T '{node|short}'`" >> plan
33 $ echo "pick `hg log -r 2 -T '{node|short}'`" >> plan
34 $ echo "edit `hg log -r 1 -T '{node|short}'`" >> plan
34 $ echo "edit `hg log -r 1 -T '{node|short}'`" >> plan
35 $ hg histedit -r 'all()' --commands plan
35 $ hg histedit -r 'all()' --commands plan
36 Editing (1b2d564fad96), you may commit or record as needed now.
36 Editing (1b2d564fad96), you may commit or record as needed now.
37 (hg histedit --continue to resume)
37 (hg histedit --continue to resume)
38 [1]
38 [1]
39 $ hg st
39 $ hg st
40 A b
40 A b
41 A c
41 A c
42 ? plan
42 ? plan
43 $ hg commit --amend b
43 $ hg commit --amend b
44 $ hg histedit --continue
44 $ hg histedit --continue
45 $ hg log -G
45 $ hg log -G
46 @ 6:46abc7c4d873 b
46 @ 6:46abc7c4d873 b
47 |
47 |
48 o 5:49d44ab2be1b c
48 o 5:49d44ab2be1b c
49 |
49 |
50 o 0:cb9a9f314b8b a
50 o 0:cb9a9f314b8b a
51
51
52 $ hg debugobsolete
52 $ hg debugobsolete
53 e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf 49d44ab2be1b67a79127568a67c9c99430633b48 0 (*) {'user': 'test'} (glob)
53 e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf 49d44ab2be1b67a79127568a67c9c99430633b48 0 (*) {'user': 'test'} (glob)
54 3e30a45cf2f719e96ab3922dfe039cfd047956ce 0 {e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf} (*) {'user': 'test'} (glob)
54 3e30a45cf2f719e96ab3922dfe039cfd047956ce 0 {e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf} (*) {'user': 'test'} (glob)
55 1b2d564fad96311b45362f17c2aa855150efb35f 46abc7c4d8738e8563e577f7889e1b6db3da4199 0 (*) {'user': 'test'} (glob)
55 1b2d564fad96311b45362f17c2aa855150efb35f 46abc7c4d8738e8563e577f7889e1b6db3da4199 0 (*) {'user': 'test'} (glob)
56 114f4176969ef342759a8a57e6bccefc4234829b 49d44ab2be1b67a79127568a67c9c99430633b48 0 (*) {'user': 'test'} (glob)
56 114f4176969ef342759a8a57e6bccefc4234829b 49d44ab2be1b67a79127568a67c9c99430633b48 0 (*) {'user': 'test'} (glob)
57
57
58 With some node gone missing during the edit.
58 With some node gone missing during the edit.
59
59
60 $ echo "pick `hg log -r 0 -T '{node|short}'`" > plan
60 $ echo "pick `hg log -r 0 -T '{node|short}'`" > plan
61 $ echo "pick `hg log -r 6 -T '{node|short}'`" >> plan
61 $ echo "pick `hg log -r 6 -T '{node|short}'`" >> plan
62 $ echo "edit `hg log -r 5 -T '{node|short}'`" >> plan
62 $ echo "edit `hg log -r 5 -T '{node|short}'`" >> plan
63 $ hg histedit -r 'all()' --commands plan
63 $ hg histedit -r 'all()' --commands plan
64 Editing (49d44ab2be1b), you may commit or record as needed now.
64 Editing (49d44ab2be1b), you may commit or record as needed now.
65 (hg histedit --continue to resume)
65 (hg histedit --continue to resume)
66 [1]
66 [1]
67 $ hg st
67 $ hg st
68 A b
68 A b
69 A d
69 A d
70 ? plan
70 ? plan
71 $ hg commit --amend -X . -m XXXXXX
71 $ hg commit --amend -X . -m XXXXXX
72 $ hg commit --amend -X . -m b2
72 $ hg commit --amend -X . -m b2
73 $ hg --hidden --config extensions.strip= strip 'desc(XXXXXX)' --no-backup
73 $ hg --hidden --config extensions.strip= strip 'desc(XXXXXX)' --no-backup
74 $ hg histedit --continue
74 $ hg histedit --continue
75 $ hg log -G
75 $ hg log -G
76 @ 9:273c1f3b8626 c
76 @ 9:273c1f3b8626 c
77 |
77 |
78 o 8:aba7da937030 b2
78 o 8:aba7da937030 b2
79 |
79 |
80 o 0:cb9a9f314b8b a
80 o 0:cb9a9f314b8b a
81
81
82 $ hg debugobsolete
82 $ hg debugobsolete
83 e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf 49d44ab2be1b67a79127568a67c9c99430633b48 0 (*) {'user': 'test'} (glob)
83 e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf 49d44ab2be1b67a79127568a67c9c99430633b48 0 (*) {'user': 'test'} (glob)
84 3e30a45cf2f719e96ab3922dfe039cfd047956ce 0 {e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf} (*) {'user': 'test'} (glob)
84 3e30a45cf2f719e96ab3922dfe039cfd047956ce 0 {e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf} (*) {'user': 'test'} (glob)
85 1b2d564fad96311b45362f17c2aa855150efb35f 46abc7c4d8738e8563e577f7889e1b6db3da4199 0 (*) {'user': 'test'} (glob)
85 1b2d564fad96311b45362f17c2aa855150efb35f 46abc7c4d8738e8563e577f7889e1b6db3da4199 0 (*) {'user': 'test'} (glob)
86 114f4176969ef342759a8a57e6bccefc4234829b 49d44ab2be1b67a79127568a67c9c99430633b48 0 (*) {'user': 'test'} (glob)
86 114f4176969ef342759a8a57e6bccefc4234829b 49d44ab2be1b67a79127568a67c9c99430633b48 0 (*) {'user': 'test'} (glob)
87 76f72745eac0643d16530e56e2f86e36e40631f1 2ca853e48edbd6453a0674dc0fe28a0974c51b9c 0 (*) {'user': 'test'} (glob)
87 76f72745eac0643d16530e56e2f86e36e40631f1 2ca853e48edbd6453a0674dc0fe28a0974c51b9c 0 (*) {'user': 'test'} (glob)
88 2ca853e48edbd6453a0674dc0fe28a0974c51b9c aba7da93703075eec9fb1dbaf143ff2bc1c49d46 0 (*) {'user': 'test'} (glob)
88 2ca853e48edbd6453a0674dc0fe28a0974c51b9c aba7da93703075eec9fb1dbaf143ff2bc1c49d46 0 (*) {'user': 'test'} (glob)
89 49d44ab2be1b67a79127568a67c9c99430633b48 273c1f3b86267ed3ec684bb13af1fa4d6ba56e02 0 (*) {'user': 'test'} (glob)
89 49d44ab2be1b67a79127568a67c9c99430633b48 273c1f3b86267ed3ec684bb13af1fa4d6ba56e02 0 (*) {'user': 'test'} (glob)
90 46abc7c4d8738e8563e577f7889e1b6db3da4199 aba7da93703075eec9fb1dbaf143ff2bc1c49d46 0 (*) {'user': 'test'} (glob)
90 46abc7c4d8738e8563e577f7889e1b6db3da4199 aba7da93703075eec9fb1dbaf143ff2bc1c49d46 0 (*) {'user': 'test'} (glob)
91 $ cd ..
91 $ cd ..
92
92
93 Base setup for the rest of the testing
93 Base setup for the rest of the testing
94 ======================================
94 ======================================
95
95
96 $ hg init base
96 $ hg init base
97 $ cd base
97 $ cd base
98
98
99 $ for x in a b c d e f ; do
99 $ for x in a b c d e f ; do
100 > echo $x > $x
100 > echo $x > $x
101 > hg add $x
101 > hg add $x
102 > hg ci -m $x
102 > hg ci -m $x
103 > done
103 > done
104
104
105 $ hg log --graph
105 $ hg log --graph
106 @ 5:652413bf663e f
106 @ 5:652413bf663e f
107 |
107 |
108 o 4:e860deea161a e
108 o 4:e860deea161a e
109 |
109 |
110 o 3:055a42cdd887 d
110 o 3:055a42cdd887 d
111 |
111 |
112 o 2:177f92b77385 c
112 o 2:177f92b77385 c
113 |
113 |
114 o 1:d2ae7f538514 b
114 o 1:d2ae7f538514 b
115 |
115 |
116 o 0:cb9a9f314b8b a
116 o 0:cb9a9f314b8b a
117
117
118
118
119 $ HGEDITOR=cat hg histedit 1
119 $ HGEDITOR=cat hg histedit 1
120 pick d2ae7f538514 1 b
120 pick d2ae7f538514 1 b
121 pick 177f92b77385 2 c
121 pick 177f92b77385 2 c
122 pick 055a42cdd887 3 d
122 pick 055a42cdd887 3 d
123 pick e860deea161a 4 e
123 pick e860deea161a 4 e
124 pick 652413bf663e 5 f
124 pick 652413bf663e 5 f
125
125
126 # Edit history between d2ae7f538514 and 652413bf663e
126 # Edit history between d2ae7f538514 and 652413bf663e
127 #
127 #
128 # Commits are listed from least to most recent
128 # Commits are listed from least to most recent
129 #
129 #
130 # You can reorder changesets by reordering the lines
130 # You can reorder changesets by reordering the lines
131 #
131 #
132 # Commands:
132 # Commands:
133 #
133 #
134 # e, edit = use commit, but stop for amending
134 # e, edit = use commit, but stop for amending
135 # m, mess = edit commit message without changing commit content
135 # m, mess = edit commit message without changing commit content
136 # p, pick = use commit
136 # p, pick = use commit
137 # d, drop = remove commit from history
137 # d, drop = remove commit from history
138 # f, fold = use commit, but combine it with the one above
138 # f, fold = use commit, but combine it with the one above
139 # r, roll = like fold, but discard this commit's description
139 # r, roll = like fold, but discard this commit's description
140 #
140 #
141 $ hg histedit 1 --commands - --verbose <<EOF | grep histedit
141 $ hg histedit 1 --commands - --verbose <<EOF | grep histedit
142 > pick 177f92b77385 2 c
142 > pick 177f92b77385 2 c
143 > drop d2ae7f538514 1 b
143 > drop d2ae7f538514 1 b
144 > pick 055a42cdd887 3 d
144 > pick 055a42cdd887 3 d
145 > fold e860deea161a 4 e
145 > fold e860deea161a 4 e
146 > pick 652413bf663e 5 f
146 > pick 652413bf663e 5 f
147 > EOF
147 > EOF
148 [1]
148 [1]
149 $ hg log --graph --hidden
149 $ hg log --graph --hidden
150 @ 10:cacdfd884a93 f
150 @ 10:cacdfd884a93 f
151 |
151 |
152 o 9:59d9f330561f d
152 o 9:59d9f330561f d
153 |
153 |
154 | x 8:b558abc46d09 fold-temp-revision e860deea161a
154 | x 8:b558abc46d09 fold-temp-revision e860deea161a
155 | |
155 | |
156 | x 7:96e494a2d553 d
156 | x 7:96e494a2d553 d
157 |/
157 |/
158 o 6:b346ab9a313d c
158 o 6:b346ab9a313d c
159 |
159 |
160 | x 5:652413bf663e f
160 | x 5:652413bf663e f
161 | |
161 | |
162 | x 4:e860deea161a e
162 | x 4:e860deea161a e
163 | |
163 | |
164 | x 3:055a42cdd887 d
164 | x 3:055a42cdd887 d
165 | |
165 | |
166 | x 2:177f92b77385 c
166 | x 2:177f92b77385 c
167 | |
167 | |
168 | x 1:d2ae7f538514 b
168 | x 1:d2ae7f538514 b
169 |/
169 |/
170 o 0:cb9a9f314b8b a
170 o 0:cb9a9f314b8b a
171
171
172 $ hg debugobsolete
172 $ hg debugobsolete
173 96e494a2d553dd05902ba1cee1d94d4cb7b8faed 0 {b346ab9a313db8537ecf96fca3ca3ca984ef3bd7} (*) {'user': 'test'} (glob)
173 96e494a2d553dd05902ba1cee1d94d4cb7b8faed 0 {b346ab9a313db8537ecf96fca3ca3ca984ef3bd7} (*) {'user': 'test'} (glob)
174 b558abc46d09c30f57ac31e85a8a3d64d2e906e4 0 {96e494a2d553dd05902ba1cee1d94d4cb7b8faed} (*) {'user': 'test'} (glob)
174 b558abc46d09c30f57ac31e85a8a3d64d2e906e4 0 {96e494a2d553dd05902ba1cee1d94d4cb7b8faed} (*) {'user': 'test'} (glob)
175 d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b} (*) {'user': 'test'} (glob)
175 d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b} (*) {'user': 'test'} (glob)
176 177f92b773850b59254aa5e923436f921b55483b b346ab9a313db8537ecf96fca3ca3ca984ef3bd7 0 (*) {'user': 'test'} (glob)
176 177f92b773850b59254aa5e923436f921b55483b b346ab9a313db8537ecf96fca3ca3ca984ef3bd7 0 (*) {'user': 'test'} (glob)
177 055a42cdd88768532f9cf79daa407fc8d138de9b 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (*) {'user': 'test'} (glob)
177 055a42cdd88768532f9cf79daa407fc8d138de9b 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (*) {'user': 'test'} (glob)
178 e860deea161a2f77de56603b340ebbb4536308ae 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (*) {'user': 'test'} (glob)
178 e860deea161a2f77de56603b340ebbb4536308ae 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (*) {'user': 'test'} (glob)
179 652413bf663ef2a641cab26574e46d5f5a64a55a cacdfd884a9321ec4e1de275ef3949fa953a1f83 0 (*) {'user': 'test'} (glob)
179 652413bf663ef2a641cab26574e46d5f5a64a55a cacdfd884a9321ec4e1de275ef3949fa953a1f83 0 (*) {'user': 'test'} (glob)
180
180
181
181
182 Ensure hidden revision does not prevent histedit
182 Ensure hidden revision does not prevent histedit
183 -------------------------------------------------
183 -------------------------------------------------
184
184
185 create an hidden revision
185 create an hidden revision
186
186
187 $ hg histedit 6 --commands - << EOF
187 $ hg histedit 6 --commands - << EOF
188 > pick b346ab9a313d 6 c
188 > pick b346ab9a313d 6 c
189 > drop 59d9f330561f 7 d
189 > drop 59d9f330561f 7 d
190 > pick cacdfd884a93 8 f
190 > pick cacdfd884a93 8 f
191 > EOF
191 > EOF
192 $ hg log --graph
192 $ hg log --graph
193 @ 11:c13eb81022ca f
193 @ 11:c13eb81022ca f
194 |
194 |
195 o 6:b346ab9a313d c
195 o 6:b346ab9a313d c
196 |
196 |
197 o 0:cb9a9f314b8b a
197 o 0:cb9a9f314b8b a
198
198
199 check hidden revision are ignored (6 have hidden children 7 and 8)
199 check hidden revision are ignored (6 have hidden children 7 and 8)
200
200
201 $ hg histedit 6 --commands - << EOF
201 $ hg histedit 6 --commands - << EOF
202 > pick b346ab9a313d 6 c
202 > pick b346ab9a313d 6 c
203 > pick c13eb81022ca 8 f
203 > pick c13eb81022ca 8 f
204 > EOF
204 > EOF
205
205
206
206
207
207
208 Test that rewriting leaving instability behind is allowed
208 Test that rewriting leaving instability behind is allowed
209 ---------------------------------------------------------------------
209 ---------------------------------------------------------------------
210
210
211 $ hg up '.^'
211 $ hg up '.^'
212 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
212 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
213 $ hg log -r 'children(.)'
213 $ hg log -r 'children(.)'
214 11:c13eb81022ca f (no-eol)
214 11:c13eb81022ca f (no-eol)
215 $ hg histedit -r '.' --commands - <<EOF
215 $ hg histedit -r '.' --commands - <<EOF
216 > edit b346ab9a313d 6 c
216 > edit b346ab9a313d 6 c
217 > EOF
217 > EOF
218 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
218 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
219 adding c
219 adding c
220 Editing (b346ab9a313d), you may commit or record as needed now.
220 Editing (b346ab9a313d), you may commit or record as needed now.
221 (hg histedit --continue to resume)
221 (hg histedit --continue to resume)
222 [1]
222 [1]
223 $ echo c >> c
223 $ echo c >> c
224 $ hg histedit --continue
224 $ hg histedit --continue
225
225
226 $ hg log -r 'unstable()'
226 $ hg log -r 'unstable()'
227 11:c13eb81022ca f (no-eol)
227 11:c13eb81022ca f (no-eol)
228
228
229 stabilise
229 stabilise
230
230
231 $ hg rebase -r 'unstable()' -d .
231 $ hg rebase -r 'unstable()' -d .
232 rebasing 11:c13eb81022ca "f"
232 rebasing 11:c13eb81022ca "f"
233 $ hg up tip -q
233 $ hg up tip -q
234
234
235 Test dropping of changeset on the top of the stack
235 Test dropping of changeset on the top of the stack
236 -------------------------------------------------------
236 -------------------------------------------------------
237
237
238 Nothing is rewritten below, the working directory parent must be change for the
238 Nothing is rewritten below, the working directory parent must be change for the
239 dropped changeset to be hidden.
239 dropped changeset to be hidden.
240
240
241 $ cd ..
241 $ cd ..
242 $ hg clone base droplast
242 $ hg clone base droplast
243 updating to branch default
243 updating to branch default
244 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
245 $ cd droplast
245 $ cd droplast
246 $ hg histedit -r '40db8afa467b' --commands - << EOF
246 $ hg histedit -r '40db8afa467b' --commands - << EOF
247 > pick 40db8afa467b 10 c
247 > pick 40db8afa467b 10 c
248 > drop b449568bf7fc 11 f
248 > drop b449568bf7fc 11 f
249 > EOF
249 > EOF
250 $ hg log -G
250 $ hg log -G
251 @ 12:40db8afa467b c
251 @ 12:40db8afa467b c
252 |
252 |
253 o 0:cb9a9f314b8b a
253 o 0:cb9a9f314b8b a
254
254
255
255
256 With rewritten ancestors
256 With rewritten ancestors
257
257
258 $ echo e > e
258 $ echo e > e
259 $ hg add e
259 $ hg add e
260 $ hg commit -m g
260 $ hg commit -m g
261 $ echo f > f
261 $ echo f > f
262 $ hg add f
262 $ hg add f
263 $ hg commit -m h
263 $ hg commit -m h
264 $ hg histedit -r '40db8afa467b' --commands - << EOF
264 $ hg histedit -r '40db8afa467b' --commands - << EOF
265 > pick 47a8561c0449 12 g
265 > pick 47a8561c0449 12 g
266 > pick 40db8afa467b 10 c
266 > pick 40db8afa467b 10 c
267 > drop 1b3b05f35ff0 13 h
267 > drop 1b3b05f35ff0 13 h
268 > EOF
268 > EOF
269 $ hg log -G
269 $ hg log -G
270 @ 17:ee6544123ab8 c
270 @ 17:ee6544123ab8 c
271 |
271 |
272 o 16:269e713e9eae g
272 o 16:269e713e9eae g
273 |
273 |
274 o 0:cb9a9f314b8b a
274 o 0:cb9a9f314b8b a
275
275
276 $ cd ../base
276 $ cd ../base
277
277
278
278
279
279
280 Test phases support
280 Test phases support
281 ===========================================
281 ===========================================
282
282
283 Check that histedit respect immutability
283 Check that histedit respect immutability
284 -------------------------------------------
284 -------------------------------------------
285
285
286 $ cat >> $HGRCPATH << EOF
286 $ cat >> $HGRCPATH << EOF
287 > [ui]
287 > [ui]
288 > logtemplate= {rev}:{node|short} ({phase}) {desc|firstline}\n
288 > logtemplate= {rev}:{node|short} ({phase}) {desc|firstline}\n
289 > EOF
289 > EOF
290
290
291 $ hg ph -pv '.^'
291 $ hg ph -pv '.^'
292 phase changed for 2 changesets
292 phase changed for 2 changesets
293 $ hg log -G
293 $ hg log -G
294 @ 13:b449568bf7fc (draft) f
294 @ 13:b449568bf7fc (draft) f
295 |
295 |
296 o 12:40db8afa467b (public) c
296 o 12:40db8afa467b (public) c
297 |
297 |
298 o 0:cb9a9f314b8b (public) a
298 o 0:cb9a9f314b8b (public) a
299
299
300 $ hg histedit -r '.~2'
300 $ hg histedit -r '.~2'
301 abort: cannot edit public changeset: cb9a9f314b8b
301 abort: cannot edit public changeset: cb9a9f314b8b
302 (see 'hg help phases' for details)
302 (see 'hg help phases' for details)
303 [255]
303 [255]
304
304
305
305
306 Prepare further testing
306 Prepare further testing
307 -------------------------------------------
307 -------------------------------------------
308
308
309 $ for x in g h i j k ; do
309 $ for x in g h i j k ; do
310 > echo $x > $x
310 > echo $x > $x
311 > hg add $x
311 > hg add $x
312 > hg ci -m $x
312 > hg ci -m $x
313 > done
313 > done
314 $ hg phase --force --secret .~2
314 $ hg phase --force --secret .~2
315 $ hg log -G
315 $ hg log -G
316 @ 18:ee118ab9fa44 (secret) k
316 @ 18:ee118ab9fa44 (secret) k
317 |
317 |
318 o 17:3a6c53ee7f3d (secret) j
318 o 17:3a6c53ee7f3d (secret) j
319 |
319 |
320 o 16:b605fb7503f2 (secret) i
320 o 16:b605fb7503f2 (secret) i
321 |
321 |
322 o 15:7395e1ff83bd (draft) h
322 o 15:7395e1ff83bd (draft) h
323 |
323 |
324 o 14:6b70183d2492 (draft) g
324 o 14:6b70183d2492 (draft) g
325 |
325 |
326 o 13:b449568bf7fc (draft) f
326 o 13:b449568bf7fc (draft) f
327 |
327 |
328 o 12:40db8afa467b (public) c
328 o 12:40db8afa467b (public) c
329 |
329 |
330 o 0:cb9a9f314b8b (public) a
330 o 0:cb9a9f314b8b (public) a
331
331
332 $ cd ..
332 $ cd ..
333
333
334 simple phase conservation
334 simple phase conservation
335 -------------------------------------------
335 -------------------------------------------
336
336
337 Resulting changeset should conserve the phase of the original one whatever the
337 Resulting changeset should conserve the phase of the original one whatever the
338 phases.new-commit option is.
338 phases.new-commit option is.
339
339
340 New-commit as draft (default)
340 New-commit as draft (default)
341
341
342 $ cp -r base simple-draft
342 $ cp -R base simple-draft
343 $ cd simple-draft
343 $ cd simple-draft
344 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
344 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
345 > edit b449568bf7fc 11 f
345 > edit b449568bf7fc 11 f
346 > pick 6b70183d2492 12 g
346 > pick 6b70183d2492 12 g
347 > pick 7395e1ff83bd 13 h
347 > pick 7395e1ff83bd 13 h
348 > pick b605fb7503f2 14 i
348 > pick b605fb7503f2 14 i
349 > pick 3a6c53ee7f3d 15 j
349 > pick 3a6c53ee7f3d 15 j
350 > pick ee118ab9fa44 16 k
350 > pick ee118ab9fa44 16 k
351 > EOF
351 > EOF
352 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
352 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
353 adding f
353 adding f
354 Editing (b449568bf7fc), you may commit or record as needed now.
354 Editing (b449568bf7fc), you may commit or record as needed now.
355 (hg histedit --continue to resume)
355 (hg histedit --continue to resume)
356 [1]
356 [1]
357 $ echo f >> f
357 $ echo f >> f
358 $ hg histedit --continue
358 $ hg histedit --continue
359 $ hg log -G
359 $ hg log -G
360 @ 24:12e89af74238 (secret) k
360 @ 24:12e89af74238 (secret) k
361 |
361 |
362 o 23:636a8687b22e (secret) j
362 o 23:636a8687b22e (secret) j
363 |
363 |
364 o 22:ccaf0a38653f (secret) i
364 o 22:ccaf0a38653f (secret) i
365 |
365 |
366 o 21:11a89d1c2613 (draft) h
366 o 21:11a89d1c2613 (draft) h
367 |
367 |
368 o 20:c1dec7ca82ea (draft) g
368 o 20:c1dec7ca82ea (draft) g
369 |
369 |
370 o 19:087281e68428 (draft) f
370 o 19:087281e68428 (draft) f
371 |
371 |
372 o 12:40db8afa467b (public) c
372 o 12:40db8afa467b (public) c
373 |
373 |
374 o 0:cb9a9f314b8b (public) a
374 o 0:cb9a9f314b8b (public) a
375
375
376 $ cd ..
376 $ cd ..
377
377
378
378
379 New-commit as secret (config)
379 New-commit as secret (config)
380
380
381 $ cp -r base simple-secret
381 $ cp -R base simple-secret
382 $ cd simple-secret
382 $ cd simple-secret
383 $ cat >> .hg/hgrc << EOF
383 $ cat >> .hg/hgrc << EOF
384 > [phases]
384 > [phases]
385 > new-commit=secret
385 > new-commit=secret
386 > EOF
386 > EOF
387 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
387 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
388 > edit b449568bf7fc 11 f
388 > edit b449568bf7fc 11 f
389 > pick 6b70183d2492 12 g
389 > pick 6b70183d2492 12 g
390 > pick 7395e1ff83bd 13 h
390 > pick 7395e1ff83bd 13 h
391 > pick b605fb7503f2 14 i
391 > pick b605fb7503f2 14 i
392 > pick 3a6c53ee7f3d 15 j
392 > pick 3a6c53ee7f3d 15 j
393 > pick ee118ab9fa44 16 k
393 > pick ee118ab9fa44 16 k
394 > EOF
394 > EOF
395 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
395 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
396 adding f
396 adding f
397 Editing (b449568bf7fc), you may commit or record as needed now.
397 Editing (b449568bf7fc), you may commit or record as needed now.
398 (hg histedit --continue to resume)
398 (hg histedit --continue to resume)
399 [1]
399 [1]
400 $ echo f >> f
400 $ echo f >> f
401 $ hg histedit --continue
401 $ hg histedit --continue
402 $ hg log -G
402 $ hg log -G
403 @ 24:12e89af74238 (secret) k
403 @ 24:12e89af74238 (secret) k
404 |
404 |
405 o 23:636a8687b22e (secret) j
405 o 23:636a8687b22e (secret) j
406 |
406 |
407 o 22:ccaf0a38653f (secret) i
407 o 22:ccaf0a38653f (secret) i
408 |
408 |
409 o 21:11a89d1c2613 (draft) h
409 o 21:11a89d1c2613 (draft) h
410 |
410 |
411 o 20:c1dec7ca82ea (draft) g
411 o 20:c1dec7ca82ea (draft) g
412 |
412 |
413 o 19:087281e68428 (draft) f
413 o 19:087281e68428 (draft) f
414 |
414 |
415 o 12:40db8afa467b (public) c
415 o 12:40db8afa467b (public) c
416 |
416 |
417 o 0:cb9a9f314b8b (public) a
417 o 0:cb9a9f314b8b (public) a
418
418
419 $ cd ..
419 $ cd ..
420
420
421
421
422 Changeset reordering
422 Changeset reordering
423 -------------------------------------------
423 -------------------------------------------
424
424
425 If a secret changeset is put before a draft one, all descendant should be secret.
425 If a secret changeset is put before a draft one, all descendant should be secret.
426 It seems more important to present the secret phase.
426 It seems more important to present the secret phase.
427
427
428 $ cp -r base reorder
428 $ cp -R base reorder
429 $ cd reorder
429 $ cd reorder
430 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
430 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
431 > pick b449568bf7fc 11 f
431 > pick b449568bf7fc 11 f
432 > pick 3a6c53ee7f3d 15 j
432 > pick 3a6c53ee7f3d 15 j
433 > pick 6b70183d2492 12 g
433 > pick 6b70183d2492 12 g
434 > pick b605fb7503f2 14 i
434 > pick b605fb7503f2 14 i
435 > pick 7395e1ff83bd 13 h
435 > pick 7395e1ff83bd 13 h
436 > pick ee118ab9fa44 16 k
436 > pick ee118ab9fa44 16 k
437 > EOF
437 > EOF
438 $ hg log -G
438 $ hg log -G
439 @ 23:558246857888 (secret) k
439 @ 23:558246857888 (secret) k
440 |
440 |
441 o 22:28bd44768535 (secret) h
441 o 22:28bd44768535 (secret) h
442 |
442 |
443 o 21:d5395202aeb9 (secret) i
443 o 21:d5395202aeb9 (secret) i
444 |
444 |
445 o 20:21edda8e341b (secret) g
445 o 20:21edda8e341b (secret) g
446 |
446 |
447 o 19:5ab64f3a4832 (secret) j
447 o 19:5ab64f3a4832 (secret) j
448 |
448 |
449 o 13:b449568bf7fc (draft) f
449 o 13:b449568bf7fc (draft) f
450 |
450 |
451 o 12:40db8afa467b (public) c
451 o 12:40db8afa467b (public) c
452 |
452 |
453 o 0:cb9a9f314b8b (public) a
453 o 0:cb9a9f314b8b (public) a
454
454
455 $ cd ..
455 $ cd ..
456
456
457 Changeset folding
457 Changeset folding
458 -------------------------------------------
458 -------------------------------------------
459
459
460 Folding a secret changeset with a draft one turn the result secret (again,
460 Folding a secret changeset with a draft one turn the result secret (again,
461 better safe than sorry). Folding between same phase changeset still works
461 better safe than sorry). Folding between same phase changeset still works
462
462
463 Note that there is a few reordering in this series for more extensive test
463 Note that there is a few reordering in this series for more extensive test
464
464
465 $ cp -r base folding
465 $ cp -R base folding
466 $ cd folding
466 $ cd folding
467 $ cat >> .hg/hgrc << EOF
467 $ cat >> .hg/hgrc << EOF
468 > [phases]
468 > [phases]
469 > new-commit=secret
469 > new-commit=secret
470 > EOF
470 > EOF
471 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
471 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
472 > pick 7395e1ff83bd 13 h
472 > pick 7395e1ff83bd 13 h
473 > fold b449568bf7fc 11 f
473 > fold b449568bf7fc 11 f
474 > pick 6b70183d2492 12 g
474 > pick 6b70183d2492 12 g
475 > fold 3a6c53ee7f3d 15 j
475 > fold 3a6c53ee7f3d 15 j
476 > pick b605fb7503f2 14 i
476 > pick b605fb7503f2 14 i
477 > fold ee118ab9fa44 16 k
477 > fold ee118ab9fa44 16 k
478 > EOF
478 > EOF
479 $ hg log -G
479 $ hg log -G
480 @ 27:f9daec13fb98 (secret) i
480 @ 27:f9daec13fb98 (secret) i
481 |
481 |
482 o 24:49807617f46a (secret) g
482 o 24:49807617f46a (secret) g
483 |
483 |
484 o 21:050280826e04 (draft) h
484 o 21:050280826e04 (draft) h
485 |
485 |
486 o 12:40db8afa467b (public) c
486 o 12:40db8afa467b (public) c
487 |
487 |
488 o 0:cb9a9f314b8b (public) a
488 o 0:cb9a9f314b8b (public) a
489
489
490 $ hg co 49807617f46a
490 $ hg co 49807617f46a
491 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
491 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
492 $ echo wat >> wat
492 $ echo wat >> wat
493 $ hg add wat
493 $ hg add wat
494 $ hg ci -m 'add wat'
494 $ hg ci -m 'add wat'
495 created new head
495 created new head
496 $ hg merge f9daec13fb98
496 $ hg merge f9daec13fb98
497 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
497 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
498 (branch merge, don't forget to commit)
498 (branch merge, don't forget to commit)
499 $ hg ci -m 'merge'
499 $ hg ci -m 'merge'
500 $ echo not wat > wat
500 $ echo not wat > wat
501 $ hg ci -m 'modify wat'
501 $ hg ci -m 'modify wat'
502 $ hg histedit 050280826e04
502 $ hg histedit 050280826e04
503 abort: cannot edit history that contains merges
503 abort: cannot edit history that contains merges
504 [255]
504 [255]
505 $ cd ..
505 $ cd ..
@@ -1,265 +1,265 b''
1 Check that obsolete properly strip heads
1 Check that obsolete properly strip heads
2 $ cat >> $HGRCPATH << EOF
2 $ cat >> $HGRCPATH << EOF
3 > [phases]
3 > [phases]
4 > # public changeset are not obsolete
4 > # public changeset are not obsolete
5 > publish=false
5 > publish=false
6 > [ui]
6 > [ui]
7 > logtemplate='{node|short} ({phase}) {desc|firstline}\n'
7 > logtemplate='{node|short} ({phase}) {desc|firstline}\n'
8 > [experimental]
8 > [experimental]
9 > evolution=createmarkers
9 > evolution=createmarkers
10 > EOF
10 > EOF
11 $ mkcommit() {
11 $ mkcommit() {
12 > echo "$1" > "$1"
12 > echo "$1" > "$1"
13 > hg add "$1"
13 > hg add "$1"
14 > hg ci -m "add $1"
14 > hg ci -m "add $1"
15 > }
15 > }
16 $ getid() {
16 $ getid() {
17 > hg id --debug -ir "desc('$1')"
17 > hg id --debug -ir "desc('$1')"
18 > }
18 > }
19
19
20
20
21 $ hg init remote
21 $ hg init remote
22 $ cd remote
22 $ cd remote
23 $ mkcommit base
23 $ mkcommit base
24 $ hg phase --public .
24 $ hg phase --public .
25 $ cd ..
25 $ cd ..
26 $ cp -r remote base
26 $ cp -R remote base
27 $ hg clone remote local
27 $ hg clone remote local
28 updating to branch default
28 updating to branch default
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 $ cd local
30 $ cd local
31
31
32 New head replaces old head
32 New head replaces old head
33 ==========================
33 ==========================
34
34
35 setup
35 setup
36 (we add the 1 flags to prevent bumped error during the test)
36 (we add the 1 flags to prevent bumped error during the test)
37
37
38 $ mkcommit old
38 $ mkcommit old
39 $ hg push
39 $ hg push
40 pushing to $TESTTMP/remote (glob)
40 pushing to $TESTTMP/remote (glob)
41 searching for changes
41 searching for changes
42 adding changesets
42 adding changesets
43 adding manifests
43 adding manifests
44 adding file changes
44 adding file changes
45 added 1 changesets with 1 changes to 1 files
45 added 1 changesets with 1 changes to 1 files
46 $ hg up -q '.^'
46 $ hg up -q '.^'
47 $ mkcommit new
47 $ mkcommit new
48 created new head
48 created new head
49 $ hg debugobsolete --flags 1 `getid old` `getid new`
49 $ hg debugobsolete --flags 1 `getid old` `getid new`
50 $ hg log -G --hidden
50 $ hg log -G --hidden
51 @ 71e3228bffe1 (draft) add new
51 @ 71e3228bffe1 (draft) add new
52 |
52 |
53 | x c70b08862e08 (draft) add old
53 | x c70b08862e08 (draft) add old
54 |/
54 |/
55 o b4952fcf48cf (public) add base
55 o b4952fcf48cf (public) add base
56
56
57 $ cp -r ../remote ../backup1
57 $ cp -R ../remote ../backup1
58
58
59 old exists remotely as draft. It is obsoleted by new that we now push.
59 old exists remotely as draft. It is obsoleted by new that we now push.
60 Push should not warn about creating new head
60 Push should not warn about creating new head
61
61
62 $ hg push
62 $ hg push
63 pushing to $TESTTMP/remote (glob)
63 pushing to $TESTTMP/remote (glob)
64 searching for changes
64 searching for changes
65 adding changesets
65 adding changesets
66 adding manifests
66 adding manifests
67 adding file changes
67 adding file changes
68 added 1 changesets with 1 changes to 1 files (+1 heads)
68 added 1 changesets with 1 changes to 1 files (+1 heads)
69
69
70 old head is now public (public local version)
70 old head is now public (public local version)
71 =============================================
71 =============================================
72
72
73 setup
73 setup
74
74
75 $ rm -fr ../remote
75 $ rm -fr ../remote
76 $ cp -r ../backup1 ../remote
76 $ cp -R ../backup1 ../remote
77 $ hg -R ../remote phase --public c70b08862e08
77 $ hg -R ../remote phase --public c70b08862e08
78 $ hg pull -v
78 $ hg pull -v
79 pulling from $TESTTMP/remote (glob)
79 pulling from $TESTTMP/remote (glob)
80 searching for changes
80 searching for changes
81 no changes found
81 no changes found
82 $ hg log -G --hidden
82 $ hg log -G --hidden
83 @ 71e3228bffe1 (draft) add new
83 @ 71e3228bffe1 (draft) add new
84 |
84 |
85 | o c70b08862e08 (public) add old
85 | o c70b08862e08 (public) add old
86 |/
86 |/
87 o b4952fcf48cf (public) add base
87 o b4952fcf48cf (public) add base
88
88
89
89
90 Abort: old will still be an head because it's public.
90 Abort: old will still be an head because it's public.
91
91
92 $ hg push
92 $ hg push
93 pushing to $TESTTMP/remote (glob)
93 pushing to $TESTTMP/remote (glob)
94 searching for changes
94 searching for changes
95 abort: push creates new remote head 71e3228bffe1!
95 abort: push creates new remote head 71e3228bffe1!
96 (merge or see 'hg help push' for details about pushing new heads)
96 (merge or see 'hg help push' for details about pushing new heads)
97 [255]
97 [255]
98
98
99 old head is now public (public remote version)
99 old head is now public (public remote version)
100 ==============================================
100 ==============================================
101
101
102 TODO: Not implemented yet.
102 TODO: Not implemented yet.
103
103
104 # setup
104 # setup
105 #
105 #
106 # $ rm -fr ../remote
106 # $ rm -fr ../remote
107 # $ cp -r ../backup1 ../remote
107 # $ cp -R ../backup1 ../remote
108 # $ hg -R ../remote phase --public c70b08862e08
108 # $ hg -R ../remote phase --public c70b08862e08
109 # $ hg phase --draft --force c70b08862e08
109 # $ hg phase --draft --force c70b08862e08
110 # $ hg log -G --hidden
110 # $ hg log -G --hidden
111 # @ 71e3228bffe1 (draft) add new
111 # @ 71e3228bffe1 (draft) add new
112 # |
112 # |
113 # | x c70b08862e08 (draft) add old
113 # | x c70b08862e08 (draft) add old
114 # |/
114 # |/
115 # o b4952fcf48cf (public) add base
115 # o b4952fcf48cf (public) add base
116 #
116 #
117 #
117 #
118 #
118 #
119 # Abort: old will still be an head because it's public.
119 # Abort: old will still be an head because it's public.
120 #
120 #
121 # $ hg push
121 # $ hg push
122 # pushing to $TESTTMP/remote
122 # pushing to $TESTTMP/remote
123 # searching for changes
123 # searching for changes
124 # abort: push creates new remote head 71e3228bffe1!
124 # abort: push creates new remote head 71e3228bffe1!
125 # (merge or see 'hg help push' for details about pushing new heads)
125 # (merge or see 'hg help push' for details about pushing new heads)
126 # [255]
126 # [255]
127
127
128 old head is obsolete but replacement is not pushed
128 old head is obsolete but replacement is not pushed
129 ==================================================
129 ==================================================
130
130
131 setup
131 setup
132
132
133 $ rm -fr ../remote
133 $ rm -fr ../remote
134 $ cp -r ../backup1 ../remote
134 $ cp -R ../backup1 ../remote
135 $ hg phase --draft --force '(0::) - 0'
135 $ hg phase --draft --force '(0::) - 0'
136 $ hg up -q '.^'
136 $ hg up -q '.^'
137 $ mkcommit other
137 $ mkcommit other
138 created new head
138 created new head
139 $ hg log -G --hidden
139 $ hg log -G --hidden
140 @ d7d41ccbd4de (draft) add other
140 @ d7d41ccbd4de (draft) add other
141 |
141 |
142 | o 71e3228bffe1 (draft) add new
142 | o 71e3228bffe1 (draft) add new
143 |/
143 |/
144 | x c70b08862e08 (draft) add old
144 | x c70b08862e08 (draft) add old
145 |/
145 |/
146 o b4952fcf48cf (public) add base
146 o b4952fcf48cf (public) add base
147
147
148
148
149 old exists remotely as draft. It is obsoleted by new but we don't push new.
149 old exists remotely as draft. It is obsoleted by new but we don't push new.
150 Push should abort on new head
150 Push should abort on new head
151
151
152 $ hg push -r 'desc("other")'
152 $ hg push -r 'desc("other")'
153 pushing to $TESTTMP/remote (glob)
153 pushing to $TESTTMP/remote (glob)
154 searching for changes
154 searching for changes
155 abort: push creates new remote head d7d41ccbd4de!
155 abort: push creates new remote head d7d41ccbd4de!
156 (merge or see 'hg help push' for details about pushing new heads)
156 (merge or see 'hg help push' for details about pushing new heads)
157 [255]
157 [255]
158
158
159
159
160
160
161 Both precursors and successors are already know remotely. Descendant adds heads
161 Both precursors and successors are already know remotely. Descendant adds heads
162 ===============================================================================
162 ===============================================================================
163
163
164 setup. (The obsolete marker is known locally only
164 setup. (The obsolete marker is known locally only
165
165
166 $ cd ..
166 $ cd ..
167 $ rm -rf local
167 $ rm -rf local
168 $ hg clone remote local
168 $ hg clone remote local
169 updating to branch default
169 updating to branch default
170 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
171 $ cd local
171 $ cd local
172 $ mkcommit old
172 $ mkcommit old
173 old already tracked!
173 old already tracked!
174 nothing changed
174 nothing changed
175 [1]
175 [1]
176 $ hg up -q '.^'
176 $ hg up -q '.^'
177 $ mkcommit new
177 $ mkcommit new
178 created new head
178 created new head
179 $ hg push -f
179 $ hg push -f
180 pushing to $TESTTMP/remote (glob)
180 pushing to $TESTTMP/remote (glob)
181 searching for changes
181 searching for changes
182 adding changesets
182 adding changesets
183 adding manifests
183 adding manifests
184 adding file changes
184 adding file changes
185 added 1 changesets with 1 changes to 1 files (+1 heads)
185 added 1 changesets with 1 changes to 1 files (+1 heads)
186 $ mkcommit desc1
186 $ mkcommit desc1
187 $ hg up -q '.^'
187 $ hg up -q '.^'
188 $ mkcommit desc2
188 $ mkcommit desc2
189 created new head
189 created new head
190 $ hg debugobsolete `getid old` `getid new`
190 $ hg debugobsolete `getid old` `getid new`
191 $ hg log -G --hidden
191 $ hg log -G --hidden
192 @ 5fe37041cc2b (draft) add desc2
192 @ 5fe37041cc2b (draft) add desc2
193 |
193 |
194 | o a3ef1d111c5f (draft) add desc1
194 | o a3ef1d111c5f (draft) add desc1
195 |/
195 |/
196 o 71e3228bffe1 (draft) add new
196 o 71e3228bffe1 (draft) add new
197 |
197 |
198 | x c70b08862e08 (draft) add old
198 | x c70b08862e08 (draft) add old
199 |/
199 |/
200 o b4952fcf48cf (public) add base
200 o b4952fcf48cf (public) add base
201
201
202 $ hg log -G --hidden -R ../remote
202 $ hg log -G --hidden -R ../remote
203 o 71e3228bffe1 (draft) add new
203 o 71e3228bffe1 (draft) add new
204 |
204 |
205 | o c70b08862e08 (draft) add old
205 | o c70b08862e08 (draft) add old
206 |/
206 |/
207 @ b4952fcf48cf (public) add base
207 @ b4952fcf48cf (public) add base
208
208
209 $ cp -r ../remote ../backup2
209 $ cp -R ../remote ../backup2
210
210
211 Push should not warn about adding new heads. We create one, but we'll delete
211 Push should not warn about adding new heads. We create one, but we'll delete
212 one anyway.
212 one anyway.
213
213
214 $ hg push
214 $ hg push
215 pushing to $TESTTMP/remote (glob)
215 pushing to $TESTTMP/remote (glob)
216 searching for changes
216 searching for changes
217 adding changesets
217 adding changesets
218 adding manifests
218 adding manifests
219 adding file changes
219 adding file changes
220 added 2 changesets with 2 changes to 2 files (+1 heads)
220 added 2 changesets with 2 changes to 2 files (+1 heads)
221
221
222
222
223 Remote head is unknown but obsoleted by a local changeset
223 Remote head is unknown but obsoleted by a local changeset
224 =========================================================
224 =========================================================
225
225
226 setup
226 setup
227
227
228 $ rm -fr ../remote
228 $ rm -fr ../remote
229 $ cp -r ../backup1 ../remote
229 $ cp -R ../backup1 ../remote
230 $ cd ..
230 $ cd ..
231 $ rm -rf local
231 $ rm -rf local
232 $ hg clone remote local -r 0
232 $ hg clone remote local -r 0
233 adding changesets
233 adding changesets
234 adding manifests
234 adding manifests
235 adding file changes
235 adding file changes
236 added 1 changesets with 1 changes to 1 files
236 added 1 changesets with 1 changes to 1 files
237 updating to branch default
237 updating to branch default
238 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
238 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
239 $ cd local
239 $ cd local
240 $ mkcommit new
240 $ mkcommit new
241 $ hg -R ../remote id --debug -r tip
241 $ hg -R ../remote id --debug -r tip
242 c70b08862e0838ea6d7c59c85da2f1ed6c8d67da tip
242 c70b08862e0838ea6d7c59c85da2f1ed6c8d67da tip
243 $ hg id --debug -r tip
243 $ hg id --debug -r tip
244 71e3228bffe1886550777233d6c97bb5a6b2a650 tip
244 71e3228bffe1886550777233d6c97bb5a6b2a650 tip
245 $ hg debugobsolete c70b08862e0838ea6d7c59c85da2f1ed6c8d67da 71e3228bffe1886550777233d6c97bb5a6b2a650
245 $ hg debugobsolete c70b08862e0838ea6d7c59c85da2f1ed6c8d67da 71e3228bffe1886550777233d6c97bb5a6b2a650
246 $ hg log -G --hidden
246 $ hg log -G --hidden
247 @ 71e3228bffe1 (draft) add new
247 @ 71e3228bffe1 (draft) add new
248 |
248 |
249 o b4952fcf48cf (public) add base
249 o b4952fcf48cf (public) add base
250
250
251 $ hg log -G --hidden -R ../remote
251 $ hg log -G --hidden -R ../remote
252 o c70b08862e08 (draft) add old
252 o c70b08862e08 (draft) add old
253 |
253 |
254 @ b4952fcf48cf (public) add base
254 @ b4952fcf48cf (public) add base
255
255
256
256
257 Push should not complain about new heads.
257 Push should not complain about new heads.
258
258
259 $ hg push --traceback
259 $ hg push --traceback
260 pushing to $TESTTMP/remote (glob)
260 pushing to $TESTTMP/remote (glob)
261 searching for changes
261 searching for changes
262 adding changesets
262 adding changesets
263 adding manifests
263 adding manifests
264 adding file changes
264 adding file changes
265 added 1 changesets with 1 changes to 1 files (+1 heads)
265 added 1 changesets with 1 changes to 1 files (+1 heads)
@@ -1,1147 +1,1147 b''
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3 $ echo 123 > a
3 $ echo 123 > a
4 $ echo 123 > c
4 $ echo 123 > c
5 $ echo 123 > e
5 $ echo 123 > e
6 $ hg add a c e
6 $ hg add a c e
7 $ hg commit -m "first" a c e
7 $ hg commit -m "first" a c e
8
8
9 nothing changed
9 nothing changed
10
10
11 $ hg revert
11 $ hg revert
12 abort: no files or directories specified
12 abort: no files or directories specified
13 (use --all to revert all files)
13 (use --all to revert all files)
14 [255]
14 [255]
15 $ hg revert --all
15 $ hg revert --all
16
16
17 Introduce some changes and revert them
17 Introduce some changes and revert them
18 --------------------------------------
18 --------------------------------------
19
19
20 $ echo 123 > b
20 $ echo 123 > b
21
21
22 $ hg status
22 $ hg status
23 ? b
23 ? b
24 $ echo 12 > c
24 $ echo 12 > c
25
25
26 $ hg status
26 $ hg status
27 M c
27 M c
28 ? b
28 ? b
29 $ hg add b
29 $ hg add b
30
30
31 $ hg status
31 $ hg status
32 M c
32 M c
33 A b
33 A b
34 $ hg rm a
34 $ hg rm a
35
35
36 $ hg status
36 $ hg status
37 M c
37 M c
38 A b
38 A b
39 R a
39 R a
40
40
41 revert removal of a file
41 revert removal of a file
42
42
43 $ hg revert a
43 $ hg revert a
44 $ hg status
44 $ hg status
45 M c
45 M c
46 A b
46 A b
47
47
48 revert addition of a file
48 revert addition of a file
49
49
50 $ hg revert b
50 $ hg revert b
51 $ hg status
51 $ hg status
52 M c
52 M c
53 ? b
53 ? b
54
54
55 revert modification of a file (--no-backup)
55 revert modification of a file (--no-backup)
56
56
57 $ hg revert --no-backup c
57 $ hg revert --no-backup c
58 $ hg status
58 $ hg status
59 ? b
59 ? b
60
60
61 revert deletion (! status) of a added file
61 revert deletion (! status) of a added file
62 ------------------------------------------
62 ------------------------------------------
63
63
64 $ hg add b
64 $ hg add b
65
65
66 $ hg status b
66 $ hg status b
67 A b
67 A b
68 $ rm b
68 $ rm b
69 $ hg status b
69 $ hg status b
70 ! b
70 ! b
71 $ hg revert -v b
71 $ hg revert -v b
72 forgetting b
72 forgetting b
73 $ hg status b
73 $ hg status b
74 b: * (glob)
74 b: * (glob)
75
75
76 $ ls
76 $ ls
77 a
77 a
78 c
78 c
79 e
79 e
80
80
81 Test creation of backup (.orig) files
81 Test creation of backup (.orig) files
82 -------------------------------------
82 -------------------------------------
83
83
84 $ echo z > e
84 $ echo z > e
85 $ hg revert --all -v
85 $ hg revert --all -v
86 saving current version of e as e.orig
86 saving current version of e as e.orig
87 reverting e
87 reverting e
88
88
89 Test creation of backup (.orig) file in configured file location
89 Test creation of backup (.orig) file in configured file location
90 ----------------------------------------------------------------
90 ----------------------------------------------------------------
91
91
92 $ echo z > e
92 $ echo z > e
93 $ hg revert --all -v --config 'ui.origbackuppath=.hg/origbackups'
93 $ hg revert --all -v --config 'ui.origbackuppath=.hg/origbackups'
94 creating directory: $TESTTMP/repo/.hg/origbackups (glob)
94 creating directory: $TESTTMP/repo/.hg/origbackups (glob)
95 saving current version of e as $TESTTMP/repo/.hg/origbackups/e.orig (glob)
95 saving current version of e as $TESTTMP/repo/.hg/origbackups/e.orig (glob)
96 reverting e
96 reverting e
97 $ rm -rf .hg/origbackups
97 $ rm -rf .hg/origbackups
98
98
99 revert on clean file (no change)
99 revert on clean file (no change)
100 --------------------------------
100 --------------------------------
101
101
102 $ hg revert a
102 $ hg revert a
103 no changes needed to a
103 no changes needed to a
104
104
105 revert on an untracked file
105 revert on an untracked file
106 ---------------------------
106 ---------------------------
107
107
108 $ echo q > q
108 $ echo q > q
109 $ hg revert q
109 $ hg revert q
110 file not managed: q
110 file not managed: q
111 $ rm q
111 $ rm q
112
112
113 revert on file that does not exists
113 revert on file that does not exists
114 -----------------------------------
114 -----------------------------------
115
115
116 $ hg revert notfound
116 $ hg revert notfound
117 notfound: no such file in rev 334a9e57682c
117 notfound: no such file in rev 334a9e57682c
118 $ touch d
118 $ touch d
119 $ hg add d
119 $ hg add d
120 $ hg rm a
120 $ hg rm a
121 $ hg commit -m "second"
121 $ hg commit -m "second"
122 $ echo z > z
122 $ echo z > z
123 $ hg add z
123 $ hg add z
124 $ hg st
124 $ hg st
125 A z
125 A z
126 ? e.orig
126 ? e.orig
127
127
128 revert to another revision (--rev)
128 revert to another revision (--rev)
129 ----------------------------------
129 ----------------------------------
130
130
131 $ hg revert --all -r0
131 $ hg revert --all -r0
132 adding a
132 adding a
133 removing d
133 removing d
134 forgetting z
134 forgetting z
135
135
136 revert explicitly to parent (--rev)
136 revert explicitly to parent (--rev)
137 -----------------------------------
137 -----------------------------------
138
138
139 $ hg revert --all -rtip
139 $ hg revert --all -rtip
140 forgetting a
140 forgetting a
141 undeleting d
141 undeleting d
142 $ rm a *.orig
142 $ rm a *.orig
143
143
144 revert to another revision (--rev) and exact match
144 revert to another revision (--rev) and exact match
145 --------------------------------------------------
145 --------------------------------------------------
146
146
147 exact match are more silent
147 exact match are more silent
148
148
149 $ hg revert -r0 a
149 $ hg revert -r0 a
150 $ hg st a
150 $ hg st a
151 A a
151 A a
152 $ hg rm d
152 $ hg rm d
153 $ hg st d
153 $ hg st d
154 R d
154 R d
155
155
156 should keep d removed
156 should keep d removed
157
157
158 $ hg revert -r0 d
158 $ hg revert -r0 d
159 no changes needed to d
159 no changes needed to d
160 $ hg st d
160 $ hg st d
161 R d
161 R d
162
162
163 $ hg update -C
163 $ hg update -C
164 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
164 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
165
165
166 revert of exec bit
166 revert of exec bit
167 ------------------
167 ------------------
168
168
169 #if execbit
169 #if execbit
170 $ chmod +x c
170 $ chmod +x c
171 $ hg revert --all
171 $ hg revert --all
172 reverting c
172 reverting c
173
173
174 $ test -x c || echo non-executable
174 $ test -x c || echo non-executable
175 non-executable
175 non-executable
176
176
177 $ chmod +x c
177 $ chmod +x c
178 $ hg commit -m exe
178 $ hg commit -m exe
179
179
180 $ chmod -x c
180 $ chmod -x c
181 $ hg revert --all
181 $ hg revert --all
182 reverting c
182 reverting c
183
183
184 $ test -x c && echo executable
184 $ test -x c && echo executable
185 executable
185 executable
186 #endif
186 #endif
187
187
188 Test that files reverted to other than the parent are treated as
188 Test that files reverted to other than the parent are treated as
189 "modified", even if none of mode, size and timestamp of it isn't
189 "modified", even if none of mode, size and timestamp of it isn't
190 changed on the filesystem (see also issue4583).
190 changed on the filesystem (see also issue4583).
191
191
192 $ echo 321 > e
192 $ echo 321 > e
193 $ hg diff --git
193 $ hg diff --git
194 diff --git a/e b/e
194 diff --git a/e b/e
195 --- a/e
195 --- a/e
196 +++ b/e
196 +++ b/e
197 @@ -1,1 +1,1 @@
197 @@ -1,1 +1,1 @@
198 -123
198 -123
199 +321
199 +321
200 $ hg commit -m 'ambiguity from size'
200 $ hg commit -m 'ambiguity from size'
201
201
202 $ cat e
202 $ cat e
203 321
203 321
204 $ touch -t 200001010000 e
204 $ touch -t 200001010000 e
205 $ hg debugrebuildstate
205 $ hg debugrebuildstate
206
206
207 $ cat >> .hg/hgrc <<EOF
207 $ cat >> .hg/hgrc <<EOF
208 > [fakedirstatewritetime]
208 > [fakedirstatewritetime]
209 > # emulate invoking dirstate.write() via repo.status()
209 > # emulate invoking dirstate.write() via repo.status()
210 > # at 2000-01-01 00:00
210 > # at 2000-01-01 00:00
211 > fakenow = 200001010000
211 > fakenow = 200001010000
212 >
212 >
213 > [extensions]
213 > [extensions]
214 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
214 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
215 > EOF
215 > EOF
216 $ hg revert -r 0 e
216 $ hg revert -r 0 e
217 $ cat >> .hg/hgrc <<EOF
217 $ cat >> .hg/hgrc <<EOF
218 > [extensions]
218 > [extensions]
219 > fakedirstatewritetime = !
219 > fakedirstatewritetime = !
220 > EOF
220 > EOF
221
221
222 $ cat e
222 $ cat e
223 123
223 123
224 $ touch -t 200001010000 e
224 $ touch -t 200001010000 e
225 $ hg status -A e
225 $ hg status -A e
226 M e
226 M e
227
227
228 $ cd ..
228 $ cd ..
229
229
230
230
231 Issue241: update and revert produces inconsistent repositories
231 Issue241: update and revert produces inconsistent repositories
232 --------------------------------------------------------------
232 --------------------------------------------------------------
233
233
234 $ hg init a
234 $ hg init a
235 $ cd a
235 $ cd a
236 $ echo a >> a
236 $ echo a >> a
237 $ hg commit -A -d '1 0' -m a
237 $ hg commit -A -d '1 0' -m a
238 adding a
238 adding a
239 $ echo a >> a
239 $ echo a >> a
240 $ hg commit -d '2 0' -m a
240 $ hg commit -d '2 0' -m a
241 $ hg update 0
241 $ hg update 0
242 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
242 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
243 $ mkdir b
243 $ mkdir b
244 $ echo b > b/b
244 $ echo b > b/b
245
245
246 call `hg revert` with no file specified
246 call `hg revert` with no file specified
247 ---------------------------------------
247 ---------------------------------------
248
248
249 $ hg revert -rtip
249 $ hg revert -rtip
250 abort: no files or directories specified
250 abort: no files or directories specified
251 (use --all to revert all files, or 'hg update 1' to update)
251 (use --all to revert all files, or 'hg update 1' to update)
252 [255]
252 [255]
253
253
254 call `hg revert` with -I
254 call `hg revert` with -I
255 ---------------------------
255 ---------------------------
256
256
257 $ echo a >> a
257 $ echo a >> a
258 $ hg revert -I a
258 $ hg revert -I a
259 reverting a
259 reverting a
260
260
261 call `hg revert` with -X
261 call `hg revert` with -X
262 ---------------------------
262 ---------------------------
263
263
264 $ echo a >> a
264 $ echo a >> a
265 $ hg revert -X d
265 $ hg revert -X d
266 reverting a
266 reverting a
267
267
268 call `hg revert` with --all
268 call `hg revert` with --all
269 ---------------------------
269 ---------------------------
270
270
271 $ hg revert --all -rtip
271 $ hg revert --all -rtip
272 reverting a
272 reverting a
273 $ rm *.orig
273 $ rm *.orig
274
274
275 Issue332: confusing message when reverting directory
275 Issue332: confusing message when reverting directory
276 ----------------------------------------------------
276 ----------------------------------------------------
277
277
278 $ hg ci -A -m b
278 $ hg ci -A -m b
279 adding b/b
279 adding b/b
280 created new head
280 created new head
281 $ echo foobar > b/b
281 $ echo foobar > b/b
282 $ mkdir newdir
282 $ mkdir newdir
283 $ echo foo > newdir/newfile
283 $ echo foo > newdir/newfile
284 $ hg add newdir/newfile
284 $ hg add newdir/newfile
285 $ hg revert b newdir
285 $ hg revert b newdir
286 reverting b/b (glob)
286 reverting b/b (glob)
287 forgetting newdir/newfile (glob)
287 forgetting newdir/newfile (glob)
288 $ echo foobar > b/b
288 $ echo foobar > b/b
289 $ hg revert .
289 $ hg revert .
290 reverting b/b (glob)
290 reverting b/b (glob)
291
291
292
292
293 reverting a rename target should revert the source
293 reverting a rename target should revert the source
294 --------------------------------------------------
294 --------------------------------------------------
295
295
296 $ hg mv a newa
296 $ hg mv a newa
297 $ hg revert newa
297 $ hg revert newa
298 $ hg st a newa
298 $ hg st a newa
299 ? newa
299 ? newa
300
300
301 Also true for move overwriting an existing file
301 Also true for move overwriting an existing file
302
302
303 $ hg mv --force a b/b
303 $ hg mv --force a b/b
304 $ hg revert b/b
304 $ hg revert b/b
305 $ hg status a b/b
305 $ hg status a b/b
306
306
307 $ cd ..
307 $ cd ..
308
308
309 $ hg init ignored
309 $ hg init ignored
310 $ cd ignored
310 $ cd ignored
311 $ echo '^ignored$' > .hgignore
311 $ echo '^ignored$' > .hgignore
312 $ echo '^ignoreddir$' >> .hgignore
312 $ echo '^ignoreddir$' >> .hgignore
313 $ echo '^removed$' >> .hgignore
313 $ echo '^removed$' >> .hgignore
314
314
315 $ mkdir ignoreddir
315 $ mkdir ignoreddir
316 $ touch ignoreddir/file
316 $ touch ignoreddir/file
317 $ touch ignoreddir/removed
317 $ touch ignoreddir/removed
318 $ touch ignored
318 $ touch ignored
319 $ touch removed
319 $ touch removed
320
320
321 4 ignored files (we will add/commit everything)
321 4 ignored files (we will add/commit everything)
322
322
323 $ hg st -A -X .hgignore
323 $ hg st -A -X .hgignore
324 I ignored
324 I ignored
325 I ignoreddir/file
325 I ignoreddir/file
326 I ignoreddir/removed
326 I ignoreddir/removed
327 I removed
327 I removed
328 $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
328 $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
329
329
330 $ echo >> ignored
330 $ echo >> ignored
331 $ echo >> ignoreddir/file
331 $ echo >> ignoreddir/file
332 $ hg rm removed ignoreddir/removed
332 $ hg rm removed ignoreddir/removed
333
333
334 should revert ignored* and undelete *removed
334 should revert ignored* and undelete *removed
335 --------------------------------------------
335 --------------------------------------------
336
336
337 $ hg revert -a --no-backup
337 $ hg revert -a --no-backup
338 reverting ignored
338 reverting ignored
339 reverting ignoreddir/file (glob)
339 reverting ignoreddir/file (glob)
340 undeleting ignoreddir/removed (glob)
340 undeleting ignoreddir/removed (glob)
341 undeleting removed
341 undeleting removed
342 $ hg st -mardi
342 $ hg st -mardi
343
343
344 $ hg up -qC
344 $ hg up -qC
345 $ echo >> ignored
345 $ echo >> ignored
346 $ hg rm removed
346 $ hg rm removed
347
347
348 should silently revert the named files
348 should silently revert the named files
349 --------------------------------------
349 --------------------------------------
350
350
351 $ hg revert --no-backup ignored removed
351 $ hg revert --no-backup ignored removed
352 $ hg st -mardi
352 $ hg st -mardi
353
353
354 Reverting copy (issue3920)
354 Reverting copy (issue3920)
355 --------------------------
355 --------------------------
356
356
357 someone set up us the copies
357 someone set up us the copies
358
358
359 $ rm .hgignore
359 $ rm .hgignore
360 $ hg update -C
360 $ hg update -C
361 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
361 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
362 $ hg mv ignored allyour
362 $ hg mv ignored allyour
363 $ hg copy removed base
363 $ hg copy removed base
364 $ hg commit -m rename
364 $ hg commit -m rename
365
365
366 copies and renames, you have no chance to survive make your time (issue3920)
366 copies and renames, you have no chance to survive make your time (issue3920)
367
367
368 $ hg update '.^'
368 $ hg update '.^'
369 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
369 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
370 $ hg revert -rtip -a
370 $ hg revert -rtip -a
371 adding allyour
371 adding allyour
372 adding base
372 adding base
373 removing ignored
373 removing ignored
374 $ hg status -C
374 $ hg status -C
375 A allyour
375 A allyour
376 ignored
376 ignored
377 A base
377 A base
378 removed
378 removed
379 R ignored
379 R ignored
380
380
381 Test revert of a file added by one side of the merge
381 Test revert of a file added by one side of the merge
382 ====================================================
382 ====================================================
383
383
384 remove any pending change
384 remove any pending change
385
385
386 $ hg revert --all
386 $ hg revert --all
387 forgetting allyour
387 forgetting allyour
388 forgetting base
388 forgetting base
389 undeleting ignored
389 undeleting ignored
390 $ hg purge --all --config extensions.purge=
390 $ hg purge --all --config extensions.purge=
391
391
392 Adds a new commit
392 Adds a new commit
393
393
394 $ echo foo > newadd
394 $ echo foo > newadd
395 $ hg add newadd
395 $ hg add newadd
396 $ hg commit -m 'other adds'
396 $ hg commit -m 'other adds'
397 created new head
397 created new head
398
398
399
399
400 merge it with the other head
400 merge it with the other head
401
401
402 $ hg merge # merge 1 into 2
402 $ hg merge # merge 1 into 2
403 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
403 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
404 (branch merge, don't forget to commit)
404 (branch merge, don't forget to commit)
405 $ hg summary
405 $ hg summary
406 parent: 2:b8ec310b2d4e tip
406 parent: 2:b8ec310b2d4e tip
407 other adds
407 other adds
408 parent: 1:f6180deb8fbe
408 parent: 1:f6180deb8fbe
409 rename
409 rename
410 branch: default
410 branch: default
411 commit: 2 modified, 1 removed (merge)
411 commit: 2 modified, 1 removed (merge)
412 update: (current)
412 update: (current)
413 phases: 3 draft
413 phases: 3 draft
414
414
415 clarifies who added what
415 clarifies who added what
416
416
417 $ hg status
417 $ hg status
418 M allyour
418 M allyour
419 M base
419 M base
420 R ignored
420 R ignored
421 $ hg status --change 'p1()'
421 $ hg status --change 'p1()'
422 A newadd
422 A newadd
423 $ hg status --change 'p2()'
423 $ hg status --change 'p2()'
424 A allyour
424 A allyour
425 A base
425 A base
426 R ignored
426 R ignored
427
427
428 revert file added by p1() to p1() state
428 revert file added by p1() to p1() state
429 -----------------------------------------
429 -----------------------------------------
430
430
431 $ hg revert -r 'p1()' 'glob:newad?'
431 $ hg revert -r 'p1()' 'glob:newad?'
432 $ hg status
432 $ hg status
433 M allyour
433 M allyour
434 M base
434 M base
435 R ignored
435 R ignored
436
436
437 revert file added by p1() to p2() state
437 revert file added by p1() to p2() state
438 ------------------------------------------
438 ------------------------------------------
439
439
440 $ hg revert -r 'p2()' 'glob:newad?'
440 $ hg revert -r 'p2()' 'glob:newad?'
441 removing newadd
441 removing newadd
442 $ hg status
442 $ hg status
443 M allyour
443 M allyour
444 M base
444 M base
445 R ignored
445 R ignored
446 R newadd
446 R newadd
447
447
448 revert file added by p2() to p2() state
448 revert file added by p2() to p2() state
449 ------------------------------------------
449 ------------------------------------------
450
450
451 $ hg revert -r 'p2()' 'glob:allyou?'
451 $ hg revert -r 'p2()' 'glob:allyou?'
452 $ hg status
452 $ hg status
453 M allyour
453 M allyour
454 M base
454 M base
455 R ignored
455 R ignored
456 R newadd
456 R newadd
457
457
458 revert file added by p2() to p1() state
458 revert file added by p2() to p1() state
459 ------------------------------------------
459 ------------------------------------------
460
460
461 $ hg revert -r 'p1()' 'glob:allyou?'
461 $ hg revert -r 'p1()' 'glob:allyou?'
462 removing allyour
462 removing allyour
463 $ hg status
463 $ hg status
464 M base
464 M base
465 R allyour
465 R allyour
466 R ignored
466 R ignored
467 R newadd
467 R newadd
468
468
469 Systematic behavior validation of most possible cases
469 Systematic behavior validation of most possible cases
470 =====================================================
470 =====================================================
471
471
472 This section tests most of the possible combinations of revision states and
472 This section tests most of the possible combinations of revision states and
473 working directory states. The number of possible cases is significant but they
473 working directory states. The number of possible cases is significant but they
474 but they all have a slightly different handling. So this section commits to
474 but they all have a slightly different handling. So this section commits to
475 and testing all of them to allow safe refactoring of the revert code.
475 and testing all of them to allow safe refactoring of the revert code.
476
476
477 A python script is used to generate a file history for each combination of
477 A python script is used to generate a file history for each combination of
478 states, on one side the content (or lack thereof) in two revisions, and
478 states, on one side the content (or lack thereof) in two revisions, and
479 on the other side, the content and "tracked-ness" of the working directory. The
479 on the other side, the content and "tracked-ness" of the working directory. The
480 three states generated are:
480 three states generated are:
481
481
482 - a "base" revision
482 - a "base" revision
483 - a "parent" revision
483 - a "parent" revision
484 - the working directory (based on "parent")
484 - the working directory (based on "parent")
485
485
486 The files generated have names of the form:
486 The files generated have names of the form:
487
487
488 <rev1-content>_<rev2-content>_<working-copy-content>-<tracked-ness>
488 <rev1-content>_<rev2-content>_<working-copy-content>-<tracked-ness>
489
489
490 All known states are not tested yet. See inline documentation for details.
490 All known states are not tested yet. See inline documentation for details.
491 Special cases from merge and rename are not tested by this section.
491 Special cases from merge and rename are not tested by this section.
492
492
493 Write the python script to disk
493 Write the python script to disk
494 -------------------------------
494 -------------------------------
495
495
496 check list of planned files
496 check list of planned files
497
497
498 $ python $TESTDIR/generate-working-copy-states.py filelist 2
498 $ python $TESTDIR/generate-working-copy-states.py filelist 2
499 content1_content1_content1-tracked
499 content1_content1_content1-tracked
500 content1_content1_content1-untracked
500 content1_content1_content1-untracked
501 content1_content1_content3-tracked
501 content1_content1_content3-tracked
502 content1_content1_content3-untracked
502 content1_content1_content3-untracked
503 content1_content1_missing-tracked
503 content1_content1_missing-tracked
504 content1_content1_missing-untracked
504 content1_content1_missing-untracked
505 content1_content2_content1-tracked
505 content1_content2_content1-tracked
506 content1_content2_content1-untracked
506 content1_content2_content1-untracked
507 content1_content2_content2-tracked
507 content1_content2_content2-tracked
508 content1_content2_content2-untracked
508 content1_content2_content2-untracked
509 content1_content2_content3-tracked
509 content1_content2_content3-tracked
510 content1_content2_content3-untracked
510 content1_content2_content3-untracked
511 content1_content2_missing-tracked
511 content1_content2_missing-tracked
512 content1_content2_missing-untracked
512 content1_content2_missing-untracked
513 content1_missing_content1-tracked
513 content1_missing_content1-tracked
514 content1_missing_content1-untracked
514 content1_missing_content1-untracked
515 content1_missing_content3-tracked
515 content1_missing_content3-tracked
516 content1_missing_content3-untracked
516 content1_missing_content3-untracked
517 content1_missing_missing-tracked
517 content1_missing_missing-tracked
518 content1_missing_missing-untracked
518 content1_missing_missing-untracked
519 missing_content2_content2-tracked
519 missing_content2_content2-tracked
520 missing_content2_content2-untracked
520 missing_content2_content2-untracked
521 missing_content2_content3-tracked
521 missing_content2_content3-tracked
522 missing_content2_content3-untracked
522 missing_content2_content3-untracked
523 missing_content2_missing-tracked
523 missing_content2_missing-tracked
524 missing_content2_missing-untracked
524 missing_content2_missing-untracked
525 missing_missing_content3-tracked
525 missing_missing_content3-tracked
526 missing_missing_content3-untracked
526 missing_missing_content3-untracked
527 missing_missing_missing-tracked
527 missing_missing_missing-tracked
528 missing_missing_missing-untracked
528 missing_missing_missing-untracked
529
529
530 Script to make a simple text version of the content
530 Script to make a simple text version of the content
531 ---------------------------------------------------
531 ---------------------------------------------------
532
532
533 $ cat << EOF >> dircontent.py
533 $ cat << EOF >> dircontent.py
534 > # generate a simple text view of the directory for easy comparison
534 > # generate a simple text view of the directory for easy comparison
535 > import os
535 > import os
536 > files = os.listdir('.')
536 > files = os.listdir('.')
537 > files.sort()
537 > files.sort()
538 > for filename in files:
538 > for filename in files:
539 > if os.path.isdir(filename):
539 > if os.path.isdir(filename):
540 > continue
540 > continue
541 > content = open(filename).read()
541 > content = open(filename).read()
542 > print '%-6s %s' % (content.strip(), filename)
542 > print '%-6s %s' % (content.strip(), filename)
543 > EOF
543 > EOF
544
544
545 Generate appropriate repo state
545 Generate appropriate repo state
546 -------------------------------
546 -------------------------------
547
547
548 $ hg init revert-ref
548 $ hg init revert-ref
549 $ cd revert-ref
549 $ cd revert-ref
550
550
551 Generate base changeset
551 Generate base changeset
552
552
553 $ python $TESTDIR/generate-working-copy-states.py state 2 1
553 $ python $TESTDIR/generate-working-copy-states.py state 2 1
554 $ hg addremove --similarity 0
554 $ hg addremove --similarity 0
555 adding content1_content1_content1-tracked
555 adding content1_content1_content1-tracked
556 adding content1_content1_content1-untracked
556 adding content1_content1_content1-untracked
557 adding content1_content1_content3-tracked
557 adding content1_content1_content3-tracked
558 adding content1_content1_content3-untracked
558 adding content1_content1_content3-untracked
559 adding content1_content1_missing-tracked
559 adding content1_content1_missing-tracked
560 adding content1_content1_missing-untracked
560 adding content1_content1_missing-untracked
561 adding content1_content2_content1-tracked
561 adding content1_content2_content1-tracked
562 adding content1_content2_content1-untracked
562 adding content1_content2_content1-untracked
563 adding content1_content2_content2-tracked
563 adding content1_content2_content2-tracked
564 adding content1_content2_content2-untracked
564 adding content1_content2_content2-untracked
565 adding content1_content2_content3-tracked
565 adding content1_content2_content3-tracked
566 adding content1_content2_content3-untracked
566 adding content1_content2_content3-untracked
567 adding content1_content2_missing-tracked
567 adding content1_content2_missing-tracked
568 adding content1_content2_missing-untracked
568 adding content1_content2_missing-untracked
569 adding content1_missing_content1-tracked
569 adding content1_missing_content1-tracked
570 adding content1_missing_content1-untracked
570 adding content1_missing_content1-untracked
571 adding content1_missing_content3-tracked
571 adding content1_missing_content3-tracked
572 adding content1_missing_content3-untracked
572 adding content1_missing_content3-untracked
573 adding content1_missing_missing-tracked
573 adding content1_missing_missing-tracked
574 adding content1_missing_missing-untracked
574 adding content1_missing_missing-untracked
575 $ hg status
575 $ hg status
576 A content1_content1_content1-tracked
576 A content1_content1_content1-tracked
577 A content1_content1_content1-untracked
577 A content1_content1_content1-untracked
578 A content1_content1_content3-tracked
578 A content1_content1_content3-tracked
579 A content1_content1_content3-untracked
579 A content1_content1_content3-untracked
580 A content1_content1_missing-tracked
580 A content1_content1_missing-tracked
581 A content1_content1_missing-untracked
581 A content1_content1_missing-untracked
582 A content1_content2_content1-tracked
582 A content1_content2_content1-tracked
583 A content1_content2_content1-untracked
583 A content1_content2_content1-untracked
584 A content1_content2_content2-tracked
584 A content1_content2_content2-tracked
585 A content1_content2_content2-untracked
585 A content1_content2_content2-untracked
586 A content1_content2_content3-tracked
586 A content1_content2_content3-tracked
587 A content1_content2_content3-untracked
587 A content1_content2_content3-untracked
588 A content1_content2_missing-tracked
588 A content1_content2_missing-tracked
589 A content1_content2_missing-untracked
589 A content1_content2_missing-untracked
590 A content1_missing_content1-tracked
590 A content1_missing_content1-tracked
591 A content1_missing_content1-untracked
591 A content1_missing_content1-untracked
592 A content1_missing_content3-tracked
592 A content1_missing_content3-tracked
593 A content1_missing_content3-untracked
593 A content1_missing_content3-untracked
594 A content1_missing_missing-tracked
594 A content1_missing_missing-tracked
595 A content1_missing_missing-untracked
595 A content1_missing_missing-untracked
596 $ hg commit -m 'base'
596 $ hg commit -m 'base'
597
597
598 (create a simple text version of the content)
598 (create a simple text version of the content)
599
599
600 $ python ../dircontent.py > ../content-base.txt
600 $ python ../dircontent.py > ../content-base.txt
601 $ cat ../content-base.txt
601 $ cat ../content-base.txt
602 content1 content1_content1_content1-tracked
602 content1 content1_content1_content1-tracked
603 content1 content1_content1_content1-untracked
603 content1 content1_content1_content1-untracked
604 content1 content1_content1_content3-tracked
604 content1 content1_content1_content3-tracked
605 content1 content1_content1_content3-untracked
605 content1 content1_content1_content3-untracked
606 content1 content1_content1_missing-tracked
606 content1 content1_content1_missing-tracked
607 content1 content1_content1_missing-untracked
607 content1 content1_content1_missing-untracked
608 content1 content1_content2_content1-tracked
608 content1 content1_content2_content1-tracked
609 content1 content1_content2_content1-untracked
609 content1 content1_content2_content1-untracked
610 content1 content1_content2_content2-tracked
610 content1 content1_content2_content2-tracked
611 content1 content1_content2_content2-untracked
611 content1 content1_content2_content2-untracked
612 content1 content1_content2_content3-tracked
612 content1 content1_content2_content3-tracked
613 content1 content1_content2_content3-untracked
613 content1 content1_content2_content3-untracked
614 content1 content1_content2_missing-tracked
614 content1 content1_content2_missing-tracked
615 content1 content1_content2_missing-untracked
615 content1 content1_content2_missing-untracked
616 content1 content1_missing_content1-tracked
616 content1 content1_missing_content1-tracked
617 content1 content1_missing_content1-untracked
617 content1 content1_missing_content1-untracked
618 content1 content1_missing_content3-tracked
618 content1 content1_missing_content3-tracked
619 content1 content1_missing_content3-untracked
619 content1 content1_missing_content3-untracked
620 content1 content1_missing_missing-tracked
620 content1 content1_missing_missing-tracked
621 content1 content1_missing_missing-untracked
621 content1 content1_missing_missing-untracked
622
622
623 Create parent changeset
623 Create parent changeset
624
624
625 $ python $TESTDIR/generate-working-copy-states.py state 2 2
625 $ python $TESTDIR/generate-working-copy-states.py state 2 2
626 $ hg addremove --similarity 0
626 $ hg addremove --similarity 0
627 removing content1_missing_content1-tracked
627 removing content1_missing_content1-tracked
628 removing content1_missing_content1-untracked
628 removing content1_missing_content1-untracked
629 removing content1_missing_content3-tracked
629 removing content1_missing_content3-tracked
630 removing content1_missing_content3-untracked
630 removing content1_missing_content3-untracked
631 removing content1_missing_missing-tracked
631 removing content1_missing_missing-tracked
632 removing content1_missing_missing-untracked
632 removing content1_missing_missing-untracked
633 adding missing_content2_content2-tracked
633 adding missing_content2_content2-tracked
634 adding missing_content2_content2-untracked
634 adding missing_content2_content2-untracked
635 adding missing_content2_content3-tracked
635 adding missing_content2_content3-tracked
636 adding missing_content2_content3-untracked
636 adding missing_content2_content3-untracked
637 adding missing_content2_missing-tracked
637 adding missing_content2_missing-tracked
638 adding missing_content2_missing-untracked
638 adding missing_content2_missing-untracked
639 $ hg status
639 $ hg status
640 M content1_content2_content1-tracked
640 M content1_content2_content1-tracked
641 M content1_content2_content1-untracked
641 M content1_content2_content1-untracked
642 M content1_content2_content2-tracked
642 M content1_content2_content2-tracked
643 M content1_content2_content2-untracked
643 M content1_content2_content2-untracked
644 M content1_content2_content3-tracked
644 M content1_content2_content3-tracked
645 M content1_content2_content3-untracked
645 M content1_content2_content3-untracked
646 M content1_content2_missing-tracked
646 M content1_content2_missing-tracked
647 M content1_content2_missing-untracked
647 M content1_content2_missing-untracked
648 A missing_content2_content2-tracked
648 A missing_content2_content2-tracked
649 A missing_content2_content2-untracked
649 A missing_content2_content2-untracked
650 A missing_content2_content3-tracked
650 A missing_content2_content3-tracked
651 A missing_content2_content3-untracked
651 A missing_content2_content3-untracked
652 A missing_content2_missing-tracked
652 A missing_content2_missing-tracked
653 A missing_content2_missing-untracked
653 A missing_content2_missing-untracked
654 R content1_missing_content1-tracked
654 R content1_missing_content1-tracked
655 R content1_missing_content1-untracked
655 R content1_missing_content1-untracked
656 R content1_missing_content3-tracked
656 R content1_missing_content3-tracked
657 R content1_missing_content3-untracked
657 R content1_missing_content3-untracked
658 R content1_missing_missing-tracked
658 R content1_missing_missing-tracked
659 R content1_missing_missing-untracked
659 R content1_missing_missing-untracked
660 $ hg commit -m 'parent'
660 $ hg commit -m 'parent'
661
661
662 (create a simple text version of the content)
662 (create a simple text version of the content)
663
663
664 $ python ../dircontent.py > ../content-parent.txt
664 $ python ../dircontent.py > ../content-parent.txt
665 $ cat ../content-parent.txt
665 $ cat ../content-parent.txt
666 content1 content1_content1_content1-tracked
666 content1 content1_content1_content1-tracked
667 content1 content1_content1_content1-untracked
667 content1 content1_content1_content1-untracked
668 content1 content1_content1_content3-tracked
668 content1 content1_content1_content3-tracked
669 content1 content1_content1_content3-untracked
669 content1 content1_content1_content3-untracked
670 content1 content1_content1_missing-tracked
670 content1 content1_content1_missing-tracked
671 content1 content1_content1_missing-untracked
671 content1 content1_content1_missing-untracked
672 content2 content1_content2_content1-tracked
672 content2 content1_content2_content1-tracked
673 content2 content1_content2_content1-untracked
673 content2 content1_content2_content1-untracked
674 content2 content1_content2_content2-tracked
674 content2 content1_content2_content2-tracked
675 content2 content1_content2_content2-untracked
675 content2 content1_content2_content2-untracked
676 content2 content1_content2_content3-tracked
676 content2 content1_content2_content3-tracked
677 content2 content1_content2_content3-untracked
677 content2 content1_content2_content3-untracked
678 content2 content1_content2_missing-tracked
678 content2 content1_content2_missing-tracked
679 content2 content1_content2_missing-untracked
679 content2 content1_content2_missing-untracked
680 content2 missing_content2_content2-tracked
680 content2 missing_content2_content2-tracked
681 content2 missing_content2_content2-untracked
681 content2 missing_content2_content2-untracked
682 content2 missing_content2_content3-tracked
682 content2 missing_content2_content3-tracked
683 content2 missing_content2_content3-untracked
683 content2 missing_content2_content3-untracked
684 content2 missing_content2_missing-tracked
684 content2 missing_content2_missing-tracked
685 content2 missing_content2_missing-untracked
685 content2 missing_content2_missing-untracked
686
686
687 Setup working directory
687 Setup working directory
688
688
689 $ python $TESTDIR/generate-working-copy-states.py state 2 wc
689 $ python $TESTDIR/generate-working-copy-states.py state 2 wc
690 $ hg addremove --similarity 0
690 $ hg addremove --similarity 0
691 adding content1_missing_content1-tracked
691 adding content1_missing_content1-tracked
692 adding content1_missing_content1-untracked
692 adding content1_missing_content1-untracked
693 adding content1_missing_content3-tracked
693 adding content1_missing_content3-tracked
694 adding content1_missing_content3-untracked
694 adding content1_missing_content3-untracked
695 adding content1_missing_missing-tracked
695 adding content1_missing_missing-tracked
696 adding content1_missing_missing-untracked
696 adding content1_missing_missing-untracked
697 adding missing_missing_content3-tracked
697 adding missing_missing_content3-tracked
698 adding missing_missing_content3-untracked
698 adding missing_missing_content3-untracked
699 adding missing_missing_missing-tracked
699 adding missing_missing_missing-tracked
700 adding missing_missing_missing-untracked
700 adding missing_missing_missing-untracked
701 $ hg forget *_*_*-untracked
701 $ hg forget *_*_*-untracked
702 $ rm *_*_missing-*
702 $ rm *_*_missing-*
703 $ hg status
703 $ hg status
704 M content1_content1_content3-tracked
704 M content1_content1_content3-tracked
705 M content1_content2_content1-tracked
705 M content1_content2_content1-tracked
706 M content1_content2_content3-tracked
706 M content1_content2_content3-tracked
707 M missing_content2_content3-tracked
707 M missing_content2_content3-tracked
708 A content1_missing_content1-tracked
708 A content1_missing_content1-tracked
709 A content1_missing_content3-tracked
709 A content1_missing_content3-tracked
710 A missing_missing_content3-tracked
710 A missing_missing_content3-tracked
711 R content1_content1_content1-untracked
711 R content1_content1_content1-untracked
712 R content1_content1_content3-untracked
712 R content1_content1_content3-untracked
713 R content1_content1_missing-untracked
713 R content1_content1_missing-untracked
714 R content1_content2_content1-untracked
714 R content1_content2_content1-untracked
715 R content1_content2_content2-untracked
715 R content1_content2_content2-untracked
716 R content1_content2_content3-untracked
716 R content1_content2_content3-untracked
717 R content1_content2_missing-untracked
717 R content1_content2_missing-untracked
718 R missing_content2_content2-untracked
718 R missing_content2_content2-untracked
719 R missing_content2_content3-untracked
719 R missing_content2_content3-untracked
720 R missing_content2_missing-untracked
720 R missing_content2_missing-untracked
721 ! content1_content1_missing-tracked
721 ! content1_content1_missing-tracked
722 ! content1_content2_missing-tracked
722 ! content1_content2_missing-tracked
723 ! content1_missing_missing-tracked
723 ! content1_missing_missing-tracked
724 ! missing_content2_missing-tracked
724 ! missing_content2_missing-tracked
725 ! missing_missing_missing-tracked
725 ! missing_missing_missing-tracked
726 ? content1_missing_content1-untracked
726 ? content1_missing_content1-untracked
727 ? content1_missing_content3-untracked
727 ? content1_missing_content3-untracked
728 ? missing_missing_content3-untracked
728 ? missing_missing_content3-untracked
729
729
730 $ hg status --rev 'desc("base")'
730 $ hg status --rev 'desc("base")'
731 M content1_content1_content3-tracked
731 M content1_content1_content3-tracked
732 M content1_content2_content2-tracked
732 M content1_content2_content2-tracked
733 M content1_content2_content3-tracked
733 M content1_content2_content3-tracked
734 M content1_missing_content3-tracked
734 M content1_missing_content3-tracked
735 A missing_content2_content2-tracked
735 A missing_content2_content2-tracked
736 A missing_content2_content3-tracked
736 A missing_content2_content3-tracked
737 A missing_missing_content3-tracked
737 A missing_missing_content3-tracked
738 R content1_content1_content1-untracked
738 R content1_content1_content1-untracked
739 R content1_content1_content3-untracked
739 R content1_content1_content3-untracked
740 R content1_content1_missing-untracked
740 R content1_content1_missing-untracked
741 R content1_content2_content1-untracked
741 R content1_content2_content1-untracked
742 R content1_content2_content2-untracked
742 R content1_content2_content2-untracked
743 R content1_content2_content3-untracked
743 R content1_content2_content3-untracked
744 R content1_content2_missing-untracked
744 R content1_content2_missing-untracked
745 R content1_missing_content1-untracked
745 R content1_missing_content1-untracked
746 R content1_missing_content3-untracked
746 R content1_missing_content3-untracked
747 R content1_missing_missing-untracked
747 R content1_missing_missing-untracked
748 ! content1_content1_missing-tracked
748 ! content1_content1_missing-tracked
749 ! content1_content2_missing-tracked
749 ! content1_content2_missing-tracked
750 ! content1_missing_missing-tracked
750 ! content1_missing_missing-tracked
751 ! missing_content2_missing-tracked
751 ! missing_content2_missing-tracked
752 ! missing_missing_missing-tracked
752 ! missing_missing_missing-tracked
753 ? missing_missing_content3-untracked
753 ? missing_missing_content3-untracked
754
754
755 (create a simple text version of the content)
755 (create a simple text version of the content)
756
756
757 $ python ../dircontent.py > ../content-wc.txt
757 $ python ../dircontent.py > ../content-wc.txt
758 $ cat ../content-wc.txt
758 $ cat ../content-wc.txt
759 content1 content1_content1_content1-tracked
759 content1 content1_content1_content1-tracked
760 content1 content1_content1_content1-untracked
760 content1 content1_content1_content1-untracked
761 content3 content1_content1_content3-tracked
761 content3 content1_content1_content3-tracked
762 content3 content1_content1_content3-untracked
762 content3 content1_content1_content3-untracked
763 content1 content1_content2_content1-tracked
763 content1 content1_content2_content1-tracked
764 content1 content1_content2_content1-untracked
764 content1 content1_content2_content1-untracked
765 content2 content1_content2_content2-tracked
765 content2 content1_content2_content2-tracked
766 content2 content1_content2_content2-untracked
766 content2 content1_content2_content2-untracked
767 content3 content1_content2_content3-tracked
767 content3 content1_content2_content3-tracked
768 content3 content1_content2_content3-untracked
768 content3 content1_content2_content3-untracked
769 content1 content1_missing_content1-tracked
769 content1 content1_missing_content1-tracked
770 content1 content1_missing_content1-untracked
770 content1 content1_missing_content1-untracked
771 content3 content1_missing_content3-tracked
771 content3 content1_missing_content3-tracked
772 content3 content1_missing_content3-untracked
772 content3 content1_missing_content3-untracked
773 content2 missing_content2_content2-tracked
773 content2 missing_content2_content2-tracked
774 content2 missing_content2_content2-untracked
774 content2 missing_content2_content2-untracked
775 content3 missing_content2_content3-tracked
775 content3 missing_content2_content3-tracked
776 content3 missing_content2_content3-untracked
776 content3 missing_content2_content3-untracked
777 content3 missing_missing_content3-tracked
777 content3 missing_missing_content3-tracked
778 content3 missing_missing_content3-untracked
778 content3 missing_missing_content3-untracked
779
779
780 $ cd ..
780 $ cd ..
781
781
782 Test revert --all to parent content
782 Test revert --all to parent content
783 -----------------------------------
783 -----------------------------------
784
784
785 (setup from reference repo)
785 (setup from reference repo)
786
786
787 $ cp -r revert-ref revert-parent-all
787 $ cp -R revert-ref revert-parent-all
788 $ cd revert-parent-all
788 $ cd revert-parent-all
789
789
790 check revert output
790 check revert output
791
791
792 $ hg revert --all
792 $ hg revert --all
793 undeleting content1_content1_content1-untracked
793 undeleting content1_content1_content1-untracked
794 reverting content1_content1_content3-tracked
794 reverting content1_content1_content3-tracked
795 undeleting content1_content1_content3-untracked
795 undeleting content1_content1_content3-untracked
796 reverting content1_content1_missing-tracked
796 reverting content1_content1_missing-tracked
797 undeleting content1_content1_missing-untracked
797 undeleting content1_content1_missing-untracked
798 reverting content1_content2_content1-tracked
798 reverting content1_content2_content1-tracked
799 undeleting content1_content2_content1-untracked
799 undeleting content1_content2_content1-untracked
800 undeleting content1_content2_content2-untracked
800 undeleting content1_content2_content2-untracked
801 reverting content1_content2_content3-tracked
801 reverting content1_content2_content3-tracked
802 undeleting content1_content2_content3-untracked
802 undeleting content1_content2_content3-untracked
803 reverting content1_content2_missing-tracked
803 reverting content1_content2_missing-tracked
804 undeleting content1_content2_missing-untracked
804 undeleting content1_content2_missing-untracked
805 forgetting content1_missing_content1-tracked
805 forgetting content1_missing_content1-tracked
806 forgetting content1_missing_content3-tracked
806 forgetting content1_missing_content3-tracked
807 forgetting content1_missing_missing-tracked
807 forgetting content1_missing_missing-tracked
808 undeleting missing_content2_content2-untracked
808 undeleting missing_content2_content2-untracked
809 reverting missing_content2_content3-tracked
809 reverting missing_content2_content3-tracked
810 undeleting missing_content2_content3-untracked
810 undeleting missing_content2_content3-untracked
811 reverting missing_content2_missing-tracked
811 reverting missing_content2_missing-tracked
812 undeleting missing_content2_missing-untracked
812 undeleting missing_content2_missing-untracked
813 forgetting missing_missing_content3-tracked
813 forgetting missing_missing_content3-tracked
814 forgetting missing_missing_missing-tracked
814 forgetting missing_missing_missing-tracked
815
815
816 Compare resulting directory with revert target.
816 Compare resulting directory with revert target.
817
817
818 The diff is filtered to include change only. The only difference should be
818 The diff is filtered to include change only. The only difference should be
819 additional `.orig` backup file when applicable.
819 additional `.orig` backup file when applicable.
820
820
821 $ python ../dircontent.py > ../content-parent-all.txt
821 $ python ../dircontent.py > ../content-parent-all.txt
822 $ cd ..
822 $ cd ..
823 $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _
823 $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _
824 +content3 content1_content1_content3-tracked.orig
824 +content3 content1_content1_content3-tracked.orig
825 +content3 content1_content1_content3-untracked.orig
825 +content3 content1_content1_content3-untracked.orig
826 +content1 content1_content2_content1-tracked.orig
826 +content1 content1_content2_content1-tracked.orig
827 +content1 content1_content2_content1-untracked.orig
827 +content1 content1_content2_content1-untracked.orig
828 +content3 content1_content2_content3-tracked.orig
828 +content3 content1_content2_content3-tracked.orig
829 +content3 content1_content2_content3-untracked.orig
829 +content3 content1_content2_content3-untracked.orig
830 +content1 content1_missing_content1-tracked
830 +content1 content1_missing_content1-tracked
831 +content1 content1_missing_content1-untracked
831 +content1 content1_missing_content1-untracked
832 +content3 content1_missing_content3-tracked
832 +content3 content1_missing_content3-tracked
833 +content3 content1_missing_content3-untracked
833 +content3 content1_missing_content3-untracked
834 +content3 missing_content2_content3-tracked.orig
834 +content3 missing_content2_content3-tracked.orig
835 +content3 missing_content2_content3-untracked.orig
835 +content3 missing_content2_content3-untracked.orig
836 +content3 missing_missing_content3-tracked
836 +content3 missing_missing_content3-tracked
837 +content3 missing_missing_content3-untracked
837 +content3 missing_missing_content3-untracked
838
838
839 Test revert --all to "base" content
839 Test revert --all to "base" content
840 -----------------------------------
840 -----------------------------------
841
841
842 (setup from reference repo)
842 (setup from reference repo)
843
843
844 $ cp -r revert-ref revert-base-all
844 $ cp -R revert-ref revert-base-all
845 $ cd revert-base-all
845 $ cd revert-base-all
846
846
847 check revert output
847 check revert output
848
848
849 $ hg revert --all --rev 'desc(base)'
849 $ hg revert --all --rev 'desc(base)'
850 undeleting content1_content1_content1-untracked
850 undeleting content1_content1_content1-untracked
851 reverting content1_content1_content3-tracked
851 reverting content1_content1_content3-tracked
852 undeleting content1_content1_content3-untracked
852 undeleting content1_content1_content3-untracked
853 reverting content1_content1_missing-tracked
853 reverting content1_content1_missing-tracked
854 undeleting content1_content1_missing-untracked
854 undeleting content1_content1_missing-untracked
855 undeleting content1_content2_content1-untracked
855 undeleting content1_content2_content1-untracked
856 reverting content1_content2_content2-tracked
856 reverting content1_content2_content2-tracked
857 undeleting content1_content2_content2-untracked
857 undeleting content1_content2_content2-untracked
858 reverting content1_content2_content3-tracked
858 reverting content1_content2_content3-tracked
859 undeleting content1_content2_content3-untracked
859 undeleting content1_content2_content3-untracked
860 reverting content1_content2_missing-tracked
860 reverting content1_content2_missing-tracked
861 undeleting content1_content2_missing-untracked
861 undeleting content1_content2_missing-untracked
862 adding content1_missing_content1-untracked
862 adding content1_missing_content1-untracked
863 reverting content1_missing_content3-tracked
863 reverting content1_missing_content3-tracked
864 adding content1_missing_content3-untracked
864 adding content1_missing_content3-untracked
865 reverting content1_missing_missing-tracked
865 reverting content1_missing_missing-tracked
866 adding content1_missing_missing-untracked
866 adding content1_missing_missing-untracked
867 removing missing_content2_content2-tracked
867 removing missing_content2_content2-tracked
868 removing missing_content2_content3-tracked
868 removing missing_content2_content3-tracked
869 removing missing_content2_missing-tracked
869 removing missing_content2_missing-tracked
870 forgetting missing_missing_content3-tracked
870 forgetting missing_missing_content3-tracked
871 forgetting missing_missing_missing-tracked
871 forgetting missing_missing_missing-tracked
872
872
873 Compare resulting directory with revert target.
873 Compare resulting directory with revert target.
874
874
875 The diff is filtered to include change only. The only difference should be
875 The diff is filtered to include change only. The only difference should be
876 additional `.orig` backup file when applicable.
876 additional `.orig` backup file when applicable.
877
877
878 $ python ../dircontent.py > ../content-base-all.txt
878 $ python ../dircontent.py > ../content-base-all.txt
879 $ cd ..
879 $ cd ..
880 $ diff -U 0 -- content-base.txt content-base-all.txt | grep _
880 $ diff -U 0 -- content-base.txt content-base-all.txt | grep _
881 +content3 content1_content1_content3-tracked.orig
881 +content3 content1_content1_content3-tracked.orig
882 +content3 content1_content1_content3-untracked.orig
882 +content3 content1_content1_content3-untracked.orig
883 +content2 content1_content2_content2-untracked.orig
883 +content2 content1_content2_content2-untracked.orig
884 +content3 content1_content2_content3-tracked.orig
884 +content3 content1_content2_content3-tracked.orig
885 +content3 content1_content2_content3-untracked.orig
885 +content3 content1_content2_content3-untracked.orig
886 +content3 content1_missing_content3-tracked.orig
886 +content3 content1_missing_content3-tracked.orig
887 +content3 content1_missing_content3-untracked.orig
887 +content3 content1_missing_content3-untracked.orig
888 +content2 missing_content2_content2-untracked
888 +content2 missing_content2_content2-untracked
889 +content3 missing_content2_content3-tracked.orig
889 +content3 missing_content2_content3-tracked.orig
890 +content3 missing_content2_content3-untracked
890 +content3 missing_content2_content3-untracked
891 +content3 missing_missing_content3-tracked
891 +content3 missing_missing_content3-tracked
892 +content3 missing_missing_content3-untracked
892 +content3 missing_missing_content3-untracked
893
893
894 Test revert to parent content with explicit file name
894 Test revert to parent content with explicit file name
895 -----------------------------------------------------
895 -----------------------------------------------------
896
896
897 (setup from reference repo)
897 (setup from reference repo)
898
898
899 $ cp -r revert-ref revert-parent-explicit
899 $ cp -R revert-ref revert-parent-explicit
900 $ cd revert-parent-explicit
900 $ cd revert-parent-explicit
901
901
902 revert all files individually and check the output
902 revert all files individually and check the output
903 (output is expected to be different than in the --all case)
903 (output is expected to be different than in the --all case)
904
904
905 $ for file in `python $TESTDIR/generate-working-copy-states.py filelist 2`; do
905 $ for file in `python $TESTDIR/generate-working-copy-states.py filelist 2`; do
906 > echo '### revert for:' $file;
906 > echo '### revert for:' $file;
907 > hg revert $file;
907 > hg revert $file;
908 > echo
908 > echo
909 > done
909 > done
910 ### revert for: content1_content1_content1-tracked
910 ### revert for: content1_content1_content1-tracked
911 no changes needed to content1_content1_content1-tracked
911 no changes needed to content1_content1_content1-tracked
912
912
913 ### revert for: content1_content1_content1-untracked
913 ### revert for: content1_content1_content1-untracked
914
914
915 ### revert for: content1_content1_content3-tracked
915 ### revert for: content1_content1_content3-tracked
916
916
917 ### revert for: content1_content1_content3-untracked
917 ### revert for: content1_content1_content3-untracked
918
918
919 ### revert for: content1_content1_missing-tracked
919 ### revert for: content1_content1_missing-tracked
920
920
921 ### revert for: content1_content1_missing-untracked
921 ### revert for: content1_content1_missing-untracked
922
922
923 ### revert for: content1_content2_content1-tracked
923 ### revert for: content1_content2_content1-tracked
924
924
925 ### revert for: content1_content2_content1-untracked
925 ### revert for: content1_content2_content1-untracked
926
926
927 ### revert for: content1_content2_content2-tracked
927 ### revert for: content1_content2_content2-tracked
928 no changes needed to content1_content2_content2-tracked
928 no changes needed to content1_content2_content2-tracked
929
929
930 ### revert for: content1_content2_content2-untracked
930 ### revert for: content1_content2_content2-untracked
931
931
932 ### revert for: content1_content2_content3-tracked
932 ### revert for: content1_content2_content3-tracked
933
933
934 ### revert for: content1_content2_content3-untracked
934 ### revert for: content1_content2_content3-untracked
935
935
936 ### revert for: content1_content2_missing-tracked
936 ### revert for: content1_content2_missing-tracked
937
937
938 ### revert for: content1_content2_missing-untracked
938 ### revert for: content1_content2_missing-untracked
939
939
940 ### revert for: content1_missing_content1-tracked
940 ### revert for: content1_missing_content1-tracked
941
941
942 ### revert for: content1_missing_content1-untracked
942 ### revert for: content1_missing_content1-untracked
943 file not managed: content1_missing_content1-untracked
943 file not managed: content1_missing_content1-untracked
944
944
945 ### revert for: content1_missing_content3-tracked
945 ### revert for: content1_missing_content3-tracked
946
946
947 ### revert for: content1_missing_content3-untracked
947 ### revert for: content1_missing_content3-untracked
948 file not managed: content1_missing_content3-untracked
948 file not managed: content1_missing_content3-untracked
949
949
950 ### revert for: content1_missing_missing-tracked
950 ### revert for: content1_missing_missing-tracked
951
951
952 ### revert for: content1_missing_missing-untracked
952 ### revert for: content1_missing_missing-untracked
953 content1_missing_missing-untracked: no such file in rev * (glob)
953 content1_missing_missing-untracked: no such file in rev * (glob)
954
954
955 ### revert for: missing_content2_content2-tracked
955 ### revert for: missing_content2_content2-tracked
956 no changes needed to missing_content2_content2-tracked
956 no changes needed to missing_content2_content2-tracked
957
957
958 ### revert for: missing_content2_content2-untracked
958 ### revert for: missing_content2_content2-untracked
959
959
960 ### revert for: missing_content2_content3-tracked
960 ### revert for: missing_content2_content3-tracked
961
961
962 ### revert for: missing_content2_content3-untracked
962 ### revert for: missing_content2_content3-untracked
963
963
964 ### revert for: missing_content2_missing-tracked
964 ### revert for: missing_content2_missing-tracked
965
965
966 ### revert for: missing_content2_missing-untracked
966 ### revert for: missing_content2_missing-untracked
967
967
968 ### revert for: missing_missing_content3-tracked
968 ### revert for: missing_missing_content3-tracked
969
969
970 ### revert for: missing_missing_content3-untracked
970 ### revert for: missing_missing_content3-untracked
971 file not managed: missing_missing_content3-untracked
971 file not managed: missing_missing_content3-untracked
972
972
973 ### revert for: missing_missing_missing-tracked
973 ### revert for: missing_missing_missing-tracked
974
974
975 ### revert for: missing_missing_missing-untracked
975 ### revert for: missing_missing_missing-untracked
976 missing_missing_missing-untracked: no such file in rev * (glob)
976 missing_missing_missing-untracked: no such file in rev * (glob)
977
977
978
978
979 check resulting directory against the --all run
979 check resulting directory against the --all run
980 (There should be no difference)
980 (There should be no difference)
981
981
982 $ python ../dircontent.py > ../content-parent-explicit.txt
982 $ python ../dircontent.py > ../content-parent-explicit.txt
983 $ cd ..
983 $ cd ..
984 $ diff -U 0 -- content-parent-all.txt content-parent-explicit.txt | grep _
984 $ diff -U 0 -- content-parent-all.txt content-parent-explicit.txt | grep _
985 [1]
985 [1]
986
986
987 Test revert to "base" content with explicit file name
987 Test revert to "base" content with explicit file name
988 -----------------------------------------------------
988 -----------------------------------------------------
989
989
990 (setup from reference repo)
990 (setup from reference repo)
991
991
992 $ cp -r revert-ref revert-base-explicit
992 $ cp -R revert-ref revert-base-explicit
993 $ cd revert-base-explicit
993 $ cd revert-base-explicit
994
994
995 revert all files individually and check the output
995 revert all files individually and check the output
996 (output is expected to be different than in the --all case)
996 (output is expected to be different than in the --all case)
997
997
998 $ for file in `python $TESTDIR/generate-working-copy-states.py filelist 2`; do
998 $ for file in `python $TESTDIR/generate-working-copy-states.py filelist 2`; do
999 > echo '### revert for:' $file;
999 > echo '### revert for:' $file;
1000 > hg revert $file --rev 'desc(base)';
1000 > hg revert $file --rev 'desc(base)';
1001 > echo
1001 > echo
1002 > done
1002 > done
1003 ### revert for: content1_content1_content1-tracked
1003 ### revert for: content1_content1_content1-tracked
1004 no changes needed to content1_content1_content1-tracked
1004 no changes needed to content1_content1_content1-tracked
1005
1005
1006 ### revert for: content1_content1_content1-untracked
1006 ### revert for: content1_content1_content1-untracked
1007
1007
1008 ### revert for: content1_content1_content3-tracked
1008 ### revert for: content1_content1_content3-tracked
1009
1009
1010 ### revert for: content1_content1_content3-untracked
1010 ### revert for: content1_content1_content3-untracked
1011
1011
1012 ### revert for: content1_content1_missing-tracked
1012 ### revert for: content1_content1_missing-tracked
1013
1013
1014 ### revert for: content1_content1_missing-untracked
1014 ### revert for: content1_content1_missing-untracked
1015
1015
1016 ### revert for: content1_content2_content1-tracked
1016 ### revert for: content1_content2_content1-tracked
1017 no changes needed to content1_content2_content1-tracked
1017 no changes needed to content1_content2_content1-tracked
1018
1018
1019 ### revert for: content1_content2_content1-untracked
1019 ### revert for: content1_content2_content1-untracked
1020
1020
1021 ### revert for: content1_content2_content2-tracked
1021 ### revert for: content1_content2_content2-tracked
1022
1022
1023 ### revert for: content1_content2_content2-untracked
1023 ### revert for: content1_content2_content2-untracked
1024
1024
1025 ### revert for: content1_content2_content3-tracked
1025 ### revert for: content1_content2_content3-tracked
1026
1026
1027 ### revert for: content1_content2_content3-untracked
1027 ### revert for: content1_content2_content3-untracked
1028
1028
1029 ### revert for: content1_content2_missing-tracked
1029 ### revert for: content1_content2_missing-tracked
1030
1030
1031 ### revert for: content1_content2_missing-untracked
1031 ### revert for: content1_content2_missing-untracked
1032
1032
1033 ### revert for: content1_missing_content1-tracked
1033 ### revert for: content1_missing_content1-tracked
1034 no changes needed to content1_missing_content1-tracked
1034 no changes needed to content1_missing_content1-tracked
1035
1035
1036 ### revert for: content1_missing_content1-untracked
1036 ### revert for: content1_missing_content1-untracked
1037
1037
1038 ### revert for: content1_missing_content3-tracked
1038 ### revert for: content1_missing_content3-tracked
1039
1039
1040 ### revert for: content1_missing_content3-untracked
1040 ### revert for: content1_missing_content3-untracked
1041
1041
1042 ### revert for: content1_missing_missing-tracked
1042 ### revert for: content1_missing_missing-tracked
1043
1043
1044 ### revert for: content1_missing_missing-untracked
1044 ### revert for: content1_missing_missing-untracked
1045
1045
1046 ### revert for: missing_content2_content2-tracked
1046 ### revert for: missing_content2_content2-tracked
1047
1047
1048 ### revert for: missing_content2_content2-untracked
1048 ### revert for: missing_content2_content2-untracked
1049 no changes needed to missing_content2_content2-untracked
1049 no changes needed to missing_content2_content2-untracked
1050
1050
1051 ### revert for: missing_content2_content3-tracked
1051 ### revert for: missing_content2_content3-tracked
1052
1052
1053 ### revert for: missing_content2_content3-untracked
1053 ### revert for: missing_content2_content3-untracked
1054 no changes needed to missing_content2_content3-untracked
1054 no changes needed to missing_content2_content3-untracked
1055
1055
1056 ### revert for: missing_content2_missing-tracked
1056 ### revert for: missing_content2_missing-tracked
1057
1057
1058 ### revert for: missing_content2_missing-untracked
1058 ### revert for: missing_content2_missing-untracked
1059 no changes needed to missing_content2_missing-untracked
1059 no changes needed to missing_content2_missing-untracked
1060
1060
1061 ### revert for: missing_missing_content3-tracked
1061 ### revert for: missing_missing_content3-tracked
1062
1062
1063 ### revert for: missing_missing_content3-untracked
1063 ### revert for: missing_missing_content3-untracked
1064 file not managed: missing_missing_content3-untracked
1064 file not managed: missing_missing_content3-untracked
1065
1065
1066 ### revert for: missing_missing_missing-tracked
1066 ### revert for: missing_missing_missing-tracked
1067
1067
1068 ### revert for: missing_missing_missing-untracked
1068 ### revert for: missing_missing_missing-untracked
1069 missing_missing_missing-untracked: no such file in rev * (glob)
1069 missing_missing_missing-untracked: no such file in rev * (glob)
1070
1070
1071
1071
1072 check resulting directory against the --all run
1072 check resulting directory against the --all run
1073 (There should be no difference)
1073 (There should be no difference)
1074
1074
1075 $ python ../dircontent.py > ../content-base-explicit.txt
1075 $ python ../dircontent.py > ../content-base-explicit.txt
1076 $ cd ..
1076 $ cd ..
1077 $ diff -U 0 -- content-base-all.txt content-base-explicit.txt | grep _
1077 $ diff -U 0 -- content-base-all.txt content-base-explicit.txt | grep _
1078 [1]
1078 [1]
1079
1079
1080 Revert to an ancestor of P2 during a merge (issue5052)
1080 Revert to an ancestor of P2 during a merge (issue5052)
1081 -----------------------------------------------------
1081 -----------------------------------------------------
1082
1082
1083 (prepare the repository)
1083 (prepare the repository)
1084
1084
1085 $ hg init issue5052
1085 $ hg init issue5052
1086 $ cd issue5052
1086 $ cd issue5052
1087 $ echo '.\.orig' > .hgignore
1087 $ echo '.\.orig' > .hgignore
1088 $ echo 0 > root
1088 $ echo 0 > root
1089 $ hg ci -qAm C0
1089 $ hg ci -qAm C0
1090 $ echo 0 > A
1090 $ echo 0 > A
1091 $ hg ci -qAm C1
1091 $ hg ci -qAm C1
1092 $ echo 1 >> A
1092 $ echo 1 >> A
1093 $ hg ci -qm C2
1093 $ hg ci -qm C2
1094 $ hg up -q 0
1094 $ hg up -q 0
1095 $ echo 1 > B
1095 $ echo 1 > B
1096 $ hg ci -qAm C3
1096 $ hg ci -qAm C3
1097 $ hg status --rev 'ancestor(.,2)' --rev 2
1097 $ hg status --rev 'ancestor(.,2)' --rev 2
1098 A A
1098 A A
1099 $ hg log -G -T '{rev} ({files})\n'
1099 $ hg log -G -T '{rev} ({files})\n'
1100 @ 3 (B)
1100 @ 3 (B)
1101 |
1101 |
1102 | o 2 (A)
1102 | o 2 (A)
1103 | |
1103 | |
1104 | o 1 (A)
1104 | o 1 (A)
1105 |/
1105 |/
1106 o 0 (.hgignore root)
1106 o 0 (.hgignore root)
1107
1107
1108
1108
1109 actual tests: reverting to something else than a merge parent
1109 actual tests: reverting to something else than a merge parent
1110
1110
1111 $ hg merge
1111 $ hg merge
1112 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1112 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1113 (branch merge, don't forget to commit)
1113 (branch merge, don't forget to commit)
1114
1114
1115 $ hg status --rev 'p1()'
1115 $ hg status --rev 'p1()'
1116 M A
1116 M A
1117 $ hg status --rev 'p2()'
1117 $ hg status --rev 'p2()'
1118 A B
1118 A B
1119 $ hg status --rev '1'
1119 $ hg status --rev '1'
1120 M A
1120 M A
1121 A B
1121 A B
1122 $ hg revert --rev 1 --all
1122 $ hg revert --rev 1 --all
1123 reverting A
1123 reverting A
1124 removing B
1124 removing B
1125 $ hg status --rev 1
1125 $ hg status --rev 1
1126
1126
1127 From the other parents
1127 From the other parents
1128
1128
1129 $ hg up -C 'p2()'
1129 $ hg up -C 'p2()'
1130 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1130 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1131 $ hg merge
1131 $ hg merge
1132 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1132 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1133 (branch merge, don't forget to commit)
1133 (branch merge, don't forget to commit)
1134
1134
1135 $ hg status --rev 'p1()'
1135 $ hg status --rev 'p1()'
1136 M B
1136 M B
1137 $ hg status --rev 'p2()'
1137 $ hg status --rev 'p2()'
1138 A A
1138 A A
1139 $ hg status --rev '1'
1139 $ hg status --rev '1'
1140 M A
1140 M A
1141 A B
1141 A B
1142 $ hg revert --rev 1 --all
1142 $ hg revert --rev 1 --all
1143 reverting A
1143 reverting A
1144 removing B
1144 removing B
1145 $ hg status --rev 1
1145 $ hg status --rev 1
1146
1146
1147 $ cd ..
1147 $ cd ..
@@ -1,1778 +1,1778 b''
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
2
2
3 $ echo "[ui]" >> $HGRCPATH
3 $ echo "[ui]" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
5
5
6 $ hg init t
6 $ hg init t
7 $ cd t
7 $ cd t
8
8
9 first revision, no sub
9 first revision, no sub
10
10
11 $ echo a > a
11 $ echo a > a
12 $ hg ci -Am0
12 $ hg ci -Am0
13 adding a
13 adding a
14
14
15 add first sub
15 add first sub
16
16
17 $ echo s = s > .hgsub
17 $ echo s = s > .hgsub
18 $ hg add .hgsub
18 $ hg add .hgsub
19 $ hg init s
19 $ hg init s
20 $ echo a > s/a
20 $ echo a > s/a
21
21
22 Issue2232: committing a subrepo without .hgsub
22 Issue2232: committing a subrepo without .hgsub
23
23
24 $ hg ci -mbad s
24 $ hg ci -mbad s
25 abort: can't commit subrepos without .hgsub
25 abort: can't commit subrepos without .hgsub
26 [255]
26 [255]
27
27
28 $ hg -R s add s/a
28 $ hg -R s add s/a
29 $ hg files -S
29 $ hg files -S
30 .hgsub
30 .hgsub
31 a
31 a
32 s/a (glob)
32 s/a (glob)
33
33
34 $ hg -R s ci -Ams0
34 $ hg -R s ci -Ams0
35 $ hg sum
35 $ hg sum
36 parent: 0:f7b1eb17ad24 tip
36 parent: 0:f7b1eb17ad24 tip
37 0
37 0
38 branch: default
38 branch: default
39 commit: 1 added, 1 subrepos
39 commit: 1 added, 1 subrepos
40 update: (current)
40 update: (current)
41 phases: 1 draft
41 phases: 1 draft
42 $ hg ci -m1
42 $ hg ci -m1
43
43
44 test handling .hgsubstate "added" explicitly.
44 test handling .hgsubstate "added" explicitly.
45
45
46 $ hg parents --template '{node}\n{files}\n'
46 $ hg parents --template '{node}\n{files}\n'
47 7cf8cfea66e410e8e3336508dfeec07b3192de51
47 7cf8cfea66e410e8e3336508dfeec07b3192de51
48 .hgsub .hgsubstate
48 .hgsub .hgsubstate
49 $ hg rollback -q
49 $ hg rollback -q
50 $ hg add .hgsubstate
50 $ hg add .hgsubstate
51 $ hg ci -m1
51 $ hg ci -m1
52 $ hg parents --template '{node}\n{files}\n'
52 $ hg parents --template '{node}\n{files}\n'
53 7cf8cfea66e410e8e3336508dfeec07b3192de51
53 7cf8cfea66e410e8e3336508dfeec07b3192de51
54 .hgsub .hgsubstate
54 .hgsub .hgsubstate
55
55
56 Subrepopath which overlaps with filepath, does not change warnings in remove()
56 Subrepopath which overlaps with filepath, does not change warnings in remove()
57
57
58 $ mkdir snot
58 $ mkdir snot
59 $ touch snot/file
59 $ touch snot/file
60 $ hg remove -S snot/file
60 $ hg remove -S snot/file
61 not removing snot/file: file is untracked
61 not removing snot/file: file is untracked
62 [1]
62 [1]
63 $ hg cat snot/filenot
63 $ hg cat snot/filenot
64 snot/filenot: no such file in rev 7cf8cfea66e4
64 snot/filenot: no such file in rev 7cf8cfea66e4
65 [1]
65 [1]
66 $ rm -r snot
66 $ rm -r snot
67
67
68 Revert subrepo and test subrepo fileset keyword:
68 Revert subrepo and test subrepo fileset keyword:
69
69
70 $ echo b > s/a
70 $ echo b > s/a
71 $ hg revert --dry-run "set:subrepo('glob:s*')"
71 $ hg revert --dry-run "set:subrepo('glob:s*')"
72 reverting subrepo s
72 reverting subrepo s
73 reverting s/a (glob)
73 reverting s/a (glob)
74 $ cat s/a
74 $ cat s/a
75 b
75 b
76 $ hg revert "set:subrepo('glob:s*')"
76 $ hg revert "set:subrepo('glob:s*')"
77 reverting subrepo s
77 reverting subrepo s
78 reverting s/a (glob)
78 reverting s/a (glob)
79 $ cat s/a
79 $ cat s/a
80 a
80 a
81 $ rm s/a.orig
81 $ rm s/a.orig
82
82
83 Revert subrepo with no backup. The "reverting s/a" line is gone since
83 Revert subrepo with no backup. The "reverting s/a" line is gone since
84 we're really running 'hg update' in the subrepo:
84 we're really running 'hg update' in the subrepo:
85
85
86 $ echo b > s/a
86 $ echo b > s/a
87 $ hg revert --no-backup s
87 $ hg revert --no-backup s
88 reverting subrepo s
88 reverting subrepo s
89
89
90 Issue2022: update -C
90 Issue2022: update -C
91
91
92 $ echo b > s/a
92 $ echo b > s/a
93 $ hg sum
93 $ hg sum
94 parent: 1:7cf8cfea66e4 tip
94 parent: 1:7cf8cfea66e4 tip
95 1
95 1
96 branch: default
96 branch: default
97 commit: 1 subrepos
97 commit: 1 subrepos
98 update: (current)
98 update: (current)
99 phases: 2 draft
99 phases: 2 draft
100 $ hg co -C 1
100 $ hg co -C 1
101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 $ hg sum
102 $ hg sum
103 parent: 1:7cf8cfea66e4 tip
103 parent: 1:7cf8cfea66e4 tip
104 1
104 1
105 branch: default
105 branch: default
106 commit: (clean)
106 commit: (clean)
107 update: (current)
107 update: (current)
108 phases: 2 draft
108 phases: 2 draft
109
109
110 commands that require a clean repo should respect subrepos
110 commands that require a clean repo should respect subrepos
111
111
112 $ echo b >> s/a
112 $ echo b >> s/a
113 $ hg backout tip
113 $ hg backout tip
114 abort: uncommitted changes in subrepository 's'
114 abort: uncommitted changes in subrepository 's'
115 [255]
115 [255]
116 $ hg revert -C -R s s/a
116 $ hg revert -C -R s s/a
117
117
118 add sub sub
118 add sub sub
119
119
120 $ echo ss = ss > s/.hgsub
120 $ echo ss = ss > s/.hgsub
121 $ hg init s/ss
121 $ hg init s/ss
122 $ echo a > s/ss/a
122 $ echo a > s/ss/a
123 $ hg -R s add s/.hgsub
123 $ hg -R s add s/.hgsub
124 $ hg -R s/ss add s/ss/a
124 $ hg -R s/ss add s/ss/a
125 $ hg sum
125 $ hg sum
126 parent: 1:7cf8cfea66e4 tip
126 parent: 1:7cf8cfea66e4 tip
127 1
127 1
128 branch: default
128 branch: default
129 commit: 1 subrepos
129 commit: 1 subrepos
130 update: (current)
130 update: (current)
131 phases: 2 draft
131 phases: 2 draft
132 $ hg ci -m2
132 $ hg ci -m2
133 committing subrepository s
133 committing subrepository s
134 committing subrepository s/ss (glob)
134 committing subrepository s/ss (glob)
135 $ hg sum
135 $ hg sum
136 parent: 2:df30734270ae tip
136 parent: 2:df30734270ae tip
137 2
137 2
138 branch: default
138 branch: default
139 commit: (clean)
139 commit: (clean)
140 update: (current)
140 update: (current)
141 phases: 3 draft
141 phases: 3 draft
142
142
143 test handling .hgsubstate "modified" explicitly.
143 test handling .hgsubstate "modified" explicitly.
144
144
145 $ hg parents --template '{node}\n{files}\n'
145 $ hg parents --template '{node}\n{files}\n'
146 df30734270ae757feb35e643b7018e818e78a9aa
146 df30734270ae757feb35e643b7018e818e78a9aa
147 .hgsubstate
147 .hgsubstate
148 $ hg rollback -q
148 $ hg rollback -q
149 $ hg status -A .hgsubstate
149 $ hg status -A .hgsubstate
150 M .hgsubstate
150 M .hgsubstate
151 $ hg ci -m2
151 $ hg ci -m2
152 $ hg parents --template '{node}\n{files}\n'
152 $ hg parents --template '{node}\n{files}\n'
153 df30734270ae757feb35e643b7018e818e78a9aa
153 df30734270ae757feb35e643b7018e818e78a9aa
154 .hgsubstate
154 .hgsubstate
155
155
156 bump sub rev (and check it is ignored by ui.commitsubrepos)
156 bump sub rev (and check it is ignored by ui.commitsubrepos)
157
157
158 $ echo b > s/a
158 $ echo b > s/a
159 $ hg -R s ci -ms1
159 $ hg -R s ci -ms1
160 $ hg --config ui.commitsubrepos=no ci -m3
160 $ hg --config ui.commitsubrepos=no ci -m3
161
161
162 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
162 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
163
163
164 $ echo c > s/a
164 $ echo c > s/a
165 $ hg --config ui.commitsubrepos=no ci -m4
165 $ hg --config ui.commitsubrepos=no ci -m4
166 abort: uncommitted changes in subrepository 's'
166 abort: uncommitted changes in subrepository 's'
167 (use --subrepos for recursive commit)
167 (use --subrepos for recursive commit)
168 [255]
168 [255]
169 $ hg id
169 $ hg id
170 f6affe3fbfaa+ tip
170 f6affe3fbfaa+ tip
171 $ hg -R s ci -mc
171 $ hg -R s ci -mc
172 $ hg id
172 $ hg id
173 f6affe3fbfaa+ tip
173 f6affe3fbfaa+ tip
174 $ echo d > s/a
174 $ echo d > s/a
175 $ hg ci -m4
175 $ hg ci -m4
176 committing subrepository s
176 committing subrepository s
177 $ hg tip -R s
177 $ hg tip -R s
178 changeset: 4:02dcf1d70411
178 changeset: 4:02dcf1d70411
179 tag: tip
179 tag: tip
180 user: test
180 user: test
181 date: Thu Jan 01 00:00:00 1970 +0000
181 date: Thu Jan 01 00:00:00 1970 +0000
182 summary: 4
182 summary: 4
183
183
184
184
185 check caching
185 check caching
186
186
187 $ hg co 0
187 $ hg co 0
188 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
188 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
189 $ hg debugsub
189 $ hg debugsub
190
190
191 restore
191 restore
192
192
193 $ hg co
193 $ hg co
194 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
195 $ hg debugsub
195 $ hg debugsub
196 path s
196 path s
197 source s
197 source s
198 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
198 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
199
199
200 new branch for merge tests
200 new branch for merge tests
201
201
202 $ hg co 1
202 $ hg co 1
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 $ echo t = t >> .hgsub
204 $ echo t = t >> .hgsub
205 $ hg init t
205 $ hg init t
206 $ echo t > t/t
206 $ echo t > t/t
207 $ hg -R t add t
207 $ hg -R t add t
208 adding t/t (glob)
208 adding t/t (glob)
209
209
210 5
210 5
211
211
212 $ hg ci -m5 # add sub
212 $ hg ci -m5 # add sub
213 committing subrepository t
213 committing subrepository t
214 created new head
214 created new head
215 $ echo t2 > t/t
215 $ echo t2 > t/t
216
216
217 6
217 6
218
218
219 $ hg st -R s
219 $ hg st -R s
220 $ hg ci -m6 # change sub
220 $ hg ci -m6 # change sub
221 committing subrepository t
221 committing subrepository t
222 $ hg debugsub
222 $ hg debugsub
223 path s
223 path s
224 source s
224 source s
225 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
225 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
226 path t
226 path t
227 source t
227 source t
228 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
228 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
229 $ echo t3 > t/t
229 $ echo t3 > t/t
230
230
231 7
231 7
232
232
233 $ hg ci -m7 # change sub again for conflict test
233 $ hg ci -m7 # change sub again for conflict test
234 committing subrepository t
234 committing subrepository t
235 $ hg rm .hgsub
235 $ hg rm .hgsub
236
236
237 8
237 8
238
238
239 $ hg ci -m8 # remove sub
239 $ hg ci -m8 # remove sub
240
240
241 test handling .hgsubstate "removed" explicitly.
241 test handling .hgsubstate "removed" explicitly.
242
242
243 $ hg parents --template '{node}\n{files}\n'
243 $ hg parents --template '{node}\n{files}\n'
244 96615c1dad2dc8e3796d7332c77ce69156f7b78e
244 96615c1dad2dc8e3796d7332c77ce69156f7b78e
245 .hgsub .hgsubstate
245 .hgsub .hgsubstate
246 $ hg rollback -q
246 $ hg rollback -q
247 $ hg remove .hgsubstate
247 $ hg remove .hgsubstate
248 $ hg ci -m8
248 $ hg ci -m8
249 $ hg parents --template '{node}\n{files}\n'
249 $ hg parents --template '{node}\n{files}\n'
250 96615c1dad2dc8e3796d7332c77ce69156f7b78e
250 96615c1dad2dc8e3796d7332c77ce69156f7b78e
251 .hgsub .hgsubstate
251 .hgsub .hgsubstate
252
252
253 merge tests
253 merge tests
254
254
255 $ hg co -C 3
255 $ hg co -C 3
256 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 $ hg merge 5 # test adding
257 $ hg merge 5 # test adding
258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 (branch merge, don't forget to commit)
259 (branch merge, don't forget to commit)
260 $ hg debugsub
260 $ hg debugsub
261 path s
261 path s
262 source s
262 source s
263 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
263 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
264 path t
264 path t
265 source t
265 source t
266 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
266 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
267 $ hg ci -m9
267 $ hg ci -m9
268 created new head
268 created new head
269 $ hg merge 6 --debug # test change
269 $ hg merge 6 --debug # test change
270 searching for copies back to rev 2
270 searching for copies back to rev 2
271 resolving manifests
271 resolving manifests
272 branchmerge: True, force: False, partial: False
272 branchmerge: True, force: False, partial: False
273 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
273 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
274 starting 4 threads for background file closing (?)
274 starting 4 threads for background file closing (?)
275 .hgsubstate: versions differ -> m (premerge)
275 .hgsubstate: versions differ -> m (premerge)
276 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
276 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
277 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
277 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
278 getting subrepo t
278 getting subrepo t
279 resolving manifests
279 resolving manifests
280 branchmerge: False, force: False, partial: False
280 branchmerge: False, force: False, partial: False
281 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
281 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
282 t: remote is newer -> g
282 t: remote is newer -> g
283 getting t
283 getting t
284 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
284 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
285 (branch merge, don't forget to commit)
285 (branch merge, don't forget to commit)
286 $ hg debugsub
286 $ hg debugsub
287 path s
287 path s
288 source s
288 source s
289 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
289 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
290 path t
290 path t
291 source t
291 source t
292 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
292 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
293 $ echo conflict > t/t
293 $ echo conflict > t/t
294 $ hg ci -m10
294 $ hg ci -m10
295 committing subrepository t
295 committing subrepository t
296 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
296 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
297 searching for copies back to rev 2
297 searching for copies back to rev 2
298 resolving manifests
298 resolving manifests
299 branchmerge: True, force: False, partial: False
299 branchmerge: True, force: False, partial: False
300 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
300 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
301 starting 4 threads for background file closing (?)
301 starting 4 threads for background file closing (?)
302 .hgsubstate: versions differ -> m (premerge)
302 .hgsubstate: versions differ -> m (premerge)
303 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
303 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
304 subrepo t: both sides changed
304 subrepo t: both sides changed
305 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
305 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
306 starting 4 threads for background file closing (?)
306 starting 4 threads for background file closing (?)
307 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
307 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
308 merging subrepo t
308 merging subrepo t
309 searching for copies back to rev 2
309 searching for copies back to rev 2
310 resolving manifests
310 resolving manifests
311 branchmerge: True, force: False, partial: False
311 branchmerge: True, force: False, partial: False
312 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
312 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
313 preserving t for resolve of t
313 preserving t for resolve of t
314 t: versions differ -> m (premerge)
314 t: versions differ -> m (premerge)
315 picked tool ':merge' for t (binary False symlink False changedelete False)
315 picked tool ':merge' for t (binary False symlink False changedelete False)
316 merging t
316 merging t
317 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
317 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
318 t: versions differ -> m (merge)
318 t: versions differ -> m (merge)
319 picked tool ':merge' for t (binary False symlink False changedelete False)
319 picked tool ':merge' for t (binary False symlink False changedelete False)
320 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
320 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
321 warning: conflicts while merging t! (edit, then use 'hg resolve --mark')
321 warning: conflicts while merging t! (edit, then use 'hg resolve --mark')
322 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
322 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
323 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
323 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
324 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
324 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
325 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
325 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
326 (branch merge, don't forget to commit)
326 (branch merge, don't forget to commit)
327
327
328 should conflict
328 should conflict
329
329
330 $ cat t/t
330 $ cat t/t
331 <<<<<<< local: 20a0db6fbf6c - test: 10
331 <<<<<<< local: 20a0db6fbf6c - test: 10
332 conflict
332 conflict
333 =======
333 =======
334 t3
334 t3
335 >>>>>>> other: 7af322bc1198 - test: 7
335 >>>>>>> other: 7af322bc1198 - test: 7
336
336
337 11: remove subrepo t
337 11: remove subrepo t
338
338
339 $ hg co -C 5
339 $ hg co -C 5
340 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
340 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 $ hg revert -r 4 .hgsub # remove t
341 $ hg revert -r 4 .hgsub # remove t
342 $ hg ci -m11
342 $ hg ci -m11
343 created new head
343 created new head
344 $ hg debugsub
344 $ hg debugsub
345 path s
345 path s
346 source s
346 source s
347 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
347 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
348
348
349 local removed, remote changed, keep changed
349 local removed, remote changed, keep changed
350
350
351 $ hg merge 6
351 $ hg merge 6
352 remote [merge rev] changed subrepository s which local [working copy] removed
352 remote [merge rev] changed subrepository s which local [working copy] removed
353 use (c)hanged version or (d)elete? c
353 use (c)hanged version or (d)elete? c
354 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
354 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
355 (branch merge, don't forget to commit)
355 (branch merge, don't forget to commit)
356 BROKEN: should include subrepo t
356 BROKEN: should include subrepo t
357 $ hg debugsub
357 $ hg debugsub
358 path s
358 path s
359 source s
359 source s
360 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
360 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
361 $ cat .hgsubstate
361 $ cat .hgsubstate
362 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
362 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
363 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t
363 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t
364 $ hg ci -m 'local removed, remote changed, keep changed'
364 $ hg ci -m 'local removed, remote changed, keep changed'
365 BROKEN: should include subrepo t
365 BROKEN: should include subrepo t
366 $ hg debugsub
366 $ hg debugsub
367 path s
367 path s
368 source s
368 source s
369 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
369 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
370 BROKEN: should include subrepo t
370 BROKEN: should include subrepo t
371 $ cat .hgsubstate
371 $ cat .hgsubstate
372 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
372 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
373 $ cat t/t
373 $ cat t/t
374 t2
374 t2
375
375
376 local removed, remote changed, keep removed
376 local removed, remote changed, keep removed
377
377
378 $ hg co -C 11
378 $ hg co -C 11
379 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
379 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
380 $ hg merge --config ui.interactive=true 6 <<EOF
380 $ hg merge --config ui.interactive=true 6 <<EOF
381 > d
381 > d
382 > EOF
382 > EOF
383 remote [merge rev] changed subrepository s which local [working copy] removed
383 remote [merge rev] changed subrepository s which local [working copy] removed
384 use (c)hanged version or (d)elete? d
384 use (c)hanged version or (d)elete? d
385 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
385 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
386 (branch merge, don't forget to commit)
386 (branch merge, don't forget to commit)
387 $ hg debugsub
387 $ hg debugsub
388 path s
388 path s
389 source s
389 source s
390 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
390 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
391 $ cat .hgsubstate
391 $ cat .hgsubstate
392 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
392 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
393 $ hg ci -m 'local removed, remote changed, keep removed'
393 $ hg ci -m 'local removed, remote changed, keep removed'
394 created new head
394 created new head
395 $ hg debugsub
395 $ hg debugsub
396 path s
396 path s
397 source s
397 source s
398 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
398 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
399 $ cat .hgsubstate
399 $ cat .hgsubstate
400 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
400 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
401
401
402 local changed, remote removed, keep changed
402 local changed, remote removed, keep changed
403
403
404 $ hg co -C 6
404 $ hg co -C 6
405 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
405 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
406 $ hg merge 11
406 $ hg merge 11
407 local [working copy] changed subrepository s which remote [merge rev] removed
407 local [working copy] changed subrepository s which remote [merge rev] removed
408 use (c)hanged version or (d)elete? c
408 use (c)hanged version or (d)elete? c
409 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
409 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
410 (branch merge, don't forget to commit)
410 (branch merge, don't forget to commit)
411 BROKEN: should include subrepo t
411 BROKEN: should include subrepo t
412 $ hg debugsub
412 $ hg debugsub
413 path s
413 path s
414 source s
414 source s
415 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
415 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
416 BROKEN: should include subrepo t
416 BROKEN: should include subrepo t
417 $ cat .hgsubstate
417 $ cat .hgsubstate
418 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
418 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
419 $ hg ci -m 'local changed, remote removed, keep changed'
419 $ hg ci -m 'local changed, remote removed, keep changed'
420 created new head
420 created new head
421 BROKEN: should include subrepo t
421 BROKEN: should include subrepo t
422 $ hg debugsub
422 $ hg debugsub
423 path s
423 path s
424 source s
424 source s
425 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
425 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
426 BROKEN: should include subrepo t
426 BROKEN: should include subrepo t
427 $ cat .hgsubstate
427 $ cat .hgsubstate
428 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
428 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
429 $ cat t/t
429 $ cat t/t
430 t2
430 t2
431
431
432 local changed, remote removed, keep removed
432 local changed, remote removed, keep removed
433
433
434 $ hg co -C 6
434 $ hg co -C 6
435 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
435 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
436 $ hg merge --config ui.interactive=true 11 <<EOF
436 $ hg merge --config ui.interactive=true 11 <<EOF
437 > d
437 > d
438 > EOF
438 > EOF
439 local [working copy] changed subrepository s which remote [merge rev] removed
439 local [working copy] changed subrepository s which remote [merge rev] removed
440 use (c)hanged version or (d)elete? d
440 use (c)hanged version or (d)elete? d
441 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
441 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
442 (branch merge, don't forget to commit)
442 (branch merge, don't forget to commit)
443 $ hg debugsub
443 $ hg debugsub
444 path s
444 path s
445 source s
445 source s
446 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
446 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
447 $ cat .hgsubstate
447 $ cat .hgsubstate
448 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
448 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
449 $ hg ci -m 'local changed, remote removed, keep removed'
449 $ hg ci -m 'local changed, remote removed, keep removed'
450 created new head
450 created new head
451 $ hg debugsub
451 $ hg debugsub
452 path s
452 path s
453 source s
453 source s
454 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
454 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
455 $ cat .hgsubstate
455 $ cat .hgsubstate
456 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
456 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
457
457
458 clean up to avoid having to fix up the tests below
458 clean up to avoid having to fix up the tests below
459
459
460 $ hg co -C 10
460 $ hg co -C 10
461 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
461 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
462 $ cat >> $HGRCPATH <<EOF
462 $ cat >> $HGRCPATH <<EOF
463 > [extensions]
463 > [extensions]
464 > strip=
464 > strip=
465 > EOF
465 > EOF
466 $ hg strip -r 11:15
466 $ hg strip -r 11:15
467 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
467 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
468
468
469 clone
469 clone
470
470
471 $ cd ..
471 $ cd ..
472 $ hg clone t tc
472 $ hg clone t tc
473 updating to branch default
473 updating to branch default
474 cloning subrepo s from $TESTTMP/t/s
474 cloning subrepo s from $TESTTMP/t/s
475 cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
475 cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
476 cloning subrepo t from $TESTTMP/t/t
476 cloning subrepo t from $TESTTMP/t/t
477 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
477 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
478 $ cd tc
478 $ cd tc
479 $ hg debugsub
479 $ hg debugsub
480 path s
480 path s
481 source s
481 source s
482 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
482 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
483 path t
483 path t
484 source t
484 source t
485 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
485 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
486
486
487 push
487 push
488
488
489 $ echo bah > t/t
489 $ echo bah > t/t
490 $ hg ci -m11
490 $ hg ci -m11
491 committing subrepository t
491 committing subrepository t
492 $ hg push
492 $ hg push
493 pushing to $TESTTMP/t (glob)
493 pushing to $TESTTMP/t (glob)
494 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
494 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
495 no changes made to subrepo s since last push to $TESTTMP/t/s
495 no changes made to subrepo s since last push to $TESTTMP/t/s
496 pushing subrepo t to $TESTTMP/t/t
496 pushing subrepo t to $TESTTMP/t/t
497 searching for changes
497 searching for changes
498 adding changesets
498 adding changesets
499 adding manifests
499 adding manifests
500 adding file changes
500 adding file changes
501 added 1 changesets with 1 changes to 1 files
501 added 1 changesets with 1 changes to 1 files
502 searching for changes
502 searching for changes
503 adding changesets
503 adding changesets
504 adding manifests
504 adding manifests
505 adding file changes
505 adding file changes
506 added 1 changesets with 1 changes to 1 files
506 added 1 changesets with 1 changes to 1 files
507
507
508 push -f
508 push -f
509
509
510 $ echo bah > s/a
510 $ echo bah > s/a
511 $ hg ci -m12
511 $ hg ci -m12
512 committing subrepository s
512 committing subrepository s
513 $ hg push
513 $ hg push
514 pushing to $TESTTMP/t (glob)
514 pushing to $TESTTMP/t (glob)
515 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
515 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
516 pushing subrepo s to $TESTTMP/t/s
516 pushing subrepo s to $TESTTMP/t/s
517 searching for changes
517 searching for changes
518 abort: push creates new remote head 12a213df6fa9! (in subrepo s)
518 abort: push creates new remote head 12a213df6fa9! (in subrepo s)
519 (merge or see 'hg help push' for details about pushing new heads)
519 (merge or see 'hg help push' for details about pushing new heads)
520 [255]
520 [255]
521 $ hg push -f
521 $ hg push -f
522 pushing to $TESTTMP/t (glob)
522 pushing to $TESTTMP/t (glob)
523 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
523 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
524 searching for changes
524 searching for changes
525 no changes found
525 no changes found
526 pushing subrepo s to $TESTTMP/t/s
526 pushing subrepo s to $TESTTMP/t/s
527 searching for changes
527 searching for changes
528 adding changesets
528 adding changesets
529 adding manifests
529 adding manifests
530 adding file changes
530 adding file changes
531 added 1 changesets with 1 changes to 1 files (+1 heads)
531 added 1 changesets with 1 changes to 1 files (+1 heads)
532 pushing subrepo t to $TESTTMP/t/t
532 pushing subrepo t to $TESTTMP/t/t
533 searching for changes
533 searching for changes
534 no changes found
534 no changes found
535 searching for changes
535 searching for changes
536 adding changesets
536 adding changesets
537 adding manifests
537 adding manifests
538 adding file changes
538 adding file changes
539 added 1 changesets with 1 changes to 1 files
539 added 1 changesets with 1 changes to 1 files
540
540
541 check that unmodified subrepos are not pushed
541 check that unmodified subrepos are not pushed
542
542
543 $ hg clone . ../tcc
543 $ hg clone . ../tcc
544 updating to branch default
544 updating to branch default
545 cloning subrepo s from $TESTTMP/tc/s
545 cloning subrepo s from $TESTTMP/tc/s
546 cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob)
546 cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob)
547 cloning subrepo t from $TESTTMP/tc/t
547 cloning subrepo t from $TESTTMP/tc/t
548 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
548 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
549
549
550 the subrepos on the new clone have nothing to push to its source
550 the subrepos on the new clone have nothing to push to its source
551
551
552 $ hg push -R ../tcc .
552 $ hg push -R ../tcc .
553 pushing to .
553 pushing to .
554 no changes made to subrepo s/ss since last push to s/ss (glob)
554 no changes made to subrepo s/ss since last push to s/ss (glob)
555 no changes made to subrepo s since last push to s
555 no changes made to subrepo s since last push to s
556 no changes made to subrepo t since last push to t
556 no changes made to subrepo t since last push to t
557 searching for changes
557 searching for changes
558 no changes found
558 no changes found
559 [1]
559 [1]
560
560
561 the subrepos on the source do not have a clean store versus the clone target
561 the subrepos on the source do not have a clean store versus the clone target
562 because they were never explicitly pushed to the source
562 because they were never explicitly pushed to the source
563
563
564 $ hg push ../tcc
564 $ hg push ../tcc
565 pushing to ../tcc
565 pushing to ../tcc
566 pushing subrepo s/ss to ../tcc/s/ss (glob)
566 pushing subrepo s/ss to ../tcc/s/ss (glob)
567 searching for changes
567 searching for changes
568 no changes found
568 no changes found
569 pushing subrepo s to ../tcc/s
569 pushing subrepo s to ../tcc/s
570 searching for changes
570 searching for changes
571 no changes found
571 no changes found
572 pushing subrepo t to ../tcc/t
572 pushing subrepo t to ../tcc/t
573 searching for changes
573 searching for changes
574 no changes found
574 no changes found
575 searching for changes
575 searching for changes
576 no changes found
576 no changes found
577 [1]
577 [1]
578
578
579 after push their stores become clean
579 after push their stores become clean
580
580
581 $ hg push ../tcc
581 $ hg push ../tcc
582 pushing to ../tcc
582 pushing to ../tcc
583 no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob)
583 no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob)
584 no changes made to subrepo s since last push to ../tcc/s
584 no changes made to subrepo s since last push to ../tcc/s
585 no changes made to subrepo t since last push to ../tcc/t
585 no changes made to subrepo t since last push to ../tcc/t
586 searching for changes
586 searching for changes
587 no changes found
587 no changes found
588 [1]
588 [1]
589
589
590 updating a subrepo to a different revision or changing
590 updating a subrepo to a different revision or changing
591 its working directory does not make its store dirty
591 its working directory does not make its store dirty
592
592
593 $ hg -R s update '.^'
593 $ hg -R s update '.^'
594 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
594 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
595 $ hg push
595 $ hg push
596 pushing to $TESTTMP/t (glob)
596 pushing to $TESTTMP/t (glob)
597 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
597 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
598 no changes made to subrepo s since last push to $TESTTMP/t/s
598 no changes made to subrepo s since last push to $TESTTMP/t/s
599 no changes made to subrepo t since last push to $TESTTMP/t/t
599 no changes made to subrepo t since last push to $TESTTMP/t/t
600 searching for changes
600 searching for changes
601 no changes found
601 no changes found
602 [1]
602 [1]
603 $ echo foo >> s/a
603 $ echo foo >> s/a
604 $ hg push
604 $ hg push
605 pushing to $TESTTMP/t (glob)
605 pushing to $TESTTMP/t (glob)
606 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
606 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
607 no changes made to subrepo s since last push to $TESTTMP/t/s
607 no changes made to subrepo s since last push to $TESTTMP/t/s
608 no changes made to subrepo t since last push to $TESTTMP/t/t
608 no changes made to subrepo t since last push to $TESTTMP/t/t
609 searching for changes
609 searching for changes
610 no changes found
610 no changes found
611 [1]
611 [1]
612 $ hg -R s update -C tip
612 $ hg -R s update -C tip
613 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
613 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
614
614
615 committing into a subrepo makes its store (but not its parent's store) dirty
615 committing into a subrepo makes its store (but not its parent's store) dirty
616
616
617 $ echo foo >> s/ss/a
617 $ echo foo >> s/ss/a
618 $ hg -R s/ss commit -m 'test dirty store detection'
618 $ hg -R s/ss commit -m 'test dirty store detection'
619
619
620 $ hg out -S -r `hg log -r tip -T "{node|short}"`
620 $ hg out -S -r `hg log -r tip -T "{node|short}"`
621 comparing with $TESTTMP/t (glob)
621 comparing with $TESTTMP/t (glob)
622 searching for changes
622 searching for changes
623 no changes found
623 no changes found
624 comparing with $TESTTMP/t/s
624 comparing with $TESTTMP/t/s
625 searching for changes
625 searching for changes
626 no changes found
626 no changes found
627 comparing with $TESTTMP/t/s/ss
627 comparing with $TESTTMP/t/s/ss
628 searching for changes
628 searching for changes
629 changeset: 1:79ea5566a333
629 changeset: 1:79ea5566a333
630 tag: tip
630 tag: tip
631 user: test
631 user: test
632 date: Thu Jan 01 00:00:00 1970 +0000
632 date: Thu Jan 01 00:00:00 1970 +0000
633 summary: test dirty store detection
633 summary: test dirty store detection
634
634
635 comparing with $TESTTMP/t/t
635 comparing with $TESTTMP/t/t
636 searching for changes
636 searching for changes
637 no changes found
637 no changes found
638
638
639 $ hg push
639 $ hg push
640 pushing to $TESTTMP/t (glob)
640 pushing to $TESTTMP/t (glob)
641 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
641 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
642 searching for changes
642 searching for changes
643 adding changesets
643 adding changesets
644 adding manifests
644 adding manifests
645 adding file changes
645 adding file changes
646 added 1 changesets with 1 changes to 1 files
646 added 1 changesets with 1 changes to 1 files
647 no changes made to subrepo s since last push to $TESTTMP/t/s
647 no changes made to subrepo s since last push to $TESTTMP/t/s
648 no changes made to subrepo t since last push to $TESTTMP/t/t
648 no changes made to subrepo t since last push to $TESTTMP/t/t
649 searching for changes
649 searching for changes
650 no changes found
650 no changes found
651 [1]
651 [1]
652
652
653 a subrepo store may be clean versus one repo but not versus another
653 a subrepo store may be clean versus one repo but not versus another
654
654
655 $ hg push
655 $ hg push
656 pushing to $TESTTMP/t (glob)
656 pushing to $TESTTMP/t (glob)
657 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
657 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
658 no changes made to subrepo s since last push to $TESTTMP/t/s
658 no changes made to subrepo s since last push to $TESTTMP/t/s
659 no changes made to subrepo t since last push to $TESTTMP/t/t
659 no changes made to subrepo t since last push to $TESTTMP/t/t
660 searching for changes
660 searching for changes
661 no changes found
661 no changes found
662 [1]
662 [1]
663 $ hg push ../tcc
663 $ hg push ../tcc
664 pushing to ../tcc
664 pushing to ../tcc
665 pushing subrepo s/ss to ../tcc/s/ss (glob)
665 pushing subrepo s/ss to ../tcc/s/ss (glob)
666 searching for changes
666 searching for changes
667 adding changesets
667 adding changesets
668 adding manifests
668 adding manifests
669 adding file changes
669 adding file changes
670 added 1 changesets with 1 changes to 1 files
670 added 1 changesets with 1 changes to 1 files
671 no changes made to subrepo s since last push to ../tcc/s
671 no changes made to subrepo s since last push to ../tcc/s
672 no changes made to subrepo t since last push to ../tcc/t
672 no changes made to subrepo t since last push to ../tcc/t
673 searching for changes
673 searching for changes
674 no changes found
674 no changes found
675 [1]
675 [1]
676
676
677 update
677 update
678
678
679 $ cd ../t
679 $ cd ../t
680 $ hg up -C # discard our earlier merge
680 $ hg up -C # discard our earlier merge
681 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
681 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
682 2 other heads for branch "default"
682 2 other heads for branch "default"
683 $ echo blah > t/t
683 $ echo blah > t/t
684 $ hg ci -m13
684 $ hg ci -m13
685 committing subrepository t
685 committing subrepository t
686
686
687 backout calls revert internally with minimal opts, which should not raise
687 backout calls revert internally with minimal opts, which should not raise
688 KeyError
688 KeyError
689
689
690 $ hg backout ".^" --no-commit
690 $ hg backout ".^" --no-commit
691 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
691 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
692 changeset c373c8102e68 backed out, don't forget to commit.
692 changeset c373c8102e68 backed out, don't forget to commit.
693
693
694 $ hg up -C # discard changes
694 $ hg up -C # discard changes
695 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
695 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
696 2 other heads for branch "default"
696 2 other heads for branch "default"
697
697
698 pull
698 pull
699
699
700 $ cd ../tc
700 $ cd ../tc
701 $ hg pull
701 $ hg pull
702 pulling from $TESTTMP/t (glob)
702 pulling from $TESTTMP/t (glob)
703 searching for changes
703 searching for changes
704 adding changesets
704 adding changesets
705 adding manifests
705 adding manifests
706 adding file changes
706 adding file changes
707 added 1 changesets with 1 changes to 1 files
707 added 1 changesets with 1 changes to 1 files
708 (run 'hg update' to get a working copy)
708 (run 'hg update' to get a working copy)
709
709
710 should pull t
710 should pull t
711
711
712 $ hg incoming -S -r `hg log -r tip -T "{node|short}"`
712 $ hg incoming -S -r `hg log -r tip -T "{node|short}"`
713 comparing with $TESTTMP/t (glob)
713 comparing with $TESTTMP/t (glob)
714 no changes found
714 no changes found
715 comparing with $TESTTMP/t/s
715 comparing with $TESTTMP/t/s
716 searching for changes
716 searching for changes
717 no changes found
717 no changes found
718 comparing with $TESTTMP/t/s/ss
718 comparing with $TESTTMP/t/s/ss
719 searching for changes
719 searching for changes
720 no changes found
720 no changes found
721 comparing with $TESTTMP/t/t
721 comparing with $TESTTMP/t/t
722 searching for changes
722 searching for changes
723 changeset: 5:52c0adc0515a
723 changeset: 5:52c0adc0515a
724 tag: tip
724 tag: tip
725 user: test
725 user: test
726 date: Thu Jan 01 00:00:00 1970 +0000
726 date: Thu Jan 01 00:00:00 1970 +0000
727 summary: 13
727 summary: 13
728
728
729
729
730 $ hg up
730 $ hg up
731 pulling subrepo t from $TESTTMP/t/t
731 pulling subrepo t from $TESTTMP/t/t
732 searching for changes
732 searching for changes
733 adding changesets
733 adding changesets
734 adding manifests
734 adding manifests
735 adding file changes
735 adding file changes
736 added 1 changesets with 1 changes to 1 files
736 added 1 changesets with 1 changes to 1 files
737 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
737 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
738 2 other heads for branch "default"
738 2 other heads for branch "default"
739 $ cat t/t
739 $ cat t/t
740 blah
740 blah
741
741
742 bogus subrepo path aborts
742 bogus subrepo path aborts
743
743
744 $ echo 'bogus=[boguspath' >> .hgsub
744 $ echo 'bogus=[boguspath' >> .hgsub
745 $ hg ci -m 'bogus subrepo path'
745 $ hg ci -m 'bogus subrepo path'
746 abort: missing ] in subrepo source
746 abort: missing ] in subrepo source
747 [255]
747 [255]
748
748
749 Issue1986: merge aborts when trying to merge a subrepo that
749 Issue1986: merge aborts when trying to merge a subrepo that
750 shouldn't need merging
750 shouldn't need merging
751
751
752 # subrepo layout
752 # subrepo layout
753 #
753 #
754 # o 5 br
754 # o 5 br
755 # /|
755 # /|
756 # o | 4 default
756 # o | 4 default
757 # | |
757 # | |
758 # | o 3 br
758 # | o 3 br
759 # |/|
759 # |/|
760 # o | 2 default
760 # o | 2 default
761 # | |
761 # | |
762 # | o 1 br
762 # | o 1 br
763 # |/
763 # |/
764 # o 0 default
764 # o 0 default
765
765
766 $ cd ..
766 $ cd ..
767 $ rm -rf sub
767 $ rm -rf sub
768 $ hg init main
768 $ hg init main
769 $ cd main
769 $ cd main
770 $ hg init s
770 $ hg init s
771 $ cd s
771 $ cd s
772 $ echo a > a
772 $ echo a > a
773 $ hg ci -Am1
773 $ hg ci -Am1
774 adding a
774 adding a
775 $ hg branch br
775 $ hg branch br
776 marked working directory as branch br
776 marked working directory as branch br
777 (branches are permanent and global, did you want a bookmark?)
777 (branches are permanent and global, did you want a bookmark?)
778 $ echo a >> a
778 $ echo a >> a
779 $ hg ci -m1
779 $ hg ci -m1
780 $ hg up default
780 $ hg up default
781 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
781 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
782 $ echo b > b
782 $ echo b > b
783 $ hg ci -Am1
783 $ hg ci -Am1
784 adding b
784 adding b
785 $ hg up br
785 $ hg up br
786 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
786 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
787 $ hg merge tip
787 $ hg merge tip
788 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
788 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
789 (branch merge, don't forget to commit)
789 (branch merge, don't forget to commit)
790 $ hg ci -m1
790 $ hg ci -m1
791 $ hg up 2
791 $ hg up 2
792 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
792 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
793 $ echo c > c
793 $ echo c > c
794 $ hg ci -Am1
794 $ hg ci -Am1
795 adding c
795 adding c
796 $ hg up 3
796 $ hg up 3
797 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
797 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
798 $ hg merge 4
798 $ hg merge 4
799 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
799 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
800 (branch merge, don't forget to commit)
800 (branch merge, don't forget to commit)
801 $ hg ci -m1
801 $ hg ci -m1
802
802
803 # main repo layout:
803 # main repo layout:
804 #
804 #
805 # * <-- try to merge default into br again
805 # * <-- try to merge default into br again
806 # .`|
806 # .`|
807 # . o 5 br --> substate = 5
807 # . o 5 br --> substate = 5
808 # . |
808 # . |
809 # o | 4 default --> substate = 4
809 # o | 4 default --> substate = 4
810 # | |
810 # | |
811 # | o 3 br --> substate = 2
811 # | o 3 br --> substate = 2
812 # |/|
812 # |/|
813 # o | 2 default --> substate = 2
813 # o | 2 default --> substate = 2
814 # | |
814 # | |
815 # | o 1 br --> substate = 3
815 # | o 1 br --> substate = 3
816 # |/
816 # |/
817 # o 0 default --> substate = 2
817 # o 0 default --> substate = 2
818
818
819 $ cd ..
819 $ cd ..
820 $ echo 's = s' > .hgsub
820 $ echo 's = s' > .hgsub
821 $ hg -R s up 2
821 $ hg -R s up 2
822 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
822 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
823 $ hg ci -Am1
823 $ hg ci -Am1
824 adding .hgsub
824 adding .hgsub
825 $ hg branch br
825 $ hg branch br
826 marked working directory as branch br
826 marked working directory as branch br
827 (branches are permanent and global, did you want a bookmark?)
827 (branches are permanent and global, did you want a bookmark?)
828 $ echo b > b
828 $ echo b > b
829 $ hg -R s up 3
829 $ hg -R s up 3
830 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
830 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
831 $ hg ci -Am1
831 $ hg ci -Am1
832 adding b
832 adding b
833 $ hg up default
833 $ hg up default
834 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
834 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
835 $ echo c > c
835 $ echo c > c
836 $ hg ci -Am1
836 $ hg ci -Am1
837 adding c
837 adding c
838 $ hg up 1
838 $ hg up 1
839 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
839 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
840 $ hg merge 2
840 $ hg merge 2
841 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
841 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
842 (branch merge, don't forget to commit)
842 (branch merge, don't forget to commit)
843 $ hg ci -m1
843 $ hg ci -m1
844 $ hg up 2
844 $ hg up 2
845 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
845 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
846 $ hg -R s up 4
846 $ hg -R s up 4
847 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
847 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
848 $ echo d > d
848 $ echo d > d
849 $ hg ci -Am1
849 $ hg ci -Am1
850 adding d
850 adding d
851 $ hg up 3
851 $ hg up 3
852 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
852 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
853 $ hg -R s up 5
853 $ hg -R s up 5
854 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
854 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
855 $ echo e > e
855 $ echo e > e
856 $ hg ci -Am1
856 $ hg ci -Am1
857 adding e
857 adding e
858
858
859 $ hg up 5
859 $ hg up 5
860 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
860 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
861 $ hg merge 4 # try to merge default into br again
861 $ hg merge 4 # try to merge default into br again
862 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
862 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
863 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
863 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
864 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
864 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
865 (branch merge, don't forget to commit)
865 (branch merge, don't forget to commit)
866 $ cd ..
866 $ cd ..
867
867
868 test subrepo delete from .hgsubstate
868 test subrepo delete from .hgsubstate
869
869
870 $ hg init testdelete
870 $ hg init testdelete
871 $ mkdir testdelete/nested testdelete/nested2
871 $ mkdir testdelete/nested testdelete/nested2
872 $ hg init testdelete/nested
872 $ hg init testdelete/nested
873 $ hg init testdelete/nested2
873 $ hg init testdelete/nested2
874 $ echo test > testdelete/nested/foo
874 $ echo test > testdelete/nested/foo
875 $ echo test > testdelete/nested2/foo
875 $ echo test > testdelete/nested2/foo
876 $ hg -R testdelete/nested add
876 $ hg -R testdelete/nested add
877 adding testdelete/nested/foo (glob)
877 adding testdelete/nested/foo (glob)
878 $ hg -R testdelete/nested2 add
878 $ hg -R testdelete/nested2 add
879 adding testdelete/nested2/foo (glob)
879 adding testdelete/nested2/foo (glob)
880 $ hg -R testdelete/nested ci -m test
880 $ hg -R testdelete/nested ci -m test
881 $ hg -R testdelete/nested2 ci -m test
881 $ hg -R testdelete/nested2 ci -m test
882 $ echo nested = nested > testdelete/.hgsub
882 $ echo nested = nested > testdelete/.hgsub
883 $ echo nested2 = nested2 >> testdelete/.hgsub
883 $ echo nested2 = nested2 >> testdelete/.hgsub
884 $ hg -R testdelete add
884 $ hg -R testdelete add
885 adding testdelete/.hgsub (glob)
885 adding testdelete/.hgsub (glob)
886 $ hg -R testdelete ci -m "nested 1 & 2 added"
886 $ hg -R testdelete ci -m "nested 1 & 2 added"
887 $ echo nested = nested > testdelete/.hgsub
887 $ echo nested = nested > testdelete/.hgsub
888 $ hg -R testdelete ci -m "nested 2 deleted"
888 $ hg -R testdelete ci -m "nested 2 deleted"
889 $ cat testdelete/.hgsubstate
889 $ cat testdelete/.hgsubstate
890 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
890 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
891 $ hg -R testdelete remove testdelete/.hgsub
891 $ hg -R testdelete remove testdelete/.hgsub
892 $ hg -R testdelete ci -m ".hgsub deleted"
892 $ hg -R testdelete ci -m ".hgsub deleted"
893 $ cat testdelete/.hgsubstate
893 $ cat testdelete/.hgsubstate
894 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
894 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
895
895
896 test repository cloning
896 test repository cloning
897
897
898 $ mkdir mercurial mercurial2
898 $ mkdir mercurial mercurial2
899 $ hg init nested_absolute
899 $ hg init nested_absolute
900 $ echo test > nested_absolute/foo
900 $ echo test > nested_absolute/foo
901 $ hg -R nested_absolute add
901 $ hg -R nested_absolute add
902 adding nested_absolute/foo (glob)
902 adding nested_absolute/foo (glob)
903 $ hg -R nested_absolute ci -mtest
903 $ hg -R nested_absolute ci -mtest
904 $ cd mercurial
904 $ cd mercurial
905 $ hg init nested_relative
905 $ hg init nested_relative
906 $ echo test2 > nested_relative/foo2
906 $ echo test2 > nested_relative/foo2
907 $ hg -R nested_relative add
907 $ hg -R nested_relative add
908 adding nested_relative/foo2 (glob)
908 adding nested_relative/foo2 (glob)
909 $ hg -R nested_relative ci -mtest2
909 $ hg -R nested_relative ci -mtest2
910 $ hg init main
910 $ hg init main
911 $ echo "nested_relative = ../nested_relative" > main/.hgsub
911 $ echo "nested_relative = ../nested_relative" > main/.hgsub
912 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
912 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
913 $ hg -R main add
913 $ hg -R main add
914 adding main/.hgsub (glob)
914 adding main/.hgsub (glob)
915 $ hg -R main ci -m "add subrepos"
915 $ hg -R main ci -m "add subrepos"
916 $ cd ..
916 $ cd ..
917 $ hg clone mercurial/main mercurial2/main
917 $ hg clone mercurial/main mercurial2/main
918 updating to branch default
918 updating to branch default
919 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
919 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
920 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
920 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
921 > mercurial2/main/nested_relative/.hg/hgrc
921 > mercurial2/main/nested_relative/.hg/hgrc
922 [paths]
922 [paths]
923 default = $TESTTMP/mercurial/nested_absolute
923 default = $TESTTMP/mercurial/nested_absolute
924 [paths]
924 [paths]
925 default = $TESTTMP/mercurial/nested_relative
925 default = $TESTTMP/mercurial/nested_relative
926 $ rm -rf mercurial mercurial2
926 $ rm -rf mercurial mercurial2
927
927
928 Issue1977: multirepo push should fail if subrepo push fails
928 Issue1977: multirepo push should fail if subrepo push fails
929
929
930 $ hg init repo
930 $ hg init repo
931 $ hg init repo/s
931 $ hg init repo/s
932 $ echo a > repo/s/a
932 $ echo a > repo/s/a
933 $ hg -R repo/s ci -Am0
933 $ hg -R repo/s ci -Am0
934 adding a
934 adding a
935 $ echo s = s > repo/.hgsub
935 $ echo s = s > repo/.hgsub
936 $ hg -R repo ci -Am1
936 $ hg -R repo ci -Am1
937 adding .hgsub
937 adding .hgsub
938 $ hg clone repo repo2
938 $ hg clone repo repo2
939 updating to branch default
939 updating to branch default
940 cloning subrepo s from $TESTTMP/repo/s
940 cloning subrepo s from $TESTTMP/repo/s
941 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
941 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
942 $ hg -q -R repo2 pull -u
942 $ hg -q -R repo2 pull -u
943 $ echo 1 > repo2/s/a
943 $ echo 1 > repo2/s/a
944 $ hg -R repo2/s ci -m2
944 $ hg -R repo2/s ci -m2
945 $ hg -q -R repo2/s push
945 $ hg -q -R repo2/s push
946 $ hg -R repo2/s up -C 0
946 $ hg -R repo2/s up -C 0
947 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
947 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
948 $ echo 2 > repo2/s/b
948 $ echo 2 > repo2/s/b
949 $ hg -R repo2/s ci -m3 -A
949 $ hg -R repo2/s ci -m3 -A
950 adding b
950 adding b
951 created new head
951 created new head
952 $ hg -R repo2 ci -m3
952 $ hg -R repo2 ci -m3
953 $ hg -q -R repo2 push
953 $ hg -q -R repo2 push
954 abort: push creates new remote head cc505f09a8b2! (in subrepo s)
954 abort: push creates new remote head cc505f09a8b2! (in subrepo s)
955 (merge or see 'hg help push' for details about pushing new heads)
955 (merge or see 'hg help push' for details about pushing new heads)
956 [255]
956 [255]
957 $ hg -R repo update
957 $ hg -R repo update
958 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
958 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
959
959
960 test if untracked file is not overwritten
960 test if untracked file is not overwritten
961
961
962 (this also tests that updated .hgsubstate is treated as "modified",
962 (this also tests that updated .hgsubstate is treated as "modified",
963 when 'merge.update()' is aborted before 'merge.recordupdates()', even
963 when 'merge.update()' is aborted before 'merge.recordupdates()', even
964 if none of mode, size and timestamp of it isn't changed on the
964 if none of mode, size and timestamp of it isn't changed on the
965 filesystem (see also issue4583))
965 filesystem (see also issue4583))
966
966
967 $ echo issue3276_ok > repo/s/b
967 $ echo issue3276_ok > repo/s/b
968 $ hg -R repo2 push -f -q
968 $ hg -R repo2 push -f -q
969 $ touch -t 200001010000 repo/.hgsubstate
969 $ touch -t 200001010000 repo/.hgsubstate
970
970
971 $ cat >> repo/.hg/hgrc <<EOF
971 $ cat >> repo/.hg/hgrc <<EOF
972 > [fakedirstatewritetime]
972 > [fakedirstatewritetime]
973 > # emulate invoking dirstate.write() via repo.status()
973 > # emulate invoking dirstate.write() via repo.status()
974 > # at 2000-01-01 00:00
974 > # at 2000-01-01 00:00
975 > fakenow = 200001010000
975 > fakenow = 200001010000
976 >
976 >
977 > [extensions]
977 > [extensions]
978 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
978 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
979 > EOF
979 > EOF
980 $ hg -R repo update
980 $ hg -R repo update
981 b: untracked file differs
981 b: untracked file differs
982 abort: untracked files in working directory differ from files in requested revision (in subrepo s)
982 abort: untracked files in working directory differ from files in requested revision (in subrepo s)
983 [255]
983 [255]
984 $ cat >> repo/.hg/hgrc <<EOF
984 $ cat >> repo/.hg/hgrc <<EOF
985 > [extensions]
985 > [extensions]
986 > fakedirstatewritetime = !
986 > fakedirstatewritetime = !
987 > EOF
987 > EOF
988
988
989 $ cat repo/s/b
989 $ cat repo/s/b
990 issue3276_ok
990 issue3276_ok
991 $ rm repo/s/b
991 $ rm repo/s/b
992 $ touch -t 200001010000 repo/.hgsubstate
992 $ touch -t 200001010000 repo/.hgsubstate
993 $ hg -R repo revert --all
993 $ hg -R repo revert --all
994 reverting repo/.hgsubstate (glob)
994 reverting repo/.hgsubstate (glob)
995 reverting subrepo s
995 reverting subrepo s
996 $ hg -R repo update
996 $ hg -R repo update
997 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
997 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
998 $ cat repo/s/b
998 $ cat repo/s/b
999 2
999 2
1000 $ rm -rf repo2 repo
1000 $ rm -rf repo2 repo
1001
1001
1002
1002
1003 Issue1852 subrepos with relative paths always push/pull relative to default
1003 Issue1852 subrepos with relative paths always push/pull relative to default
1004
1004
1005 Prepare a repo with subrepo
1005 Prepare a repo with subrepo
1006
1006
1007 $ hg init issue1852a
1007 $ hg init issue1852a
1008 $ cd issue1852a
1008 $ cd issue1852a
1009 $ hg init sub/repo
1009 $ hg init sub/repo
1010 $ echo test > sub/repo/foo
1010 $ echo test > sub/repo/foo
1011 $ hg -R sub/repo add sub/repo/foo
1011 $ hg -R sub/repo add sub/repo/foo
1012 $ echo sub/repo = sub/repo > .hgsub
1012 $ echo sub/repo = sub/repo > .hgsub
1013 $ hg add .hgsub
1013 $ hg add .hgsub
1014 $ hg ci -mtest
1014 $ hg ci -mtest
1015 committing subrepository sub/repo (glob)
1015 committing subrepository sub/repo (glob)
1016 $ echo test >> sub/repo/foo
1016 $ echo test >> sub/repo/foo
1017 $ hg ci -mtest
1017 $ hg ci -mtest
1018 committing subrepository sub/repo (glob)
1018 committing subrepository sub/repo (glob)
1019 $ hg cat sub/repo/foo
1019 $ hg cat sub/repo/foo
1020 test
1020 test
1021 test
1021 test
1022 $ mkdir -p tmp/sub/repo
1022 $ mkdir -p tmp/sub/repo
1023 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
1023 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
1024 $ cat tmp/sub/repo/foo_p
1024 $ cat tmp/sub/repo/foo_p
1025 test
1025 test
1026 $ mv sub/repo sub_
1026 $ mv sub/repo sub_
1027 $ hg cat sub/repo/baz
1027 $ hg cat sub/repo/baz
1028 skipping missing subrepository: sub/repo
1028 skipping missing subrepository: sub/repo
1029 [1]
1029 [1]
1030 $ rm -rf sub/repo
1030 $ rm -rf sub/repo
1031 $ mv sub_ sub/repo
1031 $ mv sub_ sub/repo
1032 $ cd ..
1032 $ cd ..
1033
1033
1034 Create repo without default path, pull top repo, and see what happens on update
1034 Create repo without default path, pull top repo, and see what happens on update
1035
1035
1036 $ hg init issue1852b
1036 $ hg init issue1852b
1037 $ hg -R issue1852b pull issue1852a
1037 $ hg -R issue1852b pull issue1852a
1038 pulling from issue1852a
1038 pulling from issue1852a
1039 requesting all changes
1039 requesting all changes
1040 adding changesets
1040 adding changesets
1041 adding manifests
1041 adding manifests
1042 adding file changes
1042 adding file changes
1043 added 2 changesets with 3 changes to 2 files
1043 added 2 changesets with 3 changes to 2 files
1044 (run 'hg update' to get a working copy)
1044 (run 'hg update' to get a working copy)
1045 $ hg -R issue1852b update
1045 $ hg -R issue1852b update
1046 abort: default path for subrepository not found (in subrepo sub/repo) (glob)
1046 abort: default path for subrepository not found (in subrepo sub/repo) (glob)
1047 [255]
1047 [255]
1048
1048
1049 Ensure a full traceback, not just the SubrepoAbort part
1049 Ensure a full traceback, not just the SubrepoAbort part
1050
1050
1051 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort'
1051 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort'
1052 raise error.Abort(_("default path for subrepository not found"))
1052 raise error.Abort(_("default path for subrepository not found"))
1053
1053
1054 Pull -u now doesn't help
1054 Pull -u now doesn't help
1055
1055
1056 $ hg -R issue1852b pull -u issue1852a
1056 $ hg -R issue1852b pull -u issue1852a
1057 pulling from issue1852a
1057 pulling from issue1852a
1058 searching for changes
1058 searching for changes
1059 no changes found
1059 no changes found
1060
1060
1061 Try the same, but with pull -u
1061 Try the same, but with pull -u
1062
1062
1063 $ hg init issue1852c
1063 $ hg init issue1852c
1064 $ hg -R issue1852c pull -r0 -u issue1852a
1064 $ hg -R issue1852c pull -r0 -u issue1852a
1065 pulling from issue1852a
1065 pulling from issue1852a
1066 adding changesets
1066 adding changesets
1067 adding manifests
1067 adding manifests
1068 adding file changes
1068 adding file changes
1069 added 1 changesets with 2 changes to 2 files
1069 added 1 changesets with 2 changes to 2 files
1070 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
1070 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
1071 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1071 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1072
1072
1073 Try to push from the other side
1073 Try to push from the other side
1074
1074
1075 $ hg -R issue1852a push `pwd`/issue1852c
1075 $ hg -R issue1852a push `pwd`/issue1852c
1076 pushing to $TESTTMP/issue1852c (glob)
1076 pushing to $TESTTMP/issue1852c (glob)
1077 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
1077 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
1078 searching for changes
1078 searching for changes
1079 no changes found
1079 no changes found
1080 searching for changes
1080 searching for changes
1081 adding changesets
1081 adding changesets
1082 adding manifests
1082 adding manifests
1083 adding file changes
1083 adding file changes
1084 added 1 changesets with 1 changes to 1 files
1084 added 1 changesets with 1 changes to 1 files
1085
1085
1086 Incoming and outgoing should not use the default path:
1086 Incoming and outgoing should not use the default path:
1087
1087
1088 $ hg clone -q issue1852a issue1852d
1088 $ hg clone -q issue1852a issue1852d
1089 $ hg -R issue1852d outgoing --subrepos issue1852c
1089 $ hg -R issue1852d outgoing --subrepos issue1852c
1090 comparing with issue1852c
1090 comparing with issue1852c
1091 searching for changes
1091 searching for changes
1092 no changes found
1092 no changes found
1093 comparing with issue1852c/sub/repo
1093 comparing with issue1852c/sub/repo
1094 searching for changes
1094 searching for changes
1095 no changes found
1095 no changes found
1096 [1]
1096 [1]
1097 $ hg -R issue1852d incoming --subrepos issue1852c
1097 $ hg -R issue1852d incoming --subrepos issue1852c
1098 comparing with issue1852c
1098 comparing with issue1852c
1099 searching for changes
1099 searching for changes
1100 no changes found
1100 no changes found
1101 comparing with issue1852c/sub/repo
1101 comparing with issue1852c/sub/repo
1102 searching for changes
1102 searching for changes
1103 no changes found
1103 no changes found
1104 [1]
1104 [1]
1105
1105
1106 Check that merge of a new subrepo doesn't write the uncommitted state to
1106 Check that merge of a new subrepo doesn't write the uncommitted state to
1107 .hgsubstate (issue4622)
1107 .hgsubstate (issue4622)
1108
1108
1109 $ hg init issue1852a/addedsub
1109 $ hg init issue1852a/addedsub
1110 $ echo zzz > issue1852a/addedsub/zz.txt
1110 $ echo zzz > issue1852a/addedsub/zz.txt
1111 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1111 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1112
1112
1113 $ hg clone issue1852a/addedsub issue1852d/addedsub
1113 $ hg clone issue1852a/addedsub issue1852d/addedsub
1114 updating to branch default
1114 updating to branch default
1115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1116
1116
1117 $ echo def > issue1852a/sub/repo/foo
1117 $ echo def > issue1852a/sub/repo/foo
1118 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1118 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1119 adding tmp/sub/repo/foo_p
1119 adding tmp/sub/repo/foo_p
1120 committing subrepository sub/repo (glob)
1120 committing subrepository sub/repo (glob)
1121
1121
1122 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1122 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1123 $ echo xyz > issue1852d/sub/repo/foo
1123 $ echo xyz > issue1852d/sub/repo/foo
1124 $ hg -R issue1852d pull -u
1124 $ hg -R issue1852d pull -u
1125 pulling from $TESTTMP/issue1852a (glob)
1125 pulling from $TESTTMP/issue1852a (glob)
1126 searching for changes
1126 searching for changes
1127 adding changesets
1127 adding changesets
1128 adding manifests
1128 adding manifests
1129 adding file changes
1129 adding file changes
1130 added 1 changesets with 2 changes to 2 files
1130 added 1 changesets with 2 changes to 2 files
1131 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1131 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1132 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1132 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1133 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo (glob)
1133 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo (glob)
1134 searching for changes
1134 searching for changes
1135 adding changesets
1135 adding changesets
1136 adding manifests
1136 adding manifests
1137 adding file changes
1137 adding file changes
1138 added 1 changesets with 1 changes to 1 files
1138 added 1 changesets with 1 changes to 1 files
1139 subrepository sources for sub/repo differ (glob)
1139 subrepository sources for sub/repo differ (glob)
1140 use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l
1140 use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l
1141 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1141 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1142 $ cat issue1852d/.hgsubstate
1142 $ cat issue1852d/.hgsubstate
1143 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1143 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1144
1144
1145 Check status of files when none of them belong to the first
1145 Check status of files when none of them belong to the first
1146 subrepository:
1146 subrepository:
1147
1147
1148 $ hg init subrepo-status
1148 $ hg init subrepo-status
1149 $ cd subrepo-status
1149 $ cd subrepo-status
1150 $ hg init subrepo-1
1150 $ hg init subrepo-1
1151 $ hg init subrepo-2
1151 $ hg init subrepo-2
1152 $ cd subrepo-2
1152 $ cd subrepo-2
1153 $ touch file
1153 $ touch file
1154 $ hg add file
1154 $ hg add file
1155 $ cd ..
1155 $ cd ..
1156 $ echo subrepo-1 = subrepo-1 > .hgsub
1156 $ echo subrepo-1 = subrepo-1 > .hgsub
1157 $ echo subrepo-2 = subrepo-2 >> .hgsub
1157 $ echo subrepo-2 = subrepo-2 >> .hgsub
1158 $ hg add .hgsub
1158 $ hg add .hgsub
1159 $ hg ci -m 'Added subrepos'
1159 $ hg ci -m 'Added subrepos'
1160 committing subrepository subrepo-2
1160 committing subrepository subrepo-2
1161 $ hg st subrepo-2/file
1161 $ hg st subrepo-2/file
1162
1162
1163 Check that share works with subrepo
1163 Check that share works with subrepo
1164 $ hg --config extensions.share= share . ../shared
1164 $ hg --config extensions.share= share . ../shared
1165 updating working directory
1165 updating working directory
1166 cloning subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
1166 cloning subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
1167 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1167 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1168 $ test -f ../shared/subrepo-1/.hg/sharedpath
1168 $ test -f ../shared/subrepo-1/.hg/sharedpath
1169 [1]
1169 [1]
1170 $ hg -R ../shared in
1170 $ hg -R ../shared in
1171 abort: repository default not found!
1171 abort: repository default not found!
1172 [255]
1172 [255]
1173 $ hg -R ../shared/subrepo-2 showconfig paths
1173 $ hg -R ../shared/subrepo-2 showconfig paths
1174 paths.default=$TESTTMP/subrepo-status/subrepo-2
1174 paths.default=$TESTTMP/subrepo-status/subrepo-2
1175 $ hg -R ../shared/subrepo-1 sum --remote
1175 $ hg -R ../shared/subrepo-1 sum --remote
1176 parent: -1:000000000000 tip (empty repository)
1176 parent: -1:000000000000 tip (empty repository)
1177 branch: default
1177 branch: default
1178 commit: (clean)
1178 commit: (clean)
1179 update: (current)
1179 update: (current)
1180 remote: (synced)
1180 remote: (synced)
1181
1181
1182 Check hg update --clean
1182 Check hg update --clean
1183 $ cd $TESTTMP/t
1183 $ cd $TESTTMP/t
1184 $ rm -r t/t.orig
1184 $ rm -r t/t.orig
1185 $ hg status -S --all
1185 $ hg status -S --all
1186 C .hgsub
1186 C .hgsub
1187 C .hgsubstate
1187 C .hgsubstate
1188 C a
1188 C a
1189 C s/.hgsub
1189 C s/.hgsub
1190 C s/.hgsubstate
1190 C s/.hgsubstate
1191 C s/a
1191 C s/a
1192 C s/ss/a
1192 C s/ss/a
1193 C t/t
1193 C t/t
1194 $ echo c1 > s/a
1194 $ echo c1 > s/a
1195 $ cd s
1195 $ cd s
1196 $ echo c1 > b
1196 $ echo c1 > b
1197 $ echo c1 > c
1197 $ echo c1 > c
1198 $ hg add b
1198 $ hg add b
1199 $ cd ..
1199 $ cd ..
1200 $ hg status -S
1200 $ hg status -S
1201 M s/a
1201 M s/a
1202 A s/b
1202 A s/b
1203 ? s/c
1203 ? s/c
1204 $ hg update -C
1204 $ hg update -C
1205 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1205 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1206 2 other heads for branch "default"
1206 2 other heads for branch "default"
1207 $ hg status -S
1207 $ hg status -S
1208 ? s/b
1208 ? s/b
1209 ? s/c
1209 ? s/c
1210
1210
1211 Sticky subrepositories, no changes
1211 Sticky subrepositories, no changes
1212 $ cd $TESTTMP/t
1212 $ cd $TESTTMP/t
1213 $ hg id
1213 $ hg id
1214 925c17564ef8 tip
1214 925c17564ef8 tip
1215 $ hg -R s id
1215 $ hg -R s id
1216 12a213df6fa9 tip
1216 12a213df6fa9 tip
1217 $ hg -R t id
1217 $ hg -R t id
1218 52c0adc0515a tip
1218 52c0adc0515a tip
1219 $ hg update 11
1219 $ hg update 11
1220 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1220 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1221 $ hg id
1221 $ hg id
1222 365661e5936a
1222 365661e5936a
1223 $ hg -R s id
1223 $ hg -R s id
1224 fc627a69481f
1224 fc627a69481f
1225 $ hg -R t id
1225 $ hg -R t id
1226 e95bcfa18a35
1226 e95bcfa18a35
1227
1227
1228 Sticky subrepositories, file changes
1228 Sticky subrepositories, file changes
1229 $ touch s/f1
1229 $ touch s/f1
1230 $ touch t/f1
1230 $ touch t/f1
1231 $ hg add -S s/f1
1231 $ hg add -S s/f1
1232 $ hg add -S t/f1
1232 $ hg add -S t/f1
1233 $ hg id
1233 $ hg id
1234 365661e5936a+
1234 365661e5936a+
1235 $ hg -R s id
1235 $ hg -R s id
1236 fc627a69481f+
1236 fc627a69481f+
1237 $ hg -R t id
1237 $ hg -R t id
1238 e95bcfa18a35+
1238 e95bcfa18a35+
1239 $ hg update tip
1239 $ hg update tip
1240 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
1240 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
1241 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1241 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1242 subrepository sources for s differ
1242 subrepository sources for s differ
1243 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l
1243 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l
1244 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
1244 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
1245 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1245 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1246 subrepository sources for t differ
1246 subrepository sources for t differ
1247 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l
1247 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l
1248 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1248 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1249 $ hg id
1249 $ hg id
1250 925c17564ef8+ tip
1250 925c17564ef8+ tip
1251 $ hg -R s id
1251 $ hg -R s id
1252 fc627a69481f+
1252 fc627a69481f+
1253 $ hg -R t id
1253 $ hg -R t id
1254 e95bcfa18a35+
1254 e95bcfa18a35+
1255 $ hg update --clean tip
1255 $ hg update --clean tip
1256 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1256 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1257
1257
1258 Sticky subrepository, revision updates
1258 Sticky subrepository, revision updates
1259 $ hg id
1259 $ hg id
1260 925c17564ef8 tip
1260 925c17564ef8 tip
1261 $ hg -R s id
1261 $ hg -R s id
1262 12a213df6fa9 tip
1262 12a213df6fa9 tip
1263 $ hg -R t id
1263 $ hg -R t id
1264 52c0adc0515a tip
1264 52c0adc0515a tip
1265 $ cd s
1265 $ cd s
1266 $ hg update -r -2
1266 $ hg update -r -2
1267 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1267 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1268 $ cd ../t
1268 $ cd ../t
1269 $ hg update -r 2
1269 $ hg update -r 2
1270 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1270 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1271 $ cd ..
1271 $ cd ..
1272 $ hg update 10
1272 $ hg update 10
1273 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1273 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1274 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1274 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1275 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1275 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1276 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1276 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1277 subrepository sources for t differ (in checked out version)
1277 subrepository sources for t differ (in checked out version)
1278 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l
1278 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l
1279 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1279 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1280 $ hg id
1280 $ hg id
1281 e45c8b14af55+
1281 e45c8b14af55+
1282 $ hg -R s id
1282 $ hg -R s id
1283 02dcf1d70411
1283 02dcf1d70411
1284 $ hg -R t id
1284 $ hg -R t id
1285 7af322bc1198
1285 7af322bc1198
1286
1286
1287 Sticky subrepository, file changes and revision updates
1287 Sticky subrepository, file changes and revision updates
1288 $ touch s/f1
1288 $ touch s/f1
1289 $ touch t/f1
1289 $ touch t/f1
1290 $ hg add -S s/f1
1290 $ hg add -S s/f1
1291 $ hg add -S t/f1
1291 $ hg add -S t/f1
1292 $ hg id
1292 $ hg id
1293 e45c8b14af55+
1293 e45c8b14af55+
1294 $ hg -R s id
1294 $ hg -R s id
1295 02dcf1d70411+
1295 02dcf1d70411+
1296 $ hg -R t id
1296 $ hg -R t id
1297 7af322bc1198+
1297 7af322bc1198+
1298 $ hg update tip
1298 $ hg update tip
1299 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1299 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1300 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1300 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1301 subrepository sources for s differ
1301 subrepository sources for s differ
1302 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l
1302 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l
1303 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1303 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1304 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1304 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1305 subrepository sources for t differ
1305 subrepository sources for t differ
1306 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l
1306 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l
1307 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1307 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1308 $ hg id
1308 $ hg id
1309 925c17564ef8+ tip
1309 925c17564ef8+ tip
1310 $ hg -R s id
1310 $ hg -R s id
1311 02dcf1d70411+
1311 02dcf1d70411+
1312 $ hg -R t id
1312 $ hg -R t id
1313 7af322bc1198+
1313 7af322bc1198+
1314
1314
1315 Sticky repository, update --clean
1315 Sticky repository, update --clean
1316 $ hg update --clean tip
1316 $ hg update --clean tip
1317 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1317 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1318 $ hg id
1318 $ hg id
1319 925c17564ef8 tip
1319 925c17564ef8 tip
1320 $ hg -R s id
1320 $ hg -R s id
1321 12a213df6fa9 tip
1321 12a213df6fa9 tip
1322 $ hg -R t id
1322 $ hg -R t id
1323 52c0adc0515a tip
1323 52c0adc0515a tip
1324
1324
1325 Test subrepo already at intended revision:
1325 Test subrepo already at intended revision:
1326 $ cd s
1326 $ cd s
1327 $ hg update fc627a69481f
1327 $ hg update fc627a69481f
1328 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1328 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1329 $ cd ..
1329 $ cd ..
1330 $ hg update 11
1330 $ hg update 11
1331 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1331 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1332 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1332 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1333 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1333 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1334 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1334 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1335 $ hg id -n
1335 $ hg id -n
1336 11+
1336 11+
1337 $ hg -R s id
1337 $ hg -R s id
1338 fc627a69481f
1338 fc627a69481f
1339 $ hg -R t id
1339 $ hg -R t id
1340 e95bcfa18a35
1340 e95bcfa18a35
1341
1341
1342 Test that removing .hgsubstate doesn't break anything:
1342 Test that removing .hgsubstate doesn't break anything:
1343
1343
1344 $ hg rm -f .hgsubstate
1344 $ hg rm -f .hgsubstate
1345 $ hg ci -mrm
1345 $ hg ci -mrm
1346 nothing changed
1346 nothing changed
1347 [1]
1347 [1]
1348 $ hg log -vr tip
1348 $ hg log -vr tip
1349 changeset: 13:925c17564ef8
1349 changeset: 13:925c17564ef8
1350 tag: tip
1350 tag: tip
1351 user: test
1351 user: test
1352 date: Thu Jan 01 00:00:00 1970 +0000
1352 date: Thu Jan 01 00:00:00 1970 +0000
1353 files: .hgsubstate
1353 files: .hgsubstate
1354 description:
1354 description:
1355 13
1355 13
1356
1356
1357
1357
1358
1358
1359 Test that removing .hgsub removes .hgsubstate:
1359 Test that removing .hgsub removes .hgsubstate:
1360
1360
1361 $ hg rm .hgsub
1361 $ hg rm .hgsub
1362 $ hg ci -mrm2
1362 $ hg ci -mrm2
1363 created new head
1363 created new head
1364 $ hg log -vr tip
1364 $ hg log -vr tip
1365 changeset: 14:2400bccd50af
1365 changeset: 14:2400bccd50af
1366 tag: tip
1366 tag: tip
1367 parent: 11:365661e5936a
1367 parent: 11:365661e5936a
1368 user: test
1368 user: test
1369 date: Thu Jan 01 00:00:00 1970 +0000
1369 date: Thu Jan 01 00:00:00 1970 +0000
1370 files: .hgsub .hgsubstate
1370 files: .hgsub .hgsubstate
1371 description:
1371 description:
1372 rm2
1372 rm2
1373
1373
1374
1374
1375 Test issue3153: diff -S with deleted subrepos
1375 Test issue3153: diff -S with deleted subrepos
1376
1376
1377 $ hg diff --nodates -S -c .
1377 $ hg diff --nodates -S -c .
1378 diff -r 365661e5936a -r 2400bccd50af .hgsub
1378 diff -r 365661e5936a -r 2400bccd50af .hgsub
1379 --- a/.hgsub
1379 --- a/.hgsub
1380 +++ /dev/null
1380 +++ /dev/null
1381 @@ -1,2 +0,0 @@
1381 @@ -1,2 +0,0 @@
1382 -s = s
1382 -s = s
1383 -t = t
1383 -t = t
1384 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1384 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1385 --- a/.hgsubstate
1385 --- a/.hgsubstate
1386 +++ /dev/null
1386 +++ /dev/null
1387 @@ -1,2 +0,0 @@
1387 @@ -1,2 +0,0 @@
1388 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1388 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1389 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1389 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1390
1390
1391 Test behavior of add for explicit path in subrepo:
1391 Test behavior of add for explicit path in subrepo:
1392 $ cd ..
1392 $ cd ..
1393 $ hg init explicit
1393 $ hg init explicit
1394 $ cd explicit
1394 $ cd explicit
1395 $ echo s = s > .hgsub
1395 $ echo s = s > .hgsub
1396 $ hg add .hgsub
1396 $ hg add .hgsub
1397 $ hg init s
1397 $ hg init s
1398 $ hg ci -m0
1398 $ hg ci -m0
1399 Adding with an explicit path in a subrepo adds the file
1399 Adding with an explicit path in a subrepo adds the file
1400 $ echo c1 > f1
1400 $ echo c1 > f1
1401 $ echo c2 > s/f2
1401 $ echo c2 > s/f2
1402 $ hg st -S
1402 $ hg st -S
1403 ? f1
1403 ? f1
1404 ? s/f2
1404 ? s/f2
1405 $ hg add s/f2
1405 $ hg add s/f2
1406 $ hg st -S
1406 $ hg st -S
1407 A s/f2
1407 A s/f2
1408 ? f1
1408 ? f1
1409 $ hg ci -R s -m0
1409 $ hg ci -R s -m0
1410 $ hg ci -Am1
1410 $ hg ci -Am1
1411 adding f1
1411 adding f1
1412 Adding with an explicit path in a subrepo with -S has the same behavior
1412 Adding with an explicit path in a subrepo with -S has the same behavior
1413 $ echo c3 > f3
1413 $ echo c3 > f3
1414 $ echo c4 > s/f4
1414 $ echo c4 > s/f4
1415 $ hg st -S
1415 $ hg st -S
1416 ? f3
1416 ? f3
1417 ? s/f4
1417 ? s/f4
1418 $ hg add -S s/f4
1418 $ hg add -S s/f4
1419 $ hg st -S
1419 $ hg st -S
1420 A s/f4
1420 A s/f4
1421 ? f3
1421 ? f3
1422 $ hg ci -R s -m1
1422 $ hg ci -R s -m1
1423 $ hg ci -Ama2
1423 $ hg ci -Ama2
1424 adding f3
1424 adding f3
1425 Adding without a path or pattern silently ignores subrepos
1425 Adding without a path or pattern silently ignores subrepos
1426 $ echo c5 > f5
1426 $ echo c5 > f5
1427 $ echo c6 > s/f6
1427 $ echo c6 > s/f6
1428 $ echo c7 > s/f7
1428 $ echo c7 > s/f7
1429 $ hg st -S
1429 $ hg st -S
1430 ? f5
1430 ? f5
1431 ? s/f6
1431 ? s/f6
1432 ? s/f7
1432 ? s/f7
1433 $ hg add
1433 $ hg add
1434 adding f5
1434 adding f5
1435 $ hg st -S
1435 $ hg st -S
1436 A f5
1436 A f5
1437 ? s/f6
1437 ? s/f6
1438 ? s/f7
1438 ? s/f7
1439 $ hg ci -R s -Am2
1439 $ hg ci -R s -Am2
1440 adding f6
1440 adding f6
1441 adding f7
1441 adding f7
1442 $ hg ci -m3
1442 $ hg ci -m3
1443 Adding without a path or pattern with -S also adds files in subrepos
1443 Adding without a path or pattern with -S also adds files in subrepos
1444 $ echo c8 > f8
1444 $ echo c8 > f8
1445 $ echo c9 > s/f9
1445 $ echo c9 > s/f9
1446 $ echo c10 > s/f10
1446 $ echo c10 > s/f10
1447 $ hg st -S
1447 $ hg st -S
1448 ? f8
1448 ? f8
1449 ? s/f10
1449 ? s/f10
1450 ? s/f9
1450 ? s/f9
1451 $ hg add -S
1451 $ hg add -S
1452 adding f8
1452 adding f8
1453 adding s/f10 (glob)
1453 adding s/f10 (glob)
1454 adding s/f9 (glob)
1454 adding s/f9 (glob)
1455 $ hg st -S
1455 $ hg st -S
1456 A f8
1456 A f8
1457 A s/f10
1457 A s/f10
1458 A s/f9
1458 A s/f9
1459 $ hg ci -R s -m3
1459 $ hg ci -R s -m3
1460 $ hg ci -m4
1460 $ hg ci -m4
1461 Adding with a pattern silently ignores subrepos
1461 Adding with a pattern silently ignores subrepos
1462 $ echo c11 > fm11
1462 $ echo c11 > fm11
1463 $ echo c12 > fn12
1463 $ echo c12 > fn12
1464 $ echo c13 > s/fm13
1464 $ echo c13 > s/fm13
1465 $ echo c14 > s/fn14
1465 $ echo c14 > s/fn14
1466 $ hg st -S
1466 $ hg st -S
1467 ? fm11
1467 ? fm11
1468 ? fn12
1468 ? fn12
1469 ? s/fm13
1469 ? s/fm13
1470 ? s/fn14
1470 ? s/fn14
1471 $ hg add 'glob:**fm*'
1471 $ hg add 'glob:**fm*'
1472 adding fm11
1472 adding fm11
1473 $ hg st -S
1473 $ hg st -S
1474 A fm11
1474 A fm11
1475 ? fn12
1475 ? fn12
1476 ? s/fm13
1476 ? s/fm13
1477 ? s/fn14
1477 ? s/fn14
1478 $ hg ci -R s -Am4
1478 $ hg ci -R s -Am4
1479 adding fm13
1479 adding fm13
1480 adding fn14
1480 adding fn14
1481 $ hg ci -Am5
1481 $ hg ci -Am5
1482 adding fn12
1482 adding fn12
1483 Adding with a pattern with -S also adds matches in subrepos
1483 Adding with a pattern with -S also adds matches in subrepos
1484 $ echo c15 > fm15
1484 $ echo c15 > fm15
1485 $ echo c16 > fn16
1485 $ echo c16 > fn16
1486 $ echo c17 > s/fm17
1486 $ echo c17 > s/fm17
1487 $ echo c18 > s/fn18
1487 $ echo c18 > s/fn18
1488 $ hg st -S
1488 $ hg st -S
1489 ? fm15
1489 ? fm15
1490 ? fn16
1490 ? fn16
1491 ? s/fm17
1491 ? s/fm17
1492 ? s/fn18
1492 ? s/fn18
1493 $ hg add -S 'glob:**fm*'
1493 $ hg add -S 'glob:**fm*'
1494 adding fm15
1494 adding fm15
1495 adding s/fm17 (glob)
1495 adding s/fm17 (glob)
1496 $ hg st -S
1496 $ hg st -S
1497 A fm15
1497 A fm15
1498 A s/fm17
1498 A s/fm17
1499 ? fn16
1499 ? fn16
1500 ? s/fn18
1500 ? s/fn18
1501 $ hg ci -R s -Am5
1501 $ hg ci -R s -Am5
1502 adding fn18
1502 adding fn18
1503 $ hg ci -Am6
1503 $ hg ci -Am6
1504 adding fn16
1504 adding fn16
1505
1505
1506 Test behavior of forget for explicit path in subrepo:
1506 Test behavior of forget for explicit path in subrepo:
1507 Forgetting an explicit path in a subrepo untracks the file
1507 Forgetting an explicit path in a subrepo untracks the file
1508 $ echo c19 > s/f19
1508 $ echo c19 > s/f19
1509 $ hg add s/f19
1509 $ hg add s/f19
1510 $ hg st -S
1510 $ hg st -S
1511 A s/f19
1511 A s/f19
1512 $ hg forget s/f19
1512 $ hg forget s/f19
1513 $ hg st -S
1513 $ hg st -S
1514 ? s/f19
1514 ? s/f19
1515 $ rm s/f19
1515 $ rm s/f19
1516 $ cd ..
1516 $ cd ..
1517
1517
1518 Courtesy phases synchronisation to publishing server does not block the push
1518 Courtesy phases synchronisation to publishing server does not block the push
1519 (issue3781)
1519 (issue3781)
1520
1520
1521 $ cp -r main issue3781
1521 $ cp -R main issue3781
1522 $ cp -r main issue3781-dest
1522 $ cp -R main issue3781-dest
1523 $ cd issue3781-dest/s
1523 $ cd issue3781-dest/s
1524 $ hg phase tip # show we have draft changeset
1524 $ hg phase tip # show we have draft changeset
1525 5: draft
1525 5: draft
1526 $ chmod a-w .hg/store/phaseroots # prevent phase push
1526 $ chmod a-w .hg/store/phaseroots # prevent phase push
1527 $ cd ../../issue3781
1527 $ cd ../../issue3781
1528 $ cat >> .hg/hgrc << EOF
1528 $ cat >> .hg/hgrc << EOF
1529 > [paths]
1529 > [paths]
1530 > default=../issue3781-dest/
1530 > default=../issue3781-dest/
1531 > EOF
1531 > EOF
1532 $ hg push --config devel.legacy.exchange=bundle1
1532 $ hg push --config devel.legacy.exchange=bundle1
1533 pushing to $TESTTMP/issue3781-dest (glob)
1533 pushing to $TESTTMP/issue3781-dest (glob)
1534 pushing subrepo s to $TESTTMP/issue3781-dest/s
1534 pushing subrepo s to $TESTTMP/issue3781-dest/s
1535 searching for changes
1535 searching for changes
1536 no changes found
1536 no changes found
1537 searching for changes
1537 searching for changes
1538 no changes found
1538 no changes found
1539 [1]
1539 [1]
1540 # clean the push cache
1540 # clean the push cache
1541 $ rm s/.hg/cache/storehash/*
1541 $ rm s/.hg/cache/storehash/*
1542 $ hg push # bundle2+
1542 $ hg push # bundle2+
1543 pushing to $TESTTMP/issue3781-dest (glob)
1543 pushing to $TESTTMP/issue3781-dest (glob)
1544 pushing subrepo s to $TESTTMP/issue3781-dest/s
1544 pushing subrepo s to $TESTTMP/issue3781-dest/s
1545 searching for changes
1545 searching for changes
1546 no changes found
1546 no changes found
1547 searching for changes
1547 searching for changes
1548 no changes found
1548 no changes found
1549 [1]
1549 [1]
1550 $ cd ..
1550 $ cd ..
1551
1551
1552 Test phase choice for newly created commit with "phases.subrepochecks"
1552 Test phase choice for newly created commit with "phases.subrepochecks"
1553 configuration
1553 configuration
1554
1554
1555 $ cd t
1555 $ cd t
1556 $ hg update -q -r 12
1556 $ hg update -q -r 12
1557
1557
1558 $ cat >> s/ss/.hg/hgrc <<EOF
1558 $ cat >> s/ss/.hg/hgrc <<EOF
1559 > [phases]
1559 > [phases]
1560 > new-commit = secret
1560 > new-commit = secret
1561 > EOF
1561 > EOF
1562 $ cat >> s/.hg/hgrc <<EOF
1562 $ cat >> s/.hg/hgrc <<EOF
1563 > [phases]
1563 > [phases]
1564 > new-commit = draft
1564 > new-commit = draft
1565 > EOF
1565 > EOF
1566 $ echo phasecheck1 >> s/ss/a
1566 $ echo phasecheck1 >> s/ss/a
1567 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1567 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1568 committing subrepository ss
1568 committing subrepository ss
1569 transaction abort!
1569 transaction abort!
1570 rollback completed
1570 rollback completed
1571 abort: can't commit in draft phase conflicting secret from subrepository ss
1571 abort: can't commit in draft phase conflicting secret from subrepository ss
1572 [255]
1572 [255]
1573 $ echo phasecheck2 >> s/ss/a
1573 $ echo phasecheck2 >> s/ss/a
1574 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1574 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1575 committing subrepository ss
1575 committing subrepository ss
1576 $ hg -R s/ss phase tip
1576 $ hg -R s/ss phase tip
1577 3: secret
1577 3: secret
1578 $ hg -R s phase tip
1578 $ hg -R s phase tip
1579 6: draft
1579 6: draft
1580 $ echo phasecheck3 >> s/ss/a
1580 $ echo phasecheck3 >> s/ss/a
1581 $ hg -R s commit -S -m phasecheck3
1581 $ hg -R s commit -S -m phasecheck3
1582 committing subrepository ss
1582 committing subrepository ss
1583 warning: changes are committed in secret phase from subrepository ss
1583 warning: changes are committed in secret phase from subrepository ss
1584 $ hg -R s/ss phase tip
1584 $ hg -R s/ss phase tip
1585 4: secret
1585 4: secret
1586 $ hg -R s phase tip
1586 $ hg -R s phase tip
1587 7: secret
1587 7: secret
1588
1588
1589 $ cat >> t/.hg/hgrc <<EOF
1589 $ cat >> t/.hg/hgrc <<EOF
1590 > [phases]
1590 > [phases]
1591 > new-commit = draft
1591 > new-commit = draft
1592 > EOF
1592 > EOF
1593 $ cat >> .hg/hgrc <<EOF
1593 $ cat >> .hg/hgrc <<EOF
1594 > [phases]
1594 > [phases]
1595 > new-commit = public
1595 > new-commit = public
1596 > EOF
1596 > EOF
1597 $ echo phasecheck4 >> s/ss/a
1597 $ echo phasecheck4 >> s/ss/a
1598 $ echo phasecheck4 >> t/t
1598 $ echo phasecheck4 >> t/t
1599 $ hg commit -S -m phasecheck4
1599 $ hg commit -S -m phasecheck4
1600 committing subrepository s
1600 committing subrepository s
1601 committing subrepository s/ss (glob)
1601 committing subrepository s/ss (glob)
1602 warning: changes are committed in secret phase from subrepository ss
1602 warning: changes are committed in secret phase from subrepository ss
1603 committing subrepository t
1603 committing subrepository t
1604 warning: changes are committed in secret phase from subrepository s
1604 warning: changes are committed in secret phase from subrepository s
1605 created new head
1605 created new head
1606 $ hg -R s/ss phase tip
1606 $ hg -R s/ss phase tip
1607 5: secret
1607 5: secret
1608 $ hg -R s phase tip
1608 $ hg -R s phase tip
1609 8: secret
1609 8: secret
1610 $ hg -R t phase tip
1610 $ hg -R t phase tip
1611 6: draft
1611 6: draft
1612 $ hg phase tip
1612 $ hg phase tip
1613 15: secret
1613 15: secret
1614
1614
1615 $ cd ..
1615 $ cd ..
1616
1616
1617
1617
1618 Test that commit --secret works on both repo and subrepo (issue4182)
1618 Test that commit --secret works on both repo and subrepo (issue4182)
1619
1619
1620 $ cd main
1620 $ cd main
1621 $ echo secret >> b
1621 $ echo secret >> b
1622 $ echo secret >> s/b
1622 $ echo secret >> s/b
1623 $ hg commit --secret --subrepo -m "secret"
1623 $ hg commit --secret --subrepo -m "secret"
1624 committing subrepository s
1624 committing subrepository s
1625 $ hg phase -r .
1625 $ hg phase -r .
1626 6: secret
1626 6: secret
1627 $ cd s
1627 $ cd s
1628 $ hg phase -r .
1628 $ hg phase -r .
1629 6: secret
1629 6: secret
1630 $ cd ../../
1630 $ cd ../../
1631
1631
1632 Test "subrepos" template keyword
1632 Test "subrepos" template keyword
1633
1633
1634 $ cd t
1634 $ cd t
1635 $ hg update -q 15
1635 $ hg update -q 15
1636 $ cat > .hgsub <<EOF
1636 $ cat > .hgsub <<EOF
1637 > s = s
1637 > s = s
1638 > EOF
1638 > EOF
1639 $ hg commit -m "16"
1639 $ hg commit -m "16"
1640 warning: changes are committed in secret phase from subrepository s
1640 warning: changes are committed in secret phase from subrepository s
1641
1641
1642 (addition of ".hgsub" itself)
1642 (addition of ".hgsub" itself)
1643
1643
1644 $ hg diff --nodates -c 1 .hgsubstate
1644 $ hg diff --nodates -c 1 .hgsubstate
1645 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1645 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1646 --- /dev/null
1646 --- /dev/null
1647 +++ b/.hgsubstate
1647 +++ b/.hgsubstate
1648 @@ -0,0 +1,1 @@
1648 @@ -0,0 +1,1 @@
1649 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1649 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1650 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1650 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1651 f7b1eb17ad24 000000000000
1651 f7b1eb17ad24 000000000000
1652 s
1652 s
1653
1653
1654 (modification of existing entry)
1654 (modification of existing entry)
1655
1655
1656 $ hg diff --nodates -c 2 .hgsubstate
1656 $ hg diff --nodates -c 2 .hgsubstate
1657 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1657 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1658 --- a/.hgsubstate
1658 --- a/.hgsubstate
1659 +++ b/.hgsubstate
1659 +++ b/.hgsubstate
1660 @@ -1,1 +1,1 @@
1660 @@ -1,1 +1,1 @@
1661 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1661 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1662 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1662 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1663 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1663 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1664 7cf8cfea66e4 000000000000
1664 7cf8cfea66e4 000000000000
1665 s
1665 s
1666
1666
1667 (addition of entry)
1667 (addition of entry)
1668
1668
1669 $ hg diff --nodates -c 5 .hgsubstate
1669 $ hg diff --nodates -c 5 .hgsubstate
1670 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1670 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1671 --- a/.hgsubstate
1671 --- a/.hgsubstate
1672 +++ b/.hgsubstate
1672 +++ b/.hgsubstate
1673 @@ -1,1 +1,2 @@
1673 @@ -1,1 +1,2 @@
1674 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1674 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1675 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1675 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1676 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1676 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1677 7cf8cfea66e4 000000000000
1677 7cf8cfea66e4 000000000000
1678 t
1678 t
1679
1679
1680 (removal of existing entry)
1680 (removal of existing entry)
1681
1681
1682 $ hg diff --nodates -c 16 .hgsubstate
1682 $ hg diff --nodates -c 16 .hgsubstate
1683 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1683 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1684 --- a/.hgsubstate
1684 --- a/.hgsubstate
1685 +++ b/.hgsubstate
1685 +++ b/.hgsubstate
1686 @@ -1,2 +1,1 @@
1686 @@ -1,2 +1,1 @@
1687 0731af8ca9423976d3743119d0865097c07bdc1b s
1687 0731af8ca9423976d3743119d0865097c07bdc1b s
1688 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1688 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1689 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1689 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1690 8bec38d2bd0b 000000000000
1690 8bec38d2bd0b 000000000000
1691 t
1691 t
1692
1692
1693 (merging)
1693 (merging)
1694
1694
1695 $ hg diff --nodates -c 9 .hgsubstate
1695 $ hg diff --nodates -c 9 .hgsubstate
1696 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1696 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1697 --- a/.hgsubstate
1697 --- a/.hgsubstate
1698 +++ b/.hgsubstate
1698 +++ b/.hgsubstate
1699 @@ -1,1 +1,2 @@
1699 @@ -1,1 +1,2 @@
1700 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1700 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1701 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1701 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1702 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1702 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1703 f6affe3fbfaa 1f14a2e2d3ec
1703 f6affe3fbfaa 1f14a2e2d3ec
1704 t
1704 t
1705
1705
1706 (removal of ".hgsub" itself)
1706 (removal of ".hgsub" itself)
1707
1707
1708 $ hg diff --nodates -c 8 .hgsubstate
1708 $ hg diff --nodates -c 8 .hgsubstate
1709 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1709 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1710 --- a/.hgsubstate
1710 --- a/.hgsubstate
1711 +++ /dev/null
1711 +++ /dev/null
1712 @@ -1,2 +0,0 @@
1712 @@ -1,2 +0,0 @@
1713 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1713 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1714 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1714 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1715 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1715 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1716 f94576341bcf 000000000000
1716 f94576341bcf 000000000000
1717
1717
1718 Test that '[paths]' is configured correctly at subrepo creation
1718 Test that '[paths]' is configured correctly at subrepo creation
1719
1719
1720 $ cd $TESTTMP/tc
1720 $ cd $TESTTMP/tc
1721 $ cat > .hgsub <<EOF
1721 $ cat > .hgsub <<EOF
1722 > # to clear bogus subrepo path 'bogus=[boguspath'
1722 > # to clear bogus subrepo path 'bogus=[boguspath'
1723 > s = s
1723 > s = s
1724 > t = t
1724 > t = t
1725 > EOF
1725 > EOF
1726 $ hg update -q --clean null
1726 $ hg update -q --clean null
1727 $ rm -rf s t
1727 $ rm -rf s t
1728 $ cat >> .hg/hgrc <<EOF
1728 $ cat >> .hg/hgrc <<EOF
1729 > [paths]
1729 > [paths]
1730 > default-push = /foo/bar
1730 > default-push = /foo/bar
1731 > EOF
1731 > EOF
1732 $ hg update -q
1732 $ hg update -q
1733 $ cat s/.hg/hgrc
1733 $ cat s/.hg/hgrc
1734 [paths]
1734 [paths]
1735 default = $TESTTMP/t/s
1735 default = $TESTTMP/t/s
1736 default-push = /foo/bar/s
1736 default-push = /foo/bar/s
1737 $ cat s/ss/.hg/hgrc
1737 $ cat s/ss/.hg/hgrc
1738 [paths]
1738 [paths]
1739 default = $TESTTMP/t/s/ss
1739 default = $TESTTMP/t/s/ss
1740 default-push = /foo/bar/s/ss
1740 default-push = /foo/bar/s/ss
1741 $ cat t/.hg/hgrc
1741 $ cat t/.hg/hgrc
1742 [paths]
1742 [paths]
1743 default = $TESTTMP/t/t
1743 default = $TESTTMP/t/t
1744 default-push = /foo/bar/t
1744 default-push = /foo/bar/t
1745
1745
1746 $ cd $TESTTMP/t
1746 $ cd $TESTTMP/t
1747 $ hg up -qC 0
1747 $ hg up -qC 0
1748 $ echo 'bar' > bar.txt
1748 $ echo 'bar' > bar.txt
1749 $ hg ci -Am 'branch before subrepo add'
1749 $ hg ci -Am 'branch before subrepo add'
1750 adding bar.txt
1750 adding bar.txt
1751 created new head
1751 created new head
1752 $ hg merge -r "first(subrepo('s'))"
1752 $ hg merge -r "first(subrepo('s'))"
1753 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1753 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1754 (branch merge, don't forget to commit)
1754 (branch merge, don't forget to commit)
1755 $ hg status -S -X '.hgsub*'
1755 $ hg status -S -X '.hgsub*'
1756 A s/a
1756 A s/a
1757 ? s/b
1757 ? s/b
1758 ? s/c
1758 ? s/c
1759 ? s/f1
1759 ? s/f1
1760 $ hg status -S --rev 'p2()'
1760 $ hg status -S --rev 'p2()'
1761 A bar.txt
1761 A bar.txt
1762 ? s/b
1762 ? s/b
1763 ? s/c
1763 ? s/c
1764 ? s/f1
1764 ? s/f1
1765 $ hg diff -S -X '.hgsub*' --nodates
1765 $ hg diff -S -X '.hgsub*' --nodates
1766 diff -r 000000000000 s/a
1766 diff -r 000000000000 s/a
1767 --- /dev/null
1767 --- /dev/null
1768 +++ b/s/a
1768 +++ b/s/a
1769 @@ -0,0 +1,1 @@
1769 @@ -0,0 +1,1 @@
1770 +a
1770 +a
1771 $ hg diff -S --rev 'p2()' --nodates
1771 $ hg diff -S --rev 'p2()' --nodates
1772 diff -r 7cf8cfea66e4 bar.txt
1772 diff -r 7cf8cfea66e4 bar.txt
1773 --- /dev/null
1773 --- /dev/null
1774 +++ b/bar.txt
1774 +++ b/bar.txt
1775 @@ -0,0 +1,1 @@
1775 @@ -0,0 +1,1 @@
1776 +bar
1776 +bar
1777
1777
1778 $ cd ..
1778 $ cd ..
@@ -1,827 +1,827 b''
1 #require killdaemons
1 #require killdaemons
2
2
3 $ cat << EOF >> $HGRCPATH
3 $ cat << EOF >> $HGRCPATH
4 > [format]
4 > [format]
5 > usegeneraldelta=yes
5 > usegeneraldelta=yes
6 > [ui]
6 > [ui]
7 > ssh=python "$TESTDIR/dummyssh"
7 > ssh=python "$TESTDIR/dummyssh"
8 > EOF
8 > EOF
9
9
10 Set up repo
10 Set up repo
11
11
12 $ hg --config experimental.treemanifest=True init repo
12 $ hg --config experimental.treemanifest=True init repo
13 $ cd repo
13 $ cd repo
14
14
15 Requirements get set on init
15 Requirements get set on init
16
16
17 $ grep treemanifest .hg/requires
17 $ grep treemanifest .hg/requires
18 treemanifest
18 treemanifest
19
19
20 Without directories, looks like any other repo
20 Without directories, looks like any other repo
21
21
22 $ echo 0 > a
22 $ echo 0 > a
23 $ echo 0 > b
23 $ echo 0 > b
24 $ hg ci -Aqm initial
24 $ hg ci -Aqm initial
25 $ hg debugdata -m 0
25 $ hg debugdata -m 0
26 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
26 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
27 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
27 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
28
28
29 Submanifest is stored in separate revlog
29 Submanifest is stored in separate revlog
30
30
31 $ mkdir dir1
31 $ mkdir dir1
32 $ echo 1 > dir1/a
32 $ echo 1 > dir1/a
33 $ echo 1 > dir1/b
33 $ echo 1 > dir1/b
34 $ echo 1 > e
34 $ echo 1 > e
35 $ hg ci -Aqm 'add dir1'
35 $ hg ci -Aqm 'add dir1'
36 $ hg debugdata -m 1
36 $ hg debugdata -m 1
37 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
37 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
38 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
38 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
39 dir1\x008b3ffd73f901e83304c83d33132c8e774ceac44et (esc)
39 dir1\x008b3ffd73f901e83304c83d33132c8e774ceac44et (esc)
40 e\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
40 e\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
41 $ hg debugdata --dir dir1 0
41 $ hg debugdata --dir dir1 0
42 a\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
42 a\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
43 b\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
43 b\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
44
44
45 Can add nested directories
45 Can add nested directories
46
46
47 $ mkdir dir1/dir1
47 $ mkdir dir1/dir1
48 $ echo 2 > dir1/dir1/a
48 $ echo 2 > dir1/dir1/a
49 $ echo 2 > dir1/dir1/b
49 $ echo 2 > dir1/dir1/b
50 $ mkdir dir1/dir2
50 $ mkdir dir1/dir2
51 $ echo 2 > dir1/dir2/a
51 $ echo 2 > dir1/dir2/a
52 $ echo 2 > dir1/dir2/b
52 $ echo 2 > dir1/dir2/b
53 $ hg ci -Aqm 'add dir1/dir1'
53 $ hg ci -Aqm 'add dir1/dir1'
54 $ hg files -r .
54 $ hg files -r .
55 a
55 a
56 b
56 b
57 dir1/a (glob)
57 dir1/a (glob)
58 dir1/b (glob)
58 dir1/b (glob)
59 dir1/dir1/a (glob)
59 dir1/dir1/a (glob)
60 dir1/dir1/b (glob)
60 dir1/dir1/b (glob)
61 dir1/dir2/a (glob)
61 dir1/dir2/a (glob)
62 dir1/dir2/b (glob)
62 dir1/dir2/b (glob)
63 e
63 e
64
64
65 The manifest command works
65 The manifest command works
66
66
67 $ hg manifest
67 $ hg manifest
68 a
68 a
69 b
69 b
70 dir1/a
70 dir1/a
71 dir1/b
71 dir1/b
72 dir1/dir1/a
72 dir1/dir1/a
73 dir1/dir1/b
73 dir1/dir1/b
74 dir1/dir2/a
74 dir1/dir2/a
75 dir1/dir2/b
75 dir1/dir2/b
76 e
76 e
77
77
78 Revision is not created for unchanged directory
78 Revision is not created for unchanged directory
79
79
80 $ mkdir dir2
80 $ mkdir dir2
81 $ echo 3 > dir2/a
81 $ echo 3 > dir2/a
82 $ hg add dir2
82 $ hg add dir2
83 adding dir2/a (glob)
83 adding dir2/a (glob)
84 $ hg debugindex --dir dir1 > before
84 $ hg debugindex --dir dir1 > before
85 $ hg ci -qm 'add dir2'
85 $ hg ci -qm 'add dir2'
86 $ hg debugindex --dir dir1 > after
86 $ hg debugindex --dir dir1 > after
87 $ diff before after
87 $ diff before after
88 $ rm before after
88 $ rm before after
89
89
90 Removing directory does not create an revlog entry
90 Removing directory does not create an revlog entry
91
91
92 $ hg rm dir1/dir1
92 $ hg rm dir1/dir1
93 removing dir1/dir1/a (glob)
93 removing dir1/dir1/a (glob)
94 removing dir1/dir1/b (glob)
94 removing dir1/dir1/b (glob)
95 $ hg debugindex --dir dir1/dir1 > before
95 $ hg debugindex --dir dir1/dir1 > before
96 $ hg ci -qm 'remove dir1/dir1'
96 $ hg ci -qm 'remove dir1/dir1'
97 $ hg debugindex --dir dir1/dir1 > after
97 $ hg debugindex --dir dir1/dir1 > after
98 $ diff before after
98 $ diff before after
99 $ rm before after
99 $ rm before after
100
100
101 Check that hg files (calls treemanifest.walk()) works
101 Check that hg files (calls treemanifest.walk()) works
102 without loading all directory revlogs
102 without loading all directory revlogs
103
103
104 $ hg co 'desc("add dir2")'
104 $ hg co 'desc("add dir2")'
105 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
105 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 $ mv .hg/store/meta/dir2 .hg/store/meta/dir2-backup
106 $ mv .hg/store/meta/dir2 .hg/store/meta/dir2-backup
107 $ hg files -r . dir1
107 $ hg files -r . dir1
108 dir1/a (glob)
108 dir1/a (glob)
109 dir1/b (glob)
109 dir1/b (glob)
110 dir1/dir1/a (glob)
110 dir1/dir1/a (glob)
111 dir1/dir1/b (glob)
111 dir1/dir1/b (glob)
112 dir1/dir2/a (glob)
112 dir1/dir2/a (glob)
113 dir1/dir2/b (glob)
113 dir1/dir2/b (glob)
114
114
115 Check that status between revisions works (calls treemanifest.matches())
115 Check that status between revisions works (calls treemanifest.matches())
116 without loading all directory revlogs
116 without loading all directory revlogs
117
117
118 $ hg status --rev 'desc("add dir1")' --rev . dir1
118 $ hg status --rev 'desc("add dir1")' --rev . dir1
119 A dir1/dir1/a
119 A dir1/dir1/a
120 A dir1/dir1/b
120 A dir1/dir1/b
121 A dir1/dir2/a
121 A dir1/dir2/a
122 A dir1/dir2/b
122 A dir1/dir2/b
123 $ mv .hg/store/meta/dir2-backup .hg/store/meta/dir2
123 $ mv .hg/store/meta/dir2-backup .hg/store/meta/dir2
124
124
125 Merge creates 2-parent revision of directory revlog
125 Merge creates 2-parent revision of directory revlog
126
126
127 $ echo 5 > dir1/a
127 $ echo 5 > dir1/a
128 $ hg ci -Aqm 'modify dir1/a'
128 $ hg ci -Aqm 'modify dir1/a'
129 $ hg co '.^'
129 $ hg co '.^'
130 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
130 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
131 $ echo 6 > dir1/b
131 $ echo 6 > dir1/b
132 $ hg ci -Aqm 'modify dir1/b'
132 $ hg ci -Aqm 'modify dir1/b'
133 $ hg merge 'desc("modify dir1/a")'
133 $ hg merge 'desc("modify dir1/a")'
134 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
135 (branch merge, don't forget to commit)
135 (branch merge, don't forget to commit)
136 $ hg ci -m 'conflict-free merge involving dir1/'
136 $ hg ci -m 'conflict-free merge involving dir1/'
137 $ cat dir1/a
137 $ cat dir1/a
138 5
138 5
139 $ cat dir1/b
139 $ cat dir1/b
140 6
140 6
141 $ hg debugindex --dir dir1
141 $ hg debugindex --dir dir1
142 rev offset length delta linkrev nodeid p1 p2
142 rev offset length delta linkrev nodeid p1 p2
143 0 0 54 -1 1 8b3ffd73f901 000000000000 000000000000
143 0 0 54 -1 1 8b3ffd73f901 000000000000 000000000000
144 1 54 68 0 2 68e9d057c5a8 8b3ffd73f901 000000000000
144 1 54 68 0 2 68e9d057c5a8 8b3ffd73f901 000000000000
145 2 122 12 1 4 4698198d2624 68e9d057c5a8 000000000000
145 2 122 12 1 4 4698198d2624 68e9d057c5a8 000000000000
146 3 134 55 1 5 44844058ccce 68e9d057c5a8 000000000000
146 3 134 55 1 5 44844058ccce 68e9d057c5a8 000000000000
147 4 189 55 1 6 bf3d9b744927 68e9d057c5a8 000000000000
147 4 189 55 1 6 bf3d9b744927 68e9d057c5a8 000000000000
148 5 244 55 4 7 dde7c0af2a03 bf3d9b744927 44844058ccce
148 5 244 55 4 7 dde7c0af2a03 bf3d9b744927 44844058ccce
149
149
150 Merge keeping directory from parent 1 does not create revlog entry. (Note that
150 Merge keeping directory from parent 1 does not create revlog entry. (Note that
151 dir1's manifest does change, but only because dir1/a's filelog changes.)
151 dir1's manifest does change, but only because dir1/a's filelog changes.)
152
152
153 $ hg co 'desc("add dir2")'
153 $ hg co 'desc("add dir2")'
154 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
154 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 $ echo 8 > dir2/a
155 $ echo 8 > dir2/a
156 $ hg ci -m 'modify dir2/a'
156 $ hg ci -m 'modify dir2/a'
157 created new head
157 created new head
158
158
159 $ hg debugindex --dir dir2 > before
159 $ hg debugindex --dir dir2 > before
160 $ hg merge 'desc("modify dir1/a")'
160 $ hg merge 'desc("modify dir1/a")'
161 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
161 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
162 (branch merge, don't forget to commit)
162 (branch merge, don't forget to commit)
163 $ hg revert -r 'desc("modify dir2/a")' .
163 $ hg revert -r 'desc("modify dir2/a")' .
164 reverting dir1/a (glob)
164 reverting dir1/a (glob)
165 $ hg ci -m 'merge, keeping parent 1'
165 $ hg ci -m 'merge, keeping parent 1'
166 $ hg debugindex --dir dir2 > after
166 $ hg debugindex --dir dir2 > after
167 $ diff before after
167 $ diff before after
168 $ rm before after
168 $ rm before after
169
169
170 Merge keeping directory from parent 2 does not create revlog entry. (Note that
170 Merge keeping directory from parent 2 does not create revlog entry. (Note that
171 dir2's manifest does change, but only because dir2/a's filelog changes.)
171 dir2's manifest does change, but only because dir2/a's filelog changes.)
172
172
173 $ hg co 'desc("modify dir2/a")'
173 $ hg co 'desc("modify dir2/a")'
174 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 $ hg debugindex --dir dir1 > before
175 $ hg debugindex --dir dir1 > before
176 $ hg merge 'desc("modify dir1/a")'
176 $ hg merge 'desc("modify dir1/a")'
177 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
177 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
178 (branch merge, don't forget to commit)
178 (branch merge, don't forget to commit)
179 $ hg revert -r 'desc("modify dir1/a")' .
179 $ hg revert -r 'desc("modify dir1/a")' .
180 reverting dir2/a (glob)
180 reverting dir2/a (glob)
181 $ hg ci -m 'merge, keeping parent 2'
181 $ hg ci -m 'merge, keeping parent 2'
182 created new head
182 created new head
183 $ hg debugindex --dir dir1 > after
183 $ hg debugindex --dir dir1 > after
184 $ diff before after
184 $ diff before after
185 $ rm before after
185 $ rm before after
186
186
187 Create flat source repo for tests with mixed flat/tree manifests
187 Create flat source repo for tests with mixed flat/tree manifests
188
188
189 $ cd ..
189 $ cd ..
190 $ hg init repo-flat
190 $ hg init repo-flat
191 $ cd repo-flat
191 $ cd repo-flat
192
192
193 Create a few commits with flat manifest
193 Create a few commits with flat manifest
194
194
195 $ echo 0 > a
195 $ echo 0 > a
196 $ echo 0 > b
196 $ echo 0 > b
197 $ echo 0 > e
197 $ echo 0 > e
198 $ for d in dir1 dir1/dir1 dir1/dir2 dir2
198 $ for d in dir1 dir1/dir1 dir1/dir2 dir2
199 > do
199 > do
200 > mkdir $d
200 > mkdir $d
201 > echo 0 > $d/a
201 > echo 0 > $d/a
202 > echo 0 > $d/b
202 > echo 0 > $d/b
203 > done
203 > done
204 $ hg ci -Aqm initial
204 $ hg ci -Aqm initial
205
205
206 $ echo 1 > a
206 $ echo 1 > a
207 $ echo 1 > dir1/a
207 $ echo 1 > dir1/a
208 $ echo 1 > dir1/dir1/a
208 $ echo 1 > dir1/dir1/a
209 $ hg ci -Aqm 'modify on branch 1'
209 $ hg ci -Aqm 'modify on branch 1'
210
210
211 $ hg co 0
211 $ hg co 0
212 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
212 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
213 $ echo 2 > b
213 $ echo 2 > b
214 $ echo 2 > dir1/b
214 $ echo 2 > dir1/b
215 $ echo 2 > dir1/dir1/b
215 $ echo 2 > dir1/dir1/b
216 $ hg ci -Aqm 'modify on branch 2'
216 $ hg ci -Aqm 'modify on branch 2'
217
217
218 $ hg merge 1
218 $ hg merge 1
219 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
219 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
220 (branch merge, don't forget to commit)
220 (branch merge, don't forget to commit)
221 $ hg ci -m 'merge of flat manifests to new flat manifest'
221 $ hg ci -m 'merge of flat manifests to new flat manifest'
222
222
223 $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
223 $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
224 $ cat hg.pid >> $DAEMON_PIDS
224 $ cat hg.pid >> $DAEMON_PIDS
225
225
226 Create clone with tree manifests enabled
226 Create clone with tree manifests enabled
227
227
228 $ cd ..
228 $ cd ..
229 $ hg clone --config experimental.treemanifest=1 \
229 $ hg clone --config experimental.treemanifest=1 \
230 > http://localhost:$HGPORT repo-mixed -r 1
230 > http://localhost:$HGPORT repo-mixed -r 1
231 adding changesets
231 adding changesets
232 adding manifests
232 adding manifests
233 adding file changes
233 adding file changes
234 added 2 changesets with 14 changes to 11 files
234 added 2 changesets with 14 changes to 11 files
235 updating to branch default
235 updating to branch default
236 11 files updated, 0 files merged, 0 files removed, 0 files unresolved
236 11 files updated, 0 files merged, 0 files removed, 0 files unresolved
237 $ cd repo-mixed
237 $ cd repo-mixed
238 $ test -d .hg/store/meta
238 $ test -d .hg/store/meta
239 [1]
239 [1]
240 $ grep treemanifest .hg/requires
240 $ grep treemanifest .hg/requires
241 treemanifest
241 treemanifest
242
242
243 Should be possible to push updates from flat to tree manifest repo
243 Should be possible to push updates from flat to tree manifest repo
244
244
245 $ hg -R ../repo-flat push ssh://user@dummy/repo-mixed
245 $ hg -R ../repo-flat push ssh://user@dummy/repo-mixed
246 pushing to ssh://user@dummy/repo-mixed
246 pushing to ssh://user@dummy/repo-mixed
247 searching for changes
247 searching for changes
248 remote: adding changesets
248 remote: adding changesets
249 remote: adding manifests
249 remote: adding manifests
250 remote: adding file changes
250 remote: adding file changes
251 remote: added 2 changesets with 3 changes to 3 files
251 remote: added 2 changesets with 3 changes to 3 files
252
252
253 Commit should store revlog per directory
253 Commit should store revlog per directory
254
254
255 $ hg co 1
255 $ hg co 1
256 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 $ echo 3 > a
257 $ echo 3 > a
258 $ echo 3 > dir1/a
258 $ echo 3 > dir1/a
259 $ echo 3 > dir1/dir1/a
259 $ echo 3 > dir1/dir1/a
260 $ hg ci -m 'first tree'
260 $ hg ci -m 'first tree'
261 created new head
261 created new head
262 $ find .hg/store/meta | sort
262 $ find .hg/store/meta | sort
263 .hg/store/meta
263 .hg/store/meta
264 .hg/store/meta/dir1
264 .hg/store/meta/dir1
265 .hg/store/meta/dir1/00manifest.i
265 .hg/store/meta/dir1/00manifest.i
266 .hg/store/meta/dir1/dir1
266 .hg/store/meta/dir1/dir1
267 .hg/store/meta/dir1/dir1/00manifest.i
267 .hg/store/meta/dir1/dir1/00manifest.i
268 .hg/store/meta/dir1/dir2
268 .hg/store/meta/dir1/dir2
269 .hg/store/meta/dir1/dir2/00manifest.i
269 .hg/store/meta/dir1/dir2/00manifest.i
270 .hg/store/meta/dir2
270 .hg/store/meta/dir2
271 .hg/store/meta/dir2/00manifest.i
271 .hg/store/meta/dir2/00manifest.i
272
272
273 Merge of two trees
273 Merge of two trees
274
274
275 $ hg co 2
275 $ hg co 2
276 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 $ hg merge 1
277 $ hg merge 1
278 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
278 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 (branch merge, don't forget to commit)
279 (branch merge, don't forget to commit)
280 $ hg ci -m 'merge of flat manifests to new tree manifest'
280 $ hg ci -m 'merge of flat manifests to new tree manifest'
281 created new head
281 created new head
282 $ hg diff -r 3
282 $ hg diff -r 3
283
283
284 Parent of tree root manifest should be flat manifest, and two for merge
284 Parent of tree root manifest should be flat manifest, and two for merge
285
285
286 $ hg debugindex -m
286 $ hg debugindex -m
287 rev offset length delta linkrev nodeid p1 p2
287 rev offset length delta linkrev nodeid p1 p2
288 0 0 80 -1 0 40536115ed9e 000000000000 000000000000
288 0 0 80 -1 0 40536115ed9e 000000000000 000000000000
289 1 80 83 0 1 f3376063c255 40536115ed9e 000000000000
289 1 80 83 0 1 f3376063c255 40536115ed9e 000000000000
290 2 163 89 0 2 5d9b9da231a2 40536115ed9e 000000000000
290 2 163 89 0 2 5d9b9da231a2 40536115ed9e 000000000000
291 3 252 83 2 3 d17d663cbd8a 5d9b9da231a2 f3376063c255
291 3 252 83 2 3 d17d663cbd8a 5d9b9da231a2 f3376063c255
292 4 335 124 1 4 51e32a8c60ee f3376063c255 000000000000
292 4 335 124 1 4 51e32a8c60ee f3376063c255 000000000000
293 5 459 126 2 5 cc5baa78b230 5d9b9da231a2 f3376063c255
293 5 459 126 2 5 cc5baa78b230 5d9b9da231a2 f3376063c255
294
294
295
295
296 Status across flat/tree boundary should work
296 Status across flat/tree boundary should work
297
297
298 $ hg status --rev '.^' --rev .
298 $ hg status --rev '.^' --rev .
299 M a
299 M a
300 M dir1/a
300 M dir1/a
301 M dir1/dir1/a
301 M dir1/dir1/a
302
302
303
303
304 Turning off treemanifest config has no effect
304 Turning off treemanifest config has no effect
305
305
306 $ hg debugindex --dir dir1
306 $ hg debugindex --dir dir1
307 rev offset length delta linkrev nodeid p1 p2
307 rev offset length delta linkrev nodeid p1 p2
308 0 0 127 -1 4 064927a0648a 000000000000 000000000000
308 0 0 127 -1 4 064927a0648a 000000000000 000000000000
309 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000
309 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000
310 $ echo 2 > dir1/a
310 $ echo 2 > dir1/a
311 $ hg --config experimental.treemanifest=False ci -qm 'modify dir1/a'
311 $ hg --config experimental.treemanifest=False ci -qm 'modify dir1/a'
312 $ hg debugindex --dir dir1
312 $ hg debugindex --dir dir1
313 rev offset length delta linkrev nodeid p1 p2
313 rev offset length delta linkrev nodeid p1 p2
314 0 0 127 -1 4 064927a0648a 000000000000 000000000000
314 0 0 127 -1 4 064927a0648a 000000000000 000000000000
315 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000
315 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000
316 2 238 55 1 6 5b16163a30c6 25ecb8cb8618 000000000000
316 2 238 55 1 6 5b16163a30c6 25ecb8cb8618 000000000000
317
317
318 Stripping and recovering changes should work
318 Stripping and recovering changes should work
319
319
320 $ hg st --change tip
320 $ hg st --change tip
321 M dir1/a
321 M dir1/a
322 $ hg --config extensions.strip= strip tip
322 $ hg --config extensions.strip= strip tip
323 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
324 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg (glob)
324 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg (glob)
325 $ hg debugindex --dir dir1
325 $ hg debugindex --dir dir1
326 rev offset length delta linkrev nodeid p1 p2
326 rev offset length delta linkrev nodeid p1 p2
327 0 0 127 -1 4 064927a0648a 000000000000 000000000000
327 0 0 127 -1 4 064927a0648a 000000000000 000000000000
328 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000
328 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000
329 $ hg incoming .hg/strip-backup/*
329 $ hg incoming .hg/strip-backup/*
330 comparing with .hg/strip-backup/*-backup.hg (glob)
330 comparing with .hg/strip-backup/*-backup.hg (glob)
331 searching for changes
331 searching for changes
332 changeset: 6:51cfd7b1e13b
332 changeset: 6:51cfd7b1e13b
333 tag: tip
333 tag: tip
334 user: test
334 user: test
335 date: Thu Jan 01 00:00:00 1970 +0000
335 date: Thu Jan 01 00:00:00 1970 +0000
336 summary: modify dir1/a
336 summary: modify dir1/a
337
337
338 $ hg pull .hg/strip-backup/*
338 $ hg pull .hg/strip-backup/*
339 pulling from .hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg
339 pulling from .hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg
340 searching for changes
340 searching for changes
341 adding changesets
341 adding changesets
342 adding manifests
342 adding manifests
343 adding file changes
343 adding file changes
344 added 1 changesets with 1 changes to 1 files
344 added 1 changesets with 1 changes to 1 files
345 (run 'hg update' to get a working copy)
345 (run 'hg update' to get a working copy)
346 $ hg --config extensions.strip= strip tip
346 $ hg --config extensions.strip= strip tip
347 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/*-backup.hg (glob)
347 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/*-backup.hg (glob)
348 $ hg unbundle -q .hg/strip-backup/*
348 $ hg unbundle -q .hg/strip-backup/*
349 $ hg debugindex --dir dir1
349 $ hg debugindex --dir dir1
350 rev offset length delta linkrev nodeid p1 p2
350 rev offset length delta linkrev nodeid p1 p2
351 0 0 127 -1 4 064927a0648a 000000000000 000000000000
351 0 0 127 -1 4 064927a0648a 000000000000 000000000000
352 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000
352 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000
353 2 238 55 1 6 5b16163a30c6 25ecb8cb8618 000000000000
353 2 238 55 1 6 5b16163a30c6 25ecb8cb8618 000000000000
354 $ hg st --change tip
354 $ hg st --change tip
355 M dir1/a
355 M dir1/a
356
356
357 Shelving and unshelving should work
357 Shelving and unshelving should work
358
358
359 $ echo foo >> dir1/a
359 $ echo foo >> dir1/a
360 $ hg --config extensions.shelve= shelve
360 $ hg --config extensions.shelve= shelve
361 shelved as default
361 shelved as default
362 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
362 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
363 $ hg --config extensions.shelve= unshelve
363 $ hg --config extensions.shelve= unshelve
364 unshelving change 'default'
364 unshelving change 'default'
365 $ hg diff --nodates
365 $ hg diff --nodates
366 diff -r 708a273da119 dir1/a
366 diff -r 708a273da119 dir1/a
367 --- a/dir1/a
367 --- a/dir1/a
368 +++ b/dir1/a
368 +++ b/dir1/a
369 @@ -1,1 +1,2 @@
369 @@ -1,1 +1,2 @@
370 1
370 1
371 +foo
371 +foo
372
372
373 Pushing from treemanifest repo to an empty repo makes that a treemanifest repo
373 Pushing from treemanifest repo to an empty repo makes that a treemanifest repo
374
374
375 $ cd ..
375 $ cd ..
376 $ hg init empty-repo
376 $ hg init empty-repo
377 $ cat << EOF >> empty-repo/.hg/hgrc
377 $ cat << EOF >> empty-repo/.hg/hgrc
378 > [experimental]
378 > [experimental]
379 > changegroup3=yes
379 > changegroup3=yes
380 > EOF
380 > EOF
381 $ grep treemanifest empty-repo/.hg/requires
381 $ grep treemanifest empty-repo/.hg/requires
382 [1]
382 [1]
383 $ hg push -R repo -r 0 empty-repo
383 $ hg push -R repo -r 0 empty-repo
384 pushing to empty-repo
384 pushing to empty-repo
385 searching for changes
385 searching for changes
386 adding changesets
386 adding changesets
387 adding manifests
387 adding manifests
388 adding file changes
388 adding file changes
389 added 1 changesets with 2 changes to 2 files
389 added 1 changesets with 2 changes to 2 files
390 $ grep treemanifest empty-repo/.hg/requires
390 $ grep treemanifest empty-repo/.hg/requires
391 treemanifest
391 treemanifest
392
392
393 Pushing to an empty repo works
393 Pushing to an empty repo works
394
394
395 $ hg --config experimental.treemanifest=1 init clone
395 $ hg --config experimental.treemanifest=1 init clone
396 $ grep treemanifest clone/.hg/requires
396 $ grep treemanifest clone/.hg/requires
397 treemanifest
397 treemanifest
398 $ hg push -R repo clone
398 $ hg push -R repo clone
399 pushing to clone
399 pushing to clone
400 searching for changes
400 searching for changes
401 adding changesets
401 adding changesets
402 adding manifests
402 adding manifests
403 adding file changes
403 adding file changes
404 added 11 changesets with 15 changes to 10 files (+3 heads)
404 added 11 changesets with 15 changes to 10 files (+3 heads)
405 $ grep treemanifest clone/.hg/requires
405 $ grep treemanifest clone/.hg/requires
406 treemanifest
406 treemanifest
407 $ hg -R clone verify
407 $ hg -R clone verify
408 checking changesets
408 checking changesets
409 checking manifests
409 checking manifests
410 checking directory manifests
410 checking directory manifests
411 crosschecking files in changesets and manifests
411 crosschecking files in changesets and manifests
412 checking files
412 checking files
413 10 files, 11 changesets, 15 total revisions
413 10 files, 11 changesets, 15 total revisions
414
414
415 Create deeper repo with tree manifests.
415 Create deeper repo with tree manifests.
416
416
417 $ hg --config experimental.treemanifest=True init deeprepo
417 $ hg --config experimental.treemanifest=True init deeprepo
418 $ cd deeprepo
418 $ cd deeprepo
419
419
420 $ mkdir .A
420 $ mkdir .A
421 $ mkdir b
421 $ mkdir b
422 $ mkdir b/bar
422 $ mkdir b/bar
423 $ mkdir b/bar/orange
423 $ mkdir b/bar/orange
424 $ mkdir b/bar/orange/fly
424 $ mkdir b/bar/orange/fly
425 $ mkdir b/foo
425 $ mkdir b/foo
426 $ mkdir b/foo/apple
426 $ mkdir b/foo/apple
427 $ mkdir b/foo/apple/bees
427 $ mkdir b/foo/apple/bees
428
428
429 $ touch .A/one.txt
429 $ touch .A/one.txt
430 $ touch .A/two.txt
430 $ touch .A/two.txt
431 $ touch b/bar/fruits.txt
431 $ touch b/bar/fruits.txt
432 $ touch b/bar/orange/fly/gnat.py
432 $ touch b/bar/orange/fly/gnat.py
433 $ touch b/bar/orange/fly/housefly.txt
433 $ touch b/bar/orange/fly/housefly.txt
434 $ touch b/foo/apple/bees/flower.py
434 $ touch b/foo/apple/bees/flower.py
435 $ touch c.txt
435 $ touch c.txt
436 $ touch d.py
436 $ touch d.py
437
437
438 $ hg ci -Aqm 'initial'
438 $ hg ci -Aqm 'initial'
439
439
440 We'll see that visitdir works by removing some treemanifest revlogs and running
440 We'll see that visitdir works by removing some treemanifest revlogs and running
441 the files command with various parameters.
441 the files command with various parameters.
442
442
443 Test files from the root.
443 Test files from the root.
444
444
445 $ hg files -r .
445 $ hg files -r .
446 .A/one.txt (glob)
446 .A/one.txt (glob)
447 .A/two.txt (glob)
447 .A/two.txt (glob)
448 b/bar/fruits.txt (glob)
448 b/bar/fruits.txt (glob)
449 b/bar/orange/fly/gnat.py (glob)
449 b/bar/orange/fly/gnat.py (glob)
450 b/bar/orange/fly/housefly.txt (glob)
450 b/bar/orange/fly/housefly.txt (glob)
451 b/foo/apple/bees/flower.py (glob)
451 b/foo/apple/bees/flower.py (glob)
452 c.txt
452 c.txt
453 d.py
453 d.py
454
454
455 Excludes with a glob should not exclude everything from the glob's root
455 Excludes with a glob should not exclude everything from the glob's root
456
456
457 $ hg files -r . -X 'b/fo?' b
457 $ hg files -r . -X 'b/fo?' b
458 b/bar/fruits.txt (glob)
458 b/bar/fruits.txt (glob)
459 b/bar/orange/fly/gnat.py (glob)
459 b/bar/orange/fly/gnat.py (glob)
460 b/bar/orange/fly/housefly.txt (glob)
460 b/bar/orange/fly/housefly.txt (glob)
461 $ cp -r .hg/store .hg/store-copy
461 $ cp -R .hg/store .hg/store-copy
462
462
463 Test files for a subdirectory.
463 Test files for a subdirectory.
464
464
465 $ rm -r .hg/store/meta/~2e_a
465 $ rm -r .hg/store/meta/~2e_a
466 $ hg files -r . b
466 $ hg files -r . b
467 b/bar/fruits.txt (glob)
467 b/bar/fruits.txt (glob)
468 b/bar/orange/fly/gnat.py (glob)
468 b/bar/orange/fly/gnat.py (glob)
469 b/bar/orange/fly/housefly.txt (glob)
469 b/bar/orange/fly/housefly.txt (glob)
470 b/foo/apple/bees/flower.py (glob)
470 b/foo/apple/bees/flower.py (glob)
471 $ cp -r .hg/store-copy/. .hg/store
471 $ cp -R .hg/store-copy/. .hg/store
472
472
473 Test files with just includes and excludes.
473 Test files with just includes and excludes.
474
474
475 $ rm -r .hg/store/meta/~2e_a
475 $ rm -r .hg/store/meta/~2e_a
476 $ rm -r .hg/store/meta/b/bar/orange/fly
476 $ rm -r .hg/store/meta/b/bar/orange/fly
477 $ rm -r .hg/store/meta/b/foo/apple/bees
477 $ rm -r .hg/store/meta/b/foo/apple/bees
478 $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
478 $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
479 b/bar/fruits.txt (glob)
479 b/bar/fruits.txt (glob)
480 $ cp -r .hg/store-copy/. .hg/store
480 $ cp -R .hg/store-copy/. .hg/store
481
481
482 Test files for a subdirectory, excluding a directory within it.
482 Test files for a subdirectory, excluding a directory within it.
483
483
484 $ rm -r .hg/store/meta/~2e_a
484 $ rm -r .hg/store/meta/~2e_a
485 $ rm -r .hg/store/meta/b/foo
485 $ rm -r .hg/store/meta/b/foo
486 $ hg files -r . -X path:b/foo b
486 $ hg files -r . -X path:b/foo b
487 b/bar/fruits.txt (glob)
487 b/bar/fruits.txt (glob)
488 b/bar/orange/fly/gnat.py (glob)
488 b/bar/orange/fly/gnat.py (glob)
489 b/bar/orange/fly/housefly.txt (glob)
489 b/bar/orange/fly/housefly.txt (glob)
490 $ cp -r .hg/store-copy/. .hg/store
490 $ cp -R .hg/store-copy/. .hg/store
491
491
492 Test files for a sub directory, including only a directory within it, and
492 Test files for a sub directory, including only a directory within it, and
493 including an unrelated directory.
493 including an unrelated directory.
494
494
495 $ rm -r .hg/store/meta/~2e_a
495 $ rm -r .hg/store/meta/~2e_a
496 $ rm -r .hg/store/meta/b/foo
496 $ rm -r .hg/store/meta/b/foo
497 $ hg files -r . -I path:b/bar/orange -I path:a b
497 $ hg files -r . -I path:b/bar/orange -I path:a b
498 b/bar/orange/fly/gnat.py (glob)
498 b/bar/orange/fly/gnat.py (glob)
499 b/bar/orange/fly/housefly.txt (glob)
499 b/bar/orange/fly/housefly.txt (glob)
500 $ cp -r .hg/store-copy/. .hg/store
500 $ cp -R .hg/store-copy/. .hg/store
501
501
502 Test files for a pattern, including a directory, and excluding a directory
502 Test files for a pattern, including a directory, and excluding a directory
503 within that.
503 within that.
504
504
505 $ rm -r .hg/store/meta/~2e_a
505 $ rm -r .hg/store/meta/~2e_a
506 $ rm -r .hg/store/meta/b/foo
506 $ rm -r .hg/store/meta/b/foo
507 $ rm -r .hg/store/meta/b/bar/orange
507 $ rm -r .hg/store/meta/b/bar/orange
508 $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange
508 $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange
509 b/bar/fruits.txt (glob)
509 b/bar/fruits.txt (glob)
510 $ cp -r .hg/store-copy/. .hg/store
510 $ cp -R .hg/store-copy/. .hg/store
511
511
512 Add some more changes to the deep repo
512 Add some more changes to the deep repo
513 $ echo narf >> b/bar/fruits.txt
513 $ echo narf >> b/bar/fruits.txt
514 $ hg ci -m narf
514 $ hg ci -m narf
515 $ echo troz >> b/bar/orange/fly/gnat.py
515 $ echo troz >> b/bar/orange/fly/gnat.py
516 $ hg ci -m troz
516 $ hg ci -m troz
517
517
518 Verify works
518 Verify works
519 $ hg verify
519 $ hg verify
520 checking changesets
520 checking changesets
521 checking manifests
521 checking manifests
522 checking directory manifests
522 checking directory manifests
523 crosschecking files in changesets and manifests
523 crosschecking files in changesets and manifests
524 checking files
524 checking files
525 8 files, 3 changesets, 10 total revisions
525 8 files, 3 changesets, 10 total revisions
526
526
527 Dirlogs are included in fncache
527 Dirlogs are included in fncache
528 $ grep meta/.A/00manifest.i .hg/store/fncache
528 $ grep meta/.A/00manifest.i .hg/store/fncache
529 meta/.A/00manifest.i
529 meta/.A/00manifest.i
530
530
531 Rebuilt fncache includes dirlogs
531 Rebuilt fncache includes dirlogs
532 $ rm .hg/store/fncache
532 $ rm .hg/store/fncache
533 $ hg debugrebuildfncache
533 $ hg debugrebuildfncache
534 adding data/.A/one.txt.i
534 adding data/.A/one.txt.i
535 adding data/.A/two.txt.i
535 adding data/.A/two.txt.i
536 adding data/b/bar/fruits.txt.i
536 adding data/b/bar/fruits.txt.i
537 adding data/b/bar/orange/fly/gnat.py.i
537 adding data/b/bar/orange/fly/gnat.py.i
538 adding data/b/bar/orange/fly/housefly.txt.i
538 adding data/b/bar/orange/fly/housefly.txt.i
539 adding data/b/foo/apple/bees/flower.py.i
539 adding data/b/foo/apple/bees/flower.py.i
540 adding data/c.txt.i
540 adding data/c.txt.i
541 adding data/d.py.i
541 adding data/d.py.i
542 adding meta/.A/00manifest.i
542 adding meta/.A/00manifest.i
543 adding meta/b/00manifest.i
543 adding meta/b/00manifest.i
544 adding meta/b/bar/00manifest.i
544 adding meta/b/bar/00manifest.i
545 adding meta/b/bar/orange/00manifest.i
545 adding meta/b/bar/orange/00manifest.i
546 adding meta/b/bar/orange/fly/00manifest.i
546 adding meta/b/bar/orange/fly/00manifest.i
547 adding meta/b/foo/00manifest.i
547 adding meta/b/foo/00manifest.i
548 adding meta/b/foo/apple/00manifest.i
548 adding meta/b/foo/apple/00manifest.i
549 adding meta/b/foo/apple/bees/00manifest.i
549 adding meta/b/foo/apple/bees/00manifest.i
550 16 items added, 0 removed from fncache
550 16 items added, 0 removed from fncache
551
551
552 Finish first server
552 Finish first server
553 $ killdaemons.py
553 $ killdaemons.py
554
554
555 Back up the recently added revlogs
555 Back up the recently added revlogs
556 $ cp -r .hg/store .hg/store-newcopy
556 $ cp -R .hg/store .hg/store-newcopy
557
557
558 Verify reports missing dirlog
558 Verify reports missing dirlog
559 $ rm .hg/store/meta/b/00manifest.*
559 $ rm .hg/store/meta/b/00manifest.*
560 $ hg verify
560 $ hg verify
561 checking changesets
561 checking changesets
562 checking manifests
562 checking manifests
563 checking directory manifests
563 checking directory manifests
564 0: empty or missing b/
564 0: empty or missing b/
565 b/@0: parent-directory manifest refers to unknown revision 67688a370455
565 b/@0: parent-directory manifest refers to unknown revision 67688a370455
566 b/@1: parent-directory manifest refers to unknown revision f38e85d334c5
566 b/@1: parent-directory manifest refers to unknown revision f38e85d334c5
567 b/@2: parent-directory manifest refers to unknown revision 99c9792fd4b0
567 b/@2: parent-directory manifest refers to unknown revision 99c9792fd4b0
568 warning: orphan revlog 'meta/b/bar/00manifest.i'
568 warning: orphan revlog 'meta/b/bar/00manifest.i'
569 warning: orphan revlog 'meta/b/bar/orange/00manifest.i'
569 warning: orphan revlog 'meta/b/bar/orange/00manifest.i'
570 warning: orphan revlog 'meta/b/bar/orange/fly/00manifest.i'
570 warning: orphan revlog 'meta/b/bar/orange/fly/00manifest.i'
571 warning: orphan revlog 'meta/b/foo/00manifest.i'
571 warning: orphan revlog 'meta/b/foo/00manifest.i'
572 warning: orphan revlog 'meta/b/foo/apple/00manifest.i'
572 warning: orphan revlog 'meta/b/foo/apple/00manifest.i'
573 warning: orphan revlog 'meta/b/foo/apple/bees/00manifest.i'
573 warning: orphan revlog 'meta/b/foo/apple/bees/00manifest.i'
574 crosschecking files in changesets and manifests
574 crosschecking files in changesets and manifests
575 b/bar/fruits.txt@0: in changeset but not in manifest
575 b/bar/fruits.txt@0: in changeset but not in manifest
576 b/bar/orange/fly/gnat.py@0: in changeset but not in manifest
576 b/bar/orange/fly/gnat.py@0: in changeset but not in manifest
577 b/bar/orange/fly/housefly.txt@0: in changeset but not in manifest
577 b/bar/orange/fly/housefly.txt@0: in changeset but not in manifest
578 b/foo/apple/bees/flower.py@0: in changeset but not in manifest
578 b/foo/apple/bees/flower.py@0: in changeset but not in manifest
579 checking files
579 checking files
580 8 files, 3 changesets, 10 total revisions
580 8 files, 3 changesets, 10 total revisions
581 6 warnings encountered!
581 6 warnings encountered!
582 8 integrity errors encountered!
582 8 integrity errors encountered!
583 (first damaged changeset appears to be 0)
583 (first damaged changeset appears to be 0)
584 [1]
584 [1]
585 $ cp -r .hg/store-newcopy/. .hg/store
585 $ cp -R .hg/store-newcopy/. .hg/store
586
586
587 Verify reports missing dirlog entry
587 Verify reports missing dirlog entry
588 $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/
588 $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/
589 $ hg verify
589 $ hg verify
590 checking changesets
590 checking changesets
591 checking manifests
591 checking manifests
592 checking directory manifests
592 checking directory manifests
593 b/@1: parent-directory manifest refers to unknown revision f38e85d334c5
593 b/@1: parent-directory manifest refers to unknown revision f38e85d334c5
594 b/@2: parent-directory manifest refers to unknown revision 99c9792fd4b0
594 b/@2: parent-directory manifest refers to unknown revision 99c9792fd4b0
595 b/bar/@?: rev 1 points to unexpected changeset 1
595 b/bar/@?: rev 1 points to unexpected changeset 1
596 b/bar/@?: 5e03c4ee5e4a not in parent-directory manifest
596 b/bar/@?: 5e03c4ee5e4a not in parent-directory manifest
597 b/bar/@?: rev 2 points to unexpected changeset 2
597 b/bar/@?: rev 2 points to unexpected changeset 2
598 b/bar/@?: 1b16940d66d6 not in parent-directory manifest
598 b/bar/@?: 1b16940d66d6 not in parent-directory manifest
599 b/bar/orange/@?: rev 1 points to unexpected changeset 2
599 b/bar/orange/@?: rev 1 points to unexpected changeset 2
600 (expected None)
600 (expected None)
601 b/bar/orange/fly/@?: rev 1 points to unexpected changeset 2
601 b/bar/orange/fly/@?: rev 1 points to unexpected changeset 2
602 (expected None)
602 (expected None)
603 crosschecking files in changesets and manifests
603 crosschecking files in changesets and manifests
604 checking files
604 checking files
605 8 files, 3 changesets, 10 total revisions
605 8 files, 3 changesets, 10 total revisions
606 2 warnings encountered!
606 2 warnings encountered!
607 8 integrity errors encountered!
607 8 integrity errors encountered!
608 (first damaged changeset appears to be 1)
608 (first damaged changeset appears to be 1)
609 [1]
609 [1]
610 $ cp -r .hg/store-newcopy/. .hg/store
610 $ cp -R .hg/store-newcopy/. .hg/store
611
611
612 Test cloning a treemanifest repo over http.
612 Test cloning a treemanifest repo over http.
613 $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
613 $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
614 $ cat hg.pid >> $DAEMON_PIDS
614 $ cat hg.pid >> $DAEMON_PIDS
615 $ cd ..
615 $ cd ..
616 We can clone even with the knob turned off and we'll get a treemanifest repo.
616 We can clone even with the knob turned off and we'll get a treemanifest repo.
617 $ hg clone --config experimental.treemanifest=False \
617 $ hg clone --config experimental.treemanifest=False \
618 > --config experimental.changegroup3=True \
618 > --config experimental.changegroup3=True \
619 > http://localhost:$HGPORT deepclone
619 > http://localhost:$HGPORT deepclone
620 requesting all changes
620 requesting all changes
621 adding changesets
621 adding changesets
622 adding manifests
622 adding manifests
623 adding file changes
623 adding file changes
624 added 3 changesets with 10 changes to 8 files
624 added 3 changesets with 10 changes to 8 files
625 updating to branch default
625 updating to branch default
626 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
626 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
627 No server errors.
627 No server errors.
628 $ cat deeprepo/errors.log
628 $ cat deeprepo/errors.log
629 requires got updated to include treemanifest
629 requires got updated to include treemanifest
630 $ cat deepclone/.hg/requires | grep treemanifest
630 $ cat deepclone/.hg/requires | grep treemanifest
631 treemanifest
631 treemanifest
632 Tree manifest revlogs exist.
632 Tree manifest revlogs exist.
633 $ find deepclone/.hg/store/meta | sort
633 $ find deepclone/.hg/store/meta | sort
634 deepclone/.hg/store/meta
634 deepclone/.hg/store/meta
635 deepclone/.hg/store/meta/b
635 deepclone/.hg/store/meta/b
636 deepclone/.hg/store/meta/b/00manifest.i
636 deepclone/.hg/store/meta/b/00manifest.i
637 deepclone/.hg/store/meta/b/bar
637 deepclone/.hg/store/meta/b/bar
638 deepclone/.hg/store/meta/b/bar/00manifest.i
638 deepclone/.hg/store/meta/b/bar/00manifest.i
639 deepclone/.hg/store/meta/b/bar/orange
639 deepclone/.hg/store/meta/b/bar/orange
640 deepclone/.hg/store/meta/b/bar/orange/00manifest.i
640 deepclone/.hg/store/meta/b/bar/orange/00manifest.i
641 deepclone/.hg/store/meta/b/bar/orange/fly
641 deepclone/.hg/store/meta/b/bar/orange/fly
642 deepclone/.hg/store/meta/b/bar/orange/fly/00manifest.i
642 deepclone/.hg/store/meta/b/bar/orange/fly/00manifest.i
643 deepclone/.hg/store/meta/b/foo
643 deepclone/.hg/store/meta/b/foo
644 deepclone/.hg/store/meta/b/foo/00manifest.i
644 deepclone/.hg/store/meta/b/foo/00manifest.i
645 deepclone/.hg/store/meta/b/foo/apple
645 deepclone/.hg/store/meta/b/foo/apple
646 deepclone/.hg/store/meta/b/foo/apple/00manifest.i
646 deepclone/.hg/store/meta/b/foo/apple/00manifest.i
647 deepclone/.hg/store/meta/b/foo/apple/bees
647 deepclone/.hg/store/meta/b/foo/apple/bees
648 deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i
648 deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i
649 deepclone/.hg/store/meta/~2e_a
649 deepclone/.hg/store/meta/~2e_a
650 deepclone/.hg/store/meta/~2e_a/00manifest.i
650 deepclone/.hg/store/meta/~2e_a/00manifest.i
651 Verify passes.
651 Verify passes.
652 $ cd deepclone
652 $ cd deepclone
653 $ hg verify
653 $ hg verify
654 checking changesets
654 checking changesets
655 checking manifests
655 checking manifests
656 checking directory manifests
656 checking directory manifests
657 crosschecking files in changesets and manifests
657 crosschecking files in changesets and manifests
658 checking files
658 checking files
659 8 files, 3 changesets, 10 total revisions
659 8 files, 3 changesets, 10 total revisions
660 $ cd ..
660 $ cd ..
661
661
662 Create clones using old repo formats to use in later tests
662 Create clones using old repo formats to use in later tests
663 $ hg clone --config format.usestore=False \
663 $ hg clone --config format.usestore=False \
664 > --config experimental.changegroup3=True \
664 > --config experimental.changegroup3=True \
665 > http://localhost:$HGPORT deeprepo-basicstore
665 > http://localhost:$HGPORT deeprepo-basicstore
666 requesting all changes
666 requesting all changes
667 adding changesets
667 adding changesets
668 adding manifests
668 adding manifests
669 adding file changes
669 adding file changes
670 added 3 changesets with 10 changes to 8 files
670 added 3 changesets with 10 changes to 8 files
671 updating to branch default
671 updating to branch default
672 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
672 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
673 $ cd deeprepo-basicstore
673 $ cd deeprepo-basicstore
674 $ grep store .hg/requires
674 $ grep store .hg/requires
675 [1]
675 [1]
676 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --errorlog=errors.log
676 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --errorlog=errors.log
677 $ cat hg.pid >> $DAEMON_PIDS
677 $ cat hg.pid >> $DAEMON_PIDS
678 $ cd ..
678 $ cd ..
679 $ hg clone --config format.usefncache=False \
679 $ hg clone --config format.usefncache=False \
680 > --config experimental.changegroup3=True \
680 > --config experimental.changegroup3=True \
681 > http://localhost:$HGPORT deeprepo-encodedstore
681 > http://localhost:$HGPORT deeprepo-encodedstore
682 requesting all changes
682 requesting all changes
683 adding changesets
683 adding changesets
684 adding manifests
684 adding manifests
685 adding file changes
685 adding file changes
686 added 3 changesets with 10 changes to 8 files
686 added 3 changesets with 10 changes to 8 files
687 updating to branch default
687 updating to branch default
688 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
688 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
689 $ cd deeprepo-encodedstore
689 $ cd deeprepo-encodedstore
690 $ grep fncache .hg/requires
690 $ grep fncache .hg/requires
691 [1]
691 [1]
692 $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --errorlog=errors.log
692 $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --errorlog=errors.log
693 $ cat hg.pid >> $DAEMON_PIDS
693 $ cat hg.pid >> $DAEMON_PIDS
694 $ cd ..
694 $ cd ..
695
695
696 Local clone with basicstore
696 Local clone with basicstore
697 $ hg clone -U deeprepo-basicstore local-clone-basicstore
697 $ hg clone -U deeprepo-basicstore local-clone-basicstore
698 $ hg -R local-clone-basicstore verify
698 $ hg -R local-clone-basicstore verify
699 checking changesets
699 checking changesets
700 checking manifests
700 checking manifests
701 checking directory manifests
701 checking directory manifests
702 crosschecking files in changesets and manifests
702 crosschecking files in changesets and manifests
703 checking files
703 checking files
704 8 files, 3 changesets, 10 total revisions
704 8 files, 3 changesets, 10 total revisions
705
705
706 Local clone with encodedstore
706 Local clone with encodedstore
707 $ hg clone -U deeprepo-encodedstore local-clone-encodedstore
707 $ hg clone -U deeprepo-encodedstore local-clone-encodedstore
708 $ hg -R local-clone-encodedstore verify
708 $ hg -R local-clone-encodedstore verify
709 checking changesets
709 checking changesets
710 checking manifests
710 checking manifests
711 checking directory manifests
711 checking directory manifests
712 crosschecking files in changesets and manifests
712 crosschecking files in changesets and manifests
713 checking files
713 checking files
714 8 files, 3 changesets, 10 total revisions
714 8 files, 3 changesets, 10 total revisions
715
715
716 Local clone with fncachestore
716 Local clone with fncachestore
717 $ hg clone -U deeprepo local-clone-fncachestore
717 $ hg clone -U deeprepo local-clone-fncachestore
718 $ hg -R local-clone-fncachestore verify
718 $ hg -R local-clone-fncachestore verify
719 checking changesets
719 checking changesets
720 checking manifests
720 checking manifests
721 checking directory manifests
721 checking directory manifests
722 crosschecking files in changesets and manifests
722 crosschecking files in changesets and manifests
723 checking files
723 checking files
724 8 files, 3 changesets, 10 total revisions
724 8 files, 3 changesets, 10 total revisions
725
725
726 Stream clone with basicstore
726 Stream clone with basicstore
727 $ hg clone --config experimental.changegroup3=True --uncompressed -U \
727 $ hg clone --config experimental.changegroup3=True --uncompressed -U \
728 > http://localhost:$HGPORT1 stream-clone-basicstore
728 > http://localhost:$HGPORT1 stream-clone-basicstore
729 streaming all changes
729 streaming all changes
730 18 files to transfer, * of data (glob)
730 18 files to transfer, * of data (glob)
731 transferred * in * seconds (*) (glob)
731 transferred * in * seconds (*) (glob)
732 searching for changes
732 searching for changes
733 no changes found
733 no changes found
734 $ hg -R stream-clone-basicstore verify
734 $ hg -R stream-clone-basicstore verify
735 checking changesets
735 checking changesets
736 checking manifests
736 checking manifests
737 checking directory manifests
737 checking directory manifests
738 crosschecking files in changesets and manifests
738 crosschecking files in changesets and manifests
739 checking files
739 checking files
740 8 files, 3 changesets, 10 total revisions
740 8 files, 3 changesets, 10 total revisions
741
741
742 Stream clone with encodedstore
742 Stream clone with encodedstore
743 $ hg clone --config experimental.changegroup3=True --uncompressed -U \
743 $ hg clone --config experimental.changegroup3=True --uncompressed -U \
744 > http://localhost:$HGPORT2 stream-clone-encodedstore
744 > http://localhost:$HGPORT2 stream-clone-encodedstore
745 streaming all changes
745 streaming all changes
746 18 files to transfer, * of data (glob)
746 18 files to transfer, * of data (glob)
747 transferred * in * seconds (*) (glob)
747 transferred * in * seconds (*) (glob)
748 searching for changes
748 searching for changes
749 no changes found
749 no changes found
750 $ hg -R stream-clone-encodedstore verify
750 $ hg -R stream-clone-encodedstore verify
751 checking changesets
751 checking changesets
752 checking manifests
752 checking manifests
753 checking directory manifests
753 checking directory manifests
754 crosschecking files in changesets and manifests
754 crosschecking files in changesets and manifests
755 checking files
755 checking files
756 8 files, 3 changesets, 10 total revisions
756 8 files, 3 changesets, 10 total revisions
757
757
758 Stream clone with fncachestore
758 Stream clone with fncachestore
759 $ hg clone --config experimental.changegroup3=True --uncompressed -U \
759 $ hg clone --config experimental.changegroup3=True --uncompressed -U \
760 > http://localhost:$HGPORT stream-clone-fncachestore
760 > http://localhost:$HGPORT stream-clone-fncachestore
761 streaming all changes
761 streaming all changes
762 18 files to transfer, * of data (glob)
762 18 files to transfer, * of data (glob)
763 transferred * in * seconds (*) (glob)
763 transferred * in * seconds (*) (glob)
764 searching for changes
764 searching for changes
765 no changes found
765 no changes found
766 $ hg -R stream-clone-fncachestore verify
766 $ hg -R stream-clone-fncachestore verify
767 checking changesets
767 checking changesets
768 checking manifests
768 checking manifests
769 checking directory manifests
769 checking directory manifests
770 crosschecking files in changesets and manifests
770 crosschecking files in changesets and manifests
771 checking files
771 checking files
772 8 files, 3 changesets, 10 total revisions
772 8 files, 3 changesets, 10 total revisions
773
773
774 Packed bundle
774 Packed bundle
775 $ hg -R deeprepo debugcreatestreamclonebundle repo-packed.hg
775 $ hg -R deeprepo debugcreatestreamclonebundle repo-packed.hg
776 writing 3349 bytes for 18 files
776 writing 3349 bytes for 18 files
777 bundle requirements: generaldelta, revlogv1, treemanifest
777 bundle requirements: generaldelta, revlogv1, treemanifest
778 $ hg debugbundle --spec repo-packed.hg
778 $ hg debugbundle --spec repo-packed.hg
779 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Ctreemanifest
779 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Ctreemanifest
780
780
781 Bundle with changegroup2 is not supported
781 Bundle with changegroup2 is not supported
782
782
783 $ hg -R deeprepo bundle --all -t v2 deeprepo.bundle
783 $ hg -R deeprepo bundle --all -t v2 deeprepo.bundle
784 abort: repository does not support bundle version 02
784 abort: repository does not support bundle version 02
785 [255]
785 [255]
786
786
787 Pull does not include changegroup for manifest the client already has from
787 Pull does not include changegroup for manifest the client already has from
788 other branch
788 other branch
789
789
790 $ mkdir grafted-dir-repo
790 $ mkdir grafted-dir-repo
791 $ cd grafted-dir-repo
791 $ cd grafted-dir-repo
792 $ hg --config experimental.treemanifest=1 init
792 $ hg --config experimental.treemanifest=1 init
793 $ mkdir dir
793 $ mkdir dir
794 $ echo a > dir/file
794 $ echo a > dir/file
795 $ echo a > file
795 $ echo a > file
796 $ hg ci -Am initial
796 $ hg ci -Am initial
797 adding dir/file
797 adding dir/file
798 adding file
798 adding file
799 $ echo b > dir/file
799 $ echo b > dir/file
800 $ hg ci -m updated
800 $ hg ci -m updated
801 $ hg co '.^'
801 $ hg co '.^'
802 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
802 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
803 $ hg revert -r tip dir/
803 $ hg revert -r tip dir/
804 reverting dir/file (glob)
804 reverting dir/file (glob)
805 $ echo b > file # to make sure root manifest is sent
805 $ echo b > file # to make sure root manifest is sent
806 $ hg ci -m grafted
806 $ hg ci -m grafted
807 created new head
807 created new head
808 $ cd ..
808 $ cd ..
809
809
810 $ hg --config experimental.treemanifest=1 clone --pull -r 1 \
810 $ hg --config experimental.treemanifest=1 clone --pull -r 1 \
811 > grafted-dir-repo grafted-dir-repo-clone
811 > grafted-dir-repo grafted-dir-repo-clone
812 adding changesets
812 adding changesets
813 adding manifests
813 adding manifests
814 adding file changes
814 adding file changes
815 added 2 changesets with 3 changes to 2 files
815 added 2 changesets with 3 changes to 2 files
816 updating to branch default
816 updating to branch default
817 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
817 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
818 $ cd grafted-dir-repo-clone
818 $ cd grafted-dir-repo-clone
819 $ hg pull -r 2
819 $ hg pull -r 2
820 pulling from $TESTTMP/grafted-dir-repo (glob)
820 pulling from $TESTTMP/grafted-dir-repo (glob)
821 searching for changes
821 searching for changes
822 adding changesets
822 adding changesets
823 adding manifests
823 adding manifests
824 adding file changes
824 adding file changes
825 added 1 changesets with 1 changes to 1 files (+1 heads)
825 added 1 changesets with 1 changes to 1 files (+1 heads)
826 (run 'hg heads' to see heads, 'hg merge' to merge)
826 (run 'hg heads' to see heads, 'hg merge' to merge)
827
827
@@ -1,319 +1,319 b''
1 prepare repo
1 prepare repo
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5 $ echo "some text" > FOO.txt
5 $ echo "some text" > FOO.txt
6 $ echo "another text" > bar.txt
6 $ echo "another text" > bar.txt
7 $ echo "more text" > QUICK.txt
7 $ echo "more text" > QUICK.txt
8 $ hg add
8 $ hg add
9 adding FOO.txt
9 adding FOO.txt
10 adding QUICK.txt
10 adding QUICK.txt
11 adding bar.txt
11 adding bar.txt
12 $ hg ci -mtest1
12 $ hg ci -mtest1
13
13
14 verify
14 verify
15
15
16 $ hg verify
16 $ hg verify
17 checking changesets
17 checking changesets
18 checking manifests
18 checking manifests
19 crosschecking files in changesets and manifests
19 crosschecking files in changesets and manifests
20 checking files
20 checking files
21 3 files, 1 changesets, 3 total revisions
21 3 files, 1 changesets, 3 total revisions
22
22
23 verify with journal
23 verify with journal
24
24
25 $ touch .hg/store/journal
25 $ touch .hg/store/journal
26 $ hg verify
26 $ hg verify
27 abandoned transaction found - run hg recover
27 abandoned transaction found - run hg recover
28 checking changesets
28 checking changesets
29 checking manifests
29 checking manifests
30 crosschecking files in changesets and manifests
30 crosschecking files in changesets and manifests
31 checking files
31 checking files
32 3 files, 1 changesets, 3 total revisions
32 3 files, 1 changesets, 3 total revisions
33 $ rm .hg/store/journal
33 $ rm .hg/store/journal
34
34
35 introduce some bugs in repo
35 introduce some bugs in repo
36
36
37 $ cd .hg/store/data
37 $ cd .hg/store/data
38 $ mv _f_o_o.txt.i X_f_o_o.txt.i
38 $ mv _f_o_o.txt.i X_f_o_o.txt.i
39 $ mv bar.txt.i xbar.txt.i
39 $ mv bar.txt.i xbar.txt.i
40 $ rm _q_u_i_c_k.txt.i
40 $ rm _q_u_i_c_k.txt.i
41
41
42 $ hg verify
42 $ hg verify
43 checking changesets
43 checking changesets
44 checking manifests
44 checking manifests
45 crosschecking files in changesets and manifests
45 crosschecking files in changesets and manifests
46 checking files
46 checking files
47 warning: revlog 'data/FOO.txt.i' not in fncache!
47 warning: revlog 'data/FOO.txt.i' not in fncache!
48 0: empty or missing FOO.txt
48 0: empty or missing FOO.txt
49 FOO.txt@0: manifest refers to unknown revision f62022d3d590
49 FOO.txt@0: manifest refers to unknown revision f62022d3d590
50 warning: revlog 'data/QUICK.txt.i' not in fncache!
50 warning: revlog 'data/QUICK.txt.i' not in fncache!
51 0: empty or missing QUICK.txt
51 0: empty or missing QUICK.txt
52 QUICK.txt@0: manifest refers to unknown revision 88b857db8eba
52 QUICK.txt@0: manifest refers to unknown revision 88b857db8eba
53 warning: revlog 'data/bar.txt.i' not in fncache!
53 warning: revlog 'data/bar.txt.i' not in fncache!
54 0: empty or missing bar.txt
54 0: empty or missing bar.txt
55 bar.txt@0: manifest refers to unknown revision 256559129457
55 bar.txt@0: manifest refers to unknown revision 256559129457
56 3 files, 1 changesets, 0 total revisions
56 3 files, 1 changesets, 0 total revisions
57 3 warnings encountered!
57 3 warnings encountered!
58 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
58 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
59 6 integrity errors encountered!
59 6 integrity errors encountered!
60 (first damaged changeset appears to be 0)
60 (first damaged changeset appears to be 0)
61 [1]
61 [1]
62
62
63 $ cd ../../..
63 $ cd ../../..
64 $ cd ..
64 $ cd ..
65
65
66 Set up a repo for testing missing revlog entries
66 Set up a repo for testing missing revlog entries
67
67
68 $ hg init missing-entries
68 $ hg init missing-entries
69 $ cd missing-entries
69 $ cd missing-entries
70 $ echo 0 > file
70 $ echo 0 > file
71 $ hg ci -Aqm0
71 $ hg ci -Aqm0
72 $ cp -r .hg/store .hg/store-partial
72 $ cp -R .hg/store .hg/store-partial
73 $ echo 1 > file
73 $ echo 1 > file
74 $ hg ci -Aqm1
74 $ hg ci -Aqm1
75 $ cp -r .hg/store .hg/store-full
75 $ cp -R .hg/store .hg/store-full
76
76
77 Entire changelog missing
77 Entire changelog missing
78
78
79 $ rm .hg/store/00changelog.*
79 $ rm .hg/store/00changelog.*
80 $ hg verify -q
80 $ hg verify -q
81 0: empty or missing changelog
81 0: empty or missing changelog
82 manifest@0: d0b6632564d4 not in changesets
82 manifest@0: d0b6632564d4 not in changesets
83 manifest@1: 941fc4534185 not in changesets
83 manifest@1: 941fc4534185 not in changesets
84 3 integrity errors encountered!
84 3 integrity errors encountered!
85 (first damaged changeset appears to be 0)
85 (first damaged changeset appears to be 0)
86 [1]
86 [1]
87 $ cp -r .hg/store-full/. .hg/store
87 $ cp -R .hg/store-full/. .hg/store
88
88
89 Entire manifest log missing
89 Entire manifest log missing
90
90
91 $ rm .hg/store/00manifest.*
91 $ rm .hg/store/00manifest.*
92 $ hg verify -q
92 $ hg verify -q
93 0: empty or missing manifest
93 0: empty or missing manifest
94 1 integrity errors encountered!
94 1 integrity errors encountered!
95 (first damaged changeset appears to be 0)
95 (first damaged changeset appears to be 0)
96 [1]
96 [1]
97 $ cp -r .hg/store-full/. .hg/store
97 $ cp -R .hg/store-full/. .hg/store
98
98
99 Entire filelog missing
99 Entire filelog missing
100
100
101 $ rm .hg/store/data/file.*
101 $ rm .hg/store/data/file.*
102 $ hg verify -q
102 $ hg verify -q
103 warning: revlog 'data/file.i' not in fncache!
103 warning: revlog 'data/file.i' not in fncache!
104 0: empty or missing file
104 0: empty or missing file
105 file@0: manifest refers to unknown revision 362fef284ce2
105 file@0: manifest refers to unknown revision 362fef284ce2
106 file@1: manifest refers to unknown revision c10f2164107d
106 file@1: manifest refers to unknown revision c10f2164107d
107 1 warnings encountered!
107 1 warnings encountered!
108 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
108 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
109 3 integrity errors encountered!
109 3 integrity errors encountered!
110 (first damaged changeset appears to be 0)
110 (first damaged changeset appears to be 0)
111 [1]
111 [1]
112 $ cp -r .hg/store-full/. .hg/store
112 $ cp -R .hg/store-full/. .hg/store
113
113
114 Entire changelog and manifest log missing
114 Entire changelog and manifest log missing
115
115
116 $ rm .hg/store/00changelog.*
116 $ rm .hg/store/00changelog.*
117 $ rm .hg/store/00manifest.*
117 $ rm .hg/store/00manifest.*
118 $ hg verify -q
118 $ hg verify -q
119 warning: orphan revlog 'data/file.i'
119 warning: orphan revlog 'data/file.i'
120 1 warnings encountered!
120 1 warnings encountered!
121 $ cp -r .hg/store-full/. .hg/store
121 $ cp -R .hg/store-full/. .hg/store
122
122
123 Entire changelog and filelog missing
123 Entire changelog and filelog missing
124
124
125 $ rm .hg/store/00changelog.*
125 $ rm .hg/store/00changelog.*
126 $ rm .hg/store/data/file.*
126 $ rm .hg/store/data/file.*
127 $ hg verify -q
127 $ hg verify -q
128 0: empty or missing changelog
128 0: empty or missing changelog
129 manifest@0: d0b6632564d4 not in changesets
129 manifest@0: d0b6632564d4 not in changesets
130 manifest@1: 941fc4534185 not in changesets
130 manifest@1: 941fc4534185 not in changesets
131 warning: revlog 'data/file.i' not in fncache!
131 warning: revlog 'data/file.i' not in fncache!
132 ?: empty or missing file
132 ?: empty or missing file
133 file@0: manifest refers to unknown revision 362fef284ce2
133 file@0: manifest refers to unknown revision 362fef284ce2
134 file@1: manifest refers to unknown revision c10f2164107d
134 file@1: manifest refers to unknown revision c10f2164107d
135 1 warnings encountered!
135 1 warnings encountered!
136 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
136 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
137 6 integrity errors encountered!
137 6 integrity errors encountered!
138 (first damaged changeset appears to be 0)
138 (first damaged changeset appears to be 0)
139 [1]
139 [1]
140 $ cp -r .hg/store-full/. .hg/store
140 $ cp -R .hg/store-full/. .hg/store
141
141
142 Entire manifest log and filelog missing
142 Entire manifest log and filelog missing
143
143
144 $ rm .hg/store/00manifest.*
144 $ rm .hg/store/00manifest.*
145 $ rm .hg/store/data/file.*
145 $ rm .hg/store/data/file.*
146 $ hg verify -q
146 $ hg verify -q
147 0: empty or missing manifest
147 0: empty or missing manifest
148 warning: revlog 'data/file.i' not in fncache!
148 warning: revlog 'data/file.i' not in fncache!
149 0: empty or missing file
149 0: empty or missing file
150 1 warnings encountered!
150 1 warnings encountered!
151 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
151 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
152 2 integrity errors encountered!
152 2 integrity errors encountered!
153 (first damaged changeset appears to be 0)
153 (first damaged changeset appears to be 0)
154 [1]
154 [1]
155 $ cp -r .hg/store-full/. .hg/store
155 $ cp -R .hg/store-full/. .hg/store
156
156
157 Changelog missing entry
157 Changelog missing entry
158
158
159 $ cp -f .hg/store-partial/00changelog.* .hg/store
159 $ cp -f .hg/store-partial/00changelog.* .hg/store
160 $ hg verify -q
160 $ hg verify -q
161 manifest@?: rev 1 points to nonexistent changeset 1
161 manifest@?: rev 1 points to nonexistent changeset 1
162 manifest@?: 941fc4534185 not in changesets
162 manifest@?: 941fc4534185 not in changesets
163 file@?: rev 1 points to nonexistent changeset 1
163 file@?: rev 1 points to nonexistent changeset 1
164 (expected 0)
164 (expected 0)
165 1 warnings encountered!
165 1 warnings encountered!
166 3 integrity errors encountered!
166 3 integrity errors encountered!
167 [1]
167 [1]
168 $ cp -r .hg/store-full/. .hg/store
168 $ cp -R .hg/store-full/. .hg/store
169
169
170 Manifest log missing entry
170 Manifest log missing entry
171
171
172 $ cp -f .hg/store-partial/00manifest.* .hg/store
172 $ cp -f .hg/store-partial/00manifest.* .hg/store
173 $ hg verify -q
173 $ hg verify -q
174 manifest@1: changeset refers to unknown revision 941fc4534185
174 manifest@1: changeset refers to unknown revision 941fc4534185
175 file@1: c10f2164107d not in manifests
175 file@1: c10f2164107d not in manifests
176 2 integrity errors encountered!
176 2 integrity errors encountered!
177 (first damaged changeset appears to be 1)
177 (first damaged changeset appears to be 1)
178 [1]
178 [1]
179 $ cp -r .hg/store-full/. .hg/store
179 $ cp -R .hg/store-full/. .hg/store
180
180
181 Filelog missing entry
181 Filelog missing entry
182
182
183 $ cp -f .hg/store-partial/data/file.* .hg/store/data
183 $ cp -f .hg/store-partial/data/file.* .hg/store/data
184 $ hg verify -q
184 $ hg verify -q
185 file@1: manifest refers to unknown revision c10f2164107d
185 file@1: manifest refers to unknown revision c10f2164107d
186 1 integrity errors encountered!
186 1 integrity errors encountered!
187 (first damaged changeset appears to be 1)
187 (first damaged changeset appears to be 1)
188 [1]
188 [1]
189 $ cp -r .hg/store-full/. .hg/store
189 $ cp -R .hg/store-full/. .hg/store
190
190
191 Changelog and manifest log missing entry
191 Changelog and manifest log missing entry
192
192
193 $ cp -f .hg/store-partial/00changelog.* .hg/store
193 $ cp -f .hg/store-partial/00changelog.* .hg/store
194 $ cp -f .hg/store-partial/00manifest.* .hg/store
194 $ cp -f .hg/store-partial/00manifest.* .hg/store
195 $ hg verify -q
195 $ hg verify -q
196 file@?: rev 1 points to nonexistent changeset 1
196 file@?: rev 1 points to nonexistent changeset 1
197 (expected 0)
197 (expected 0)
198 file@?: c10f2164107d not in manifests
198 file@?: c10f2164107d not in manifests
199 1 warnings encountered!
199 1 warnings encountered!
200 2 integrity errors encountered!
200 2 integrity errors encountered!
201 [1]
201 [1]
202 $ cp -r .hg/store-full/. .hg/store
202 $ cp -R .hg/store-full/. .hg/store
203
203
204 Changelog and filelog missing entry
204 Changelog and filelog missing entry
205
205
206 $ cp -f .hg/store-partial/00changelog.* .hg/store
206 $ cp -f .hg/store-partial/00changelog.* .hg/store
207 $ cp -f .hg/store-partial/data/file.* .hg/store/data
207 $ cp -f .hg/store-partial/data/file.* .hg/store/data
208 $ hg verify -q
208 $ hg verify -q
209 manifest@?: rev 1 points to nonexistent changeset 1
209 manifest@?: rev 1 points to nonexistent changeset 1
210 manifest@?: 941fc4534185 not in changesets
210 manifest@?: 941fc4534185 not in changesets
211 file@?: manifest refers to unknown revision c10f2164107d
211 file@?: manifest refers to unknown revision c10f2164107d
212 3 integrity errors encountered!
212 3 integrity errors encountered!
213 [1]
213 [1]
214 $ cp -r .hg/store-full/. .hg/store
214 $ cp -R .hg/store-full/. .hg/store
215
215
216 Manifest and filelog missing entry
216 Manifest and filelog missing entry
217
217
218 $ cp -f .hg/store-partial/00manifest.* .hg/store
218 $ cp -f .hg/store-partial/00manifest.* .hg/store
219 $ cp -f .hg/store-partial/data/file.* .hg/store/data
219 $ cp -f .hg/store-partial/data/file.* .hg/store/data
220 $ hg verify -q
220 $ hg verify -q
221 manifest@1: changeset refers to unknown revision 941fc4534185
221 manifest@1: changeset refers to unknown revision 941fc4534185
222 1 integrity errors encountered!
222 1 integrity errors encountered!
223 (first damaged changeset appears to be 1)
223 (first damaged changeset appears to be 1)
224 [1]
224 [1]
225 $ cp -r .hg/store-full/. .hg/store
225 $ cp -R .hg/store-full/. .hg/store
226
226
227 Corrupt changelog base node to cause failure to read revision
227 Corrupt changelog base node to cause failure to read revision
228
228
229 $ printf abcd | dd conv=notrunc of=.hg/store/00changelog.i bs=1 seek=16 \
229 $ printf abcd | dd conv=notrunc of=.hg/store/00changelog.i bs=1 seek=16 \
230 > 2> /dev/null
230 > 2> /dev/null
231 $ hg verify -q
231 $ hg verify -q
232 0: unpacking changeset 08b1860757c2: * (glob)
232 0: unpacking changeset 08b1860757c2: * (glob)
233 manifest@?: rev 0 points to unexpected changeset 0
233 manifest@?: rev 0 points to unexpected changeset 0
234 manifest@?: d0b6632564d4 not in changesets
234 manifest@?: d0b6632564d4 not in changesets
235 file@?: rev 0 points to unexpected changeset 0
235 file@?: rev 0 points to unexpected changeset 0
236 (expected 1)
236 (expected 1)
237 1 warnings encountered!
237 1 warnings encountered!
238 4 integrity errors encountered!
238 4 integrity errors encountered!
239 (first damaged changeset appears to be 0)
239 (first damaged changeset appears to be 0)
240 [1]
240 [1]
241 $ cp -r .hg/store-full/. .hg/store
241 $ cp -R .hg/store-full/. .hg/store
242
242
243 Corrupt manifest log base node to cause failure to read revision
243 Corrupt manifest log base node to cause failure to read revision
244
244
245 $ printf abcd | dd conv=notrunc of=.hg/store/00manifest.i bs=1 seek=16 \
245 $ printf abcd | dd conv=notrunc of=.hg/store/00manifest.i bs=1 seek=16 \
246 > 2> /dev/null
246 > 2> /dev/null
247 $ hg verify -q
247 $ hg verify -q
248 manifest@0: reading delta d0b6632564d4: * (glob)
248 manifest@0: reading delta d0b6632564d4: * (glob)
249 file@0: 362fef284ce2 not in manifests
249 file@0: 362fef284ce2 not in manifests
250 2 integrity errors encountered!
250 2 integrity errors encountered!
251 (first damaged changeset appears to be 0)
251 (first damaged changeset appears to be 0)
252 [1]
252 [1]
253 $ cp -r .hg/store-full/. .hg/store
253 $ cp -R .hg/store-full/. .hg/store
254
254
255 Corrupt filelog base node to cause failure to read revision
255 Corrupt filelog base node to cause failure to read revision
256
256
257 $ printf abcd | dd conv=notrunc of=.hg/store/data/file.i bs=1 seek=16 \
257 $ printf abcd | dd conv=notrunc of=.hg/store/data/file.i bs=1 seek=16 \
258 > 2> /dev/null
258 > 2> /dev/null
259 $ hg verify -q
259 $ hg verify -q
260 file@0: unpacking 362fef284ce2: * (glob)
260 file@0: unpacking 362fef284ce2: * (glob)
261 1 integrity errors encountered!
261 1 integrity errors encountered!
262 (first damaged changeset appears to be 0)
262 (first damaged changeset appears to be 0)
263 [1]
263 [1]
264 $ cp -r .hg/store-full/. .hg/store
264 $ cp -R .hg/store-full/. .hg/store
265
265
266 $ cd ..
266 $ cd ..
267
267
268 test changelog without a manifest
268 test changelog without a manifest
269
269
270 $ hg init b
270 $ hg init b
271 $ cd b
271 $ cd b
272 $ hg branch foo
272 $ hg branch foo
273 marked working directory as branch foo
273 marked working directory as branch foo
274 (branches are permanent and global, did you want a bookmark?)
274 (branches are permanent and global, did you want a bookmark?)
275 $ hg ci -m branchfoo
275 $ hg ci -m branchfoo
276 $ hg verify
276 $ hg verify
277 checking changesets
277 checking changesets
278 checking manifests
278 checking manifests
279 crosschecking files in changesets and manifests
279 crosschecking files in changesets and manifests
280 checking files
280 checking files
281 0 files, 1 changesets, 0 total revisions
281 0 files, 1 changesets, 0 total revisions
282
282
283 test revlog corruption
283 test revlog corruption
284
284
285 $ touch a
285 $ touch a
286 $ hg add a
286 $ hg add a
287 $ hg ci -m a
287 $ hg ci -m a
288
288
289 $ echo 'corrupted' > b
289 $ echo 'corrupted' > b
290 $ dd if=.hg/store/data/a.i of=start bs=1 count=20 2>/dev/null
290 $ dd if=.hg/store/data/a.i of=start bs=1 count=20 2>/dev/null
291 $ cat start b > .hg/store/data/a.i
291 $ cat start b > .hg/store/data/a.i
292
292
293 $ hg verify
293 $ hg verify
294 checking changesets
294 checking changesets
295 checking manifests
295 checking manifests
296 crosschecking files in changesets and manifests
296 crosschecking files in changesets and manifests
297 checking files
297 checking files
298 a@1: broken revlog! (index data/a.i is corrupted)
298 a@1: broken revlog! (index data/a.i is corrupted)
299 warning: orphan revlog 'data/a.i'
299 warning: orphan revlog 'data/a.i'
300 1 files, 2 changesets, 0 total revisions
300 1 files, 2 changesets, 0 total revisions
301 1 warnings encountered!
301 1 warnings encountered!
302 1 integrity errors encountered!
302 1 integrity errors encountered!
303 (first damaged changeset appears to be 1)
303 (first damaged changeset appears to be 1)
304 [1]
304 [1]
305
305
306 $ cd ..
306 $ cd ..
307
307
308 test revlog format 0
308 test revlog format 0
309
309
310 $ revlog-formatv0.py
310 $ revlog-formatv0.py
311 $ cd formatv0
311 $ cd formatv0
312 $ hg verify
312 $ hg verify
313 repository uses revlog format 0
313 repository uses revlog format 0
314 checking changesets
314 checking changesets
315 checking manifests
315 checking manifests
316 crosschecking files in changesets and manifests
316 crosschecking files in changesets and manifests
317 checking files
317 checking files
318 1 files, 1 changesets, 1 total revisions
318 1 files, 1 changesets, 1 total revisions
319 $ cd ..
319 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now