comparison tests/test-evolve-content-divergence.t @ 3914:96945ea908df stable

branching: merge default into stable The stable branch of Mercurial core now contains Mercurial 4.7 so evolve branch policy requires this merge. The @ bookmark is in the right location, so people doing clone will get to the latest release.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 31 Jul 2018 12:52:06 +0200
parents 55b8c7e7e352
children f7afd3a158e3 ef22eef37ecc
comparison
equal deleted inserted replaced
3901:f2b8429db565 3914:96945ea908df
1 ** Test for handling of content divergent changesets by `hg evolve` **
2 ====================================================================
3
4 $ cat >> $HGRCPATH <<EOF
5 > [alias]
6 > glog = log -GT "{rev}:{node|short} {desc|firstline}\n ({bookmarks}) [{branch}] {phase}"
7 > [phases]
8 > publish = False
9 > [extensions]
10 > rebase =
11 > EOF
12 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
13
14 $ hg init cdiv
15 $ cd cdiv
16 $ echo ".*\.orig" > .hgignore
17 $ hg add .hgignore
18 $ hg ci -m "added hgignore"
19 $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done;
20
21 $ hg glog
22 @ 4:c41c793e0ef1 added d
23 | () [default] draft
24 o 3:ca1b80f7960a added c
25 | () [default] draft
26 o 2:b1661037fa25 added b
27 | () [default] draft
28 o 1:c7586e2a9264 added a
29 | () [default] draft
30 o 0:8fa14d15e168 added hgignore
31 () [default] draft
32
33 Creating content-divergence with branch change where base, divergent and other
34 have different branches
35 -------------------------------------------------------------------------------
36
37 $ hg branch -r . foobar
38 changed branch on 1 changesets
39
40 $ hg up c41c793e0ef1 --hidden
41 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 updated to hidden changeset c41c793e0ef1
43 (hidden revision 'c41c793e0ef1' was rewritten as: 9e5dffcb3d48)
44 working directory parent is obsolete! (c41c793e0ef1)
45 (use 'hg evolve' to update to its successor: 9e5dffcb3d48)
46 $ echo bar > d
47 $ hg branch watwat
48 marked working directory as branch watwat
49 $ hg amend
50 2 new content-divergent changesets
51
52 $ hg glog
53 @ 6:264b04f771fb added d
54 | () [watwat] draft
55 | * 5:9e5dffcb3d48 added d
56 |/ () [foobar] draft
57 o 3:ca1b80f7960a added c
58 | () [default] draft
59 o 2:b1661037fa25 added b
60 | () [default] draft
61 o 1:c7586e2a9264 added a
62 | () [default] draft
63 o 0:8fa14d15e168 added hgignore
64 () [default] draft
65
66 $ hg evolve --content-divergent --config ui.interactive=True<<EOF
67 > c
68 > EOF
69 merge:[6] added d
70 with: [5] added d
71 base: [4] added d
72 merging "other" content-divergent changeset '9e5dffcb3d48'
73 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 content divergent changesets on different branches.
75 choose branch for the resolution changeset. (a) default or (b) watwat or (c) foobar? c
76 working directory is now at 0ac42f1bc15c
77
78 $ hg glog
79 @ 7:0ac42f1bc15c added d
80 | () [foobar] draft
81 o 3:ca1b80f7960a added c
82 | () [default] draft
83 o 2:b1661037fa25 added b
84 | () [default] draft
85 o 1:c7586e2a9264 added a
86 | () [default] draft
87 o 0:8fa14d15e168 added hgignore
88 () [default] draft
89
90 Testing merging of commit messages
91 -----------------------------------
92
93 When base and one of the divergent has same commit messages and other divergent
94 has different one
95
96 $ echo wat > d
97 $ hg amend
98
99 $ hg up .^
100 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
101
102 $ echo bar > d
103 $ hg ci -Aqm "added a d with bar in it, expect some beers"
104
105 $ hg prune -r 0ac42f1bc15c -s . --hidden
106 1 changesets pruned
107 2 new content-divergent changesets
108
109 $ hg glog
110 @ 9:59081c9c425a added a d with bar in it, expect some beers
111 | () [default] draft
112 | * 8:f621d00f5f0e added d
113 |/ () [foobar] draft
114 o 3:ca1b80f7960a added c
115 | () [default] draft
116 o 2:b1661037fa25 added b
117 | () [default] draft
118 o 1:c7586e2a9264 added a
119 | () [default] draft
120 o 0:8fa14d15e168 added hgignore
121 () [default] draft
122
123 $ hg evolve --content-divergent
124 merge:[9] added a d with bar in it, expect some beers
125 with: [8] added d
126 base: [7] added d
127 merging "other" content-divergent changeset 'f621d00f5f0e'
128 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
129 working directory is now at a9d6fd6b5e40
130
131 $ hg glog
132 @ 10:a9d6fd6b5e40 added a d with bar in it, expect some beers
133 | () [default] draft
134 o 3:ca1b80f7960a added c
135 | () [default] draft
136 o 2:b1661037fa25 added b
137 | () [default] draft
138 o 1:c7586e2a9264 added a
139 | () [default] draft
140 o 0:8fa14d15e168 added hgignore
141 () [default] draft
142
143 When base has different message and both divergents has same one
144
145 $ echo foo > d
146 $ hg amend -m "foo to d"
147
148 $ hg up a9d6fd6b5e40 --hidden
149 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 updated to hidden changeset a9d6fd6b5e40
151 (hidden revision 'a9d6fd6b5e40' was rewritten as: b10b07a394f1)
152 working directory parent is obsolete! (a9d6fd6b5e40)
153 (use 'hg evolve' to update to its successor: b10b07a394f1)
154 $ echo babar > d
155 $ hg amend -m "foo to d"
156 2 new content-divergent changesets
157
158 $ hg glog
159 @ 12:0bb497fed24a foo to d
160 | () [default] draft
161 | * 11:b10b07a394f1 foo to d
162 |/ () [default] draft
163 o 3:ca1b80f7960a added c
164 | () [default] draft
165 o 2:b1661037fa25 added b
166 | () [default] draft
167 o 1:c7586e2a9264 added a
168 | () [default] draft
169 o 0:8fa14d15e168 added hgignore
170 () [default] draft
171
172 $ hg evolve --content-divergent
173 merge:[12] foo to d
174 with: [11] foo to d
175 base: [10] added a d with bar in it, expect some beers
176 merging "other" content-divergent changeset 'b10b07a394f1'
177 merging d
178 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
179 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
180 fix conflicts and see `hg help evolve.interrupted`
181 [1]
182
183 $ echo foobar > d
184 $ hg resolve -m
185 (no more unresolved files)
186 continue: hg evolve --continue
187 $ hg evolve --continue
188 working directory is now at 11175423b5dc
189
190 $ hg glog
191 @ 13:11175423b5dc foo to d
192 | () [default] draft
193 o 3:ca1b80f7960a added c
194 | () [default] draft
195 o 2:b1661037fa25 added b
196 | () [default] draft
197 o 1:c7586e2a9264 added a
198 | () [default] draft
199 o 0:8fa14d15e168 added hgignore
200 () [default] draft
201
202 When all three base, divergent and other has different commit messages creating
203 conflicts
204
205 $ echo bar > d
206 $ hg amend -m "bar to d, expect beers"
207
208 $ hg up 11175423b5dc --hidden
209 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
210 updated to hidden changeset 11175423b5dc
211 (hidden revision '11175423b5dc' was rewritten as: 27f0463f169a)
212 working directory parent is obsolete! (11175423b5dc)
213 (use 'hg evolve' to update to its successor: 27f0463f169a)
214 $ echo wat > d
215 $ hg amend -m "wat to d, wat?"
216 2 new content-divergent changesets
217
218 $ hg glog
219 @ 15:f542037ddf31 wat to d, wat?
220 | () [default] draft
221 | * 14:27f0463f169a bar to d, expect beers
222 |/ () [default] draft
223 o 3:ca1b80f7960a added c
224 | () [default] draft
225 o 2:b1661037fa25 added b
226 | () [default] draft
227 o 1:c7586e2a9264 added a
228 | () [default] draft
229 o 0:8fa14d15e168 added hgignore
230 () [default] draft
231
232 $ hg evolve --content-divergent
233 merge:[15] wat to d, wat?
234 with: [14] bar to d, expect beers
235 base: [13] foo to d
236 merging "other" content-divergent changeset '27f0463f169a'
237 merging d
238 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
239 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
240 fix conflicts and see `hg help evolve.interrupted`
241 [1]
242
243 $ echo watbar > d
244 $ hg resolve -m
245 (no more unresolved files)
246 continue: hg evolve --continue
247
248 $ cat > editor.sh <<EOF
249 > #!/bin/sh
250 > printf "**showing editors text**\n\n"
251 > cat \$1
252 > printf "\n**done showing editors text**\n\n"
253 > cat > \$1 <<ENDOF
254 > watbar to d
255 > ENDOF
256 > EOF
257
258 $ HGEDITOR='sh ./editor.sh' hg evolve --continue
259 **showing editors text**
260
261 HG: Conflicts while merging changeset description of content-divergent changesets.
262 HG: Resolve conflicts in commit messages to continue.
263
264 <<<<<<< divergent
265 wat to d, wat?||||||| base
266 foo to d=======
267 bar to d, expect beers>>>>>>> other
268
269 **done showing editors text**
270
271 working directory is now at 89ea3eee2d69
272
273 $ hg glog
274 @ 16:89ea3eee2d69 watbar to d
275 | () [default] draft
276 o 3:ca1b80f7960a added c
277 | () [default] draft
278 o 2:b1661037fa25 added b
279 | () [default] draft
280 o 1:c7586e2a9264 added a
281 | () [default] draft
282 o 0:8fa14d15e168 added hgignore
283 () [default] draft
284
285 $ cd ..
286
287 Testing resolution of content-divergent changesets when they are on different
288 parents and resolution and relocation wont result in conflicts
289 ------------------------------------------------------------------------------
290
291 $ hg init multiparents
292 $ cd multiparents
293 $ echo ".*\.orig" > .hgignore
294 $ hg add .hgignore
295 $ hg ci -m "added hgignore"
296 $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done;
297
298 $ hg glog
299 @ 4:c41c793e0ef1 added d
300 | () [default] draft
301 o 3:ca1b80f7960a added c
302 | () [default] draft
303 o 2:b1661037fa25 added b
304 | () [default] draft
305 o 1:c7586e2a9264 added a
306 | () [default] draft
307 o 0:8fa14d15e168 added hgignore
308 () [default] draft
309
310 $ hg up .^^
311 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
312 $ echo bar > b
313 $ hg amend
314 2 new orphan changesets
315
316 $ hg rebase -r b1661037fa25 -d 8fa14d15e168 --hidden --config experimental.evolution.allowdivergence=True
317 rebasing 2:b1661037fa25 "added b"
318 2 new content-divergent changesets
319
320 $ hg glog
321 * 6:da4b96f4a8d6 added b
322 | () [default] draft
323 | @ 5:7ed0642d644b added b
324 | | () [default] draft
325 | | * 4:c41c793e0ef1 added d
326 | | | () [default] draft
327 | | * 3:ca1b80f7960a added c
328 | | | () [default] draft
329 | | x 2:b1661037fa25 added b
330 | |/ () [default] draft
331 | o 1:c7586e2a9264 added a
332 |/ () [default] draft
333 o 0:8fa14d15e168 added hgignore
334 () [default] draft
335
336 $ hg evolve --content-divergent
337 merge:[5] added b
338 with: [6] added b
339 base: [2] added b
340 rebasing "other" content-divergent changeset da4b96f4a8d6 on c7586e2a9264
341 updating to "local" side of the conflict: 7ed0642d644b
342 merging "other" content-divergent changeset '11f849d7159f'
343 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
344 working directory is now at 171614c9a791
345
346 $ hg glog
347 @ 8:171614c9a791 added b
348 | () [default] draft
349 | * 4:c41c793e0ef1 added d
350 | | () [default] draft
351 | * 3:ca1b80f7960a added c
352 | | () [default] draft
353 | x 2:b1661037fa25 added b
354 |/ () [default] draft
355 o 1:c7586e2a9264 added a
356 | () [default] draft
357 o 0:8fa14d15e168 added hgignore
358 () [default] draft
359
360 $ hg exp
361 # HG changeset patch
362 # User test
363 # Date 0 0
364 # Thu Jan 01 00:00:00 1970 +0000
365 # Node ID 171614c9a7914c53f531373b95632323fdbbac8d
366 # Parent c7586e2a92645e473645847a7b69a6dc52be4276
367 added b
368
369 diff -r c7586e2a9264 -r 171614c9a791 b
370 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
371 +++ b/b Thu Jan 01 00:00:00 1970 +0000
372 @@ -0,0 +1,1 @@
373 +bar
374
375 Resolving orphans to get back to a normal graph
376
377 $ hg evolve --all
378 move:[3] added c
379 atop:[8] added b
380 move:[4] added d
381 atop:[9] added c
382 working directory is now at 4ae4427ee9f8
383 $ hg glog
384 @ 10:4ae4427ee9f8 added d
385 | () [default] draft
386 o 9:917281f93fcb added c
387 | () [default] draft
388 o 8:171614c9a791 added b
389 | () [default] draft
390 o 1:c7586e2a9264 added a
391 | () [default] draft
392 o 0:8fa14d15e168 added hgignore
393 () [default] draft
394
395 More testing!
396
397 $ hg up .^^
398 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
399 $ echo x > x
400 $ hg ci -Aqm "added x"
401 $ hg glog -r .
402 @ 11:71a392c714b5 added x
403 | () [default] draft
404 ~
405
406 $ echo foo > x
407 $ hg branch bar
408 marked working directory as branch bar
409 (branches are permanent and global, did you want a bookmark?)
410 $ hg amend -m "added foo to x"
411
412 $ hg up 71a392c714b5 --hidden
413 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 updated to hidden changeset 71a392c714b5
415 (hidden revision '71a392c714b5' was rewritten as: 1e1a50385a7d)
416 working directory parent is obsolete! (71a392c714b5)
417 (use 'hg evolve' to update to its successor: 1e1a50385a7d)
418 $ hg rebase -r . -d 4ae4427ee9f8 --config experimental.evolution.allowdivergence=True
419 rebasing 11:71a392c714b5 "added x"
420 2 new content-divergent changesets
421
422 $ hg glog
423 @ 13:1e4f6b3bb39b added x
424 | () [default] draft
425 | * 12:1e1a50385a7d added foo to x
426 | | () [bar] draft
427 o | 10:4ae4427ee9f8 added d
428 | | () [default] draft
429 o | 9:917281f93fcb added c
430 |/ () [default] draft
431 o 8:171614c9a791 added b
432 | () [default] draft
433 o 1:c7586e2a9264 added a
434 | () [default] draft
435 o 0:8fa14d15e168 added hgignore
436 () [default] draft
437
438 $ hg evolve --content-divergent
439 merge:[13] added x
440 with: [12] added foo to x
441 base: [11] added x
442 rebasing "other" content-divergent changeset 1e1a50385a7d on 4ae4427ee9f8
443 updating to "local" side of the conflict: 1e4f6b3bb39b
444 merging "other" content-divergent changeset '80cc9b1ec650'
445 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
446 working directory is now at b006cf317e0e
447
448 $ hg exp
449 # HG changeset patch
450 # User test
451 # Date 0 0
452 # Thu Jan 01 00:00:00 1970 +0000
453 # Branch bar
454 # Node ID b006cf317e0ed16dbe786c439577475580f645f1
455 # Parent 4ae4427ee9f8f0935211fd66360948b77ab5aee9
456 added foo to x
457
458 diff -r 4ae4427ee9f8 -r b006cf317e0e x
459 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
460 +++ b/x Thu Jan 01 00:00:00 1970 +0000
461 @@ -0,0 +1,1 @@
462 +foo
463
464 The above `hg exp` and the following log call demonstrates that message, content
465 and branch change is preserved in case of relocation
466 $ hg glog
467 @ 15:b006cf317e0e added foo to x
468 | () [bar] draft
469 o 10:4ae4427ee9f8 added d
470 | () [default] draft
471 o 9:917281f93fcb added c
472 | () [default] draft
473 o 8:171614c9a791 added b
474 | () [default] draft
475 o 1:c7586e2a9264 added a
476 | () [default] draft
477 o 0:8fa14d15e168 added hgignore
478 () [default] draft
479
480 Testing when both the content-divergence are on different parents and resolution
481 will lead to conflicts
482 ---------------------------------------------------------------------------------
483
484 $ hg up .^^^
485 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
486
487 $ echo y > y
488 $ hg ci -Aqm "added y"
489 $ hg glog -r .
490 @ 16:fc6ad2bac162 added y
491 | () [default] draft
492 ~
493
494 $ echo bar > y
495 $ hg amend
496
497 $ hg up fc6ad2bac162 --hidden
498 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
499 updated to hidden changeset fc6ad2bac162
500 (hidden revision 'fc6ad2bac162' was rewritten as: 2a9f6ccbdeba)
501 working directory parent is obsolete! (fc6ad2bac162)
502 (use 'hg evolve' to update to its successor: 2a9f6ccbdeba)
503 $ hg rebase -r . -d b006cf317e0e --config experimental.evolution.allowdivergence=True
504 rebasing 16:fc6ad2bac162 "added y"
505 2 new content-divergent changesets
506 $ echo wat > y
507 $ hg amend
508
509 $ hg glog
510 @ 19:b4575ed6fcfc added y
511 | () [bar] draft
512 | * 17:2a9f6ccbdeba added y
513 | | () [default] draft
514 o | 15:b006cf317e0e added foo to x
515 | | () [bar] draft
516 o | 10:4ae4427ee9f8 added d
517 | | () [default] draft
518 o | 9:917281f93fcb added c
519 |/ () [default] draft
520 o 8:171614c9a791 added b
521 | () [default] draft
522 o 1:c7586e2a9264 added a
523 | () [default] draft
524 o 0:8fa14d15e168 added hgignore
525 () [default] draft
526
527 $ hg evolve --content-divergent
528 merge:[19] added y
529 with: [17] added y
530 base: [16] added y
531 rebasing "other" content-divergent changeset 2a9f6ccbdeba on b006cf317e0e
532 updating to "local" side of the conflict: b4575ed6fcfc
533 merging "other" content-divergent changeset '48f745db3f53'
534 merging y
535 warning: conflicts while merging y! (edit, then use 'hg resolve --mark')
536 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
537 fix conflicts and see `hg help evolve.interrupted`
538 [1]
539
540 $ echo watbar > y
541 $ hg resolve -m
542 (no more unresolved files)
543 continue: hg evolve --continue
544 $ hg evolve --continue
545 working directory is now at 7bbcf24ddecf
546
547 $ hg glog
548 @ 21:7bbcf24ddecf added y
549 | () [bar] draft
550 o 15:b006cf317e0e added foo to x
551 | () [bar] draft
552 o 10:4ae4427ee9f8 added d
553 | () [default] draft
554 o 9:917281f93fcb added c
555 | () [default] draft
556 o 8:171614c9a791 added b
557 | () [default] draft
558 o 1:c7586e2a9264 added a
559 | () [default] draft
560 o 0:8fa14d15e168 added hgignore
561 () [default] draft
562
563 $ hg obslog -r . --all
564 @ 7bbcf24ddecf (21) added y
565 |\
566 x | 48f745db3f53 (20) added y
567 | | rewritten(branch, content) as 7bbcf24ddecf using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
568 | |
569 | x b4575ed6fcfc (19) added y
570 | | rewritten(content) as 7bbcf24ddecf using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
571 | |
572 x | 2a9f6ccbdeba (17) added y
573 | | rewritten(parent) as 48f745db3f53 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
574 | |
575 | x 96b677f01b81 (18) added y
576 |/ rewritten(content) as b4575ed6fcfc using amend by test (Thu Jan 01 00:00:00 1970 +0000)
577 |
578 x fc6ad2bac162 (16) added y
579 rewritten(content) as 2a9f6ccbdeba using amend by test (Thu Jan 01 00:00:00 1970 +0000)
580 rewritten(branch, parent) as 96b677f01b81 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
581
582
583 checking that relocated commit is there
584 $ hg exp 48f745db3f53 --hidden
585 # HG changeset patch
586 # User test
587 # Date 0 0
588 # Thu Jan 01 00:00:00 1970 +0000
589 # Node ID 48f745db3f5300363ca248b9aeab20ff2a55fbb3
590 # Parent b006cf317e0ed16dbe786c439577475580f645f1
591 added y
592
593 diff -r b006cf317e0e -r 48f745db3f53 y
594 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
595 +++ b/y Thu Jan 01 00:00:00 1970 +0000
596 @@ -0,0 +1,1 @@
597 +bar
598
599 Testing when the relocation will result in conflicts and merging wont
600 ----------------------------------------------------------------------
601
602 $ hg glog
603 @ 21:7bbcf24ddecf added y
604 | () [bar] draft
605 o 15:b006cf317e0e added foo to x
606 | () [bar] draft
607 o 10:4ae4427ee9f8 added d
608 | () [default] draft
609 o 9:917281f93fcb added c
610 | () [default] draft
611 o 8:171614c9a791 added b
612 | () [default] draft
613 o 1:c7586e2a9264 added a
614 | () [default] draft
615 o 0:8fa14d15e168 added hgignore
616 () [default] draft
617
618 $ hg up .^^^^
619 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
620
621 $ echo z > z
622 $ hg ci -Aqm "added z"
623 $ hg glog -r .
624 @ 22:daf1de08f3b0 added z
625 | () [default] draft
626 ~
627
628 $ echo foo > y
629 $ hg add y
630 $ hg amend
631
632 $ hg up daf1de08f3b0 --hidden
633 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
634 updated to hidden changeset daf1de08f3b0
635 (hidden revision 'daf1de08f3b0' was rewritten as: 3f7a1f693080)
636 working directory parent is obsolete! (daf1de08f3b0)
637 (use 'hg evolve' to update to its successor: 3f7a1f693080)
638 $ hg rebase -r . -d 7bbcf24ddecf --config experimental.evolution.allowdivergence=True
639 rebasing 22:daf1de08f3b0 "added z"
640 2 new content-divergent changesets
641 $ echo bar > z
642 $ hg amend
643
644 $ hg glog
645 @ 25:53242575ffa9 added z
646 | () [bar] draft
647 | * 23:3f7a1f693080 added z
648 | | () [default] draft
649 o | 21:7bbcf24ddecf added y
650 | | () [bar] draft
651 o | 15:b006cf317e0e added foo to x
652 | | () [bar] draft
653 o | 10:4ae4427ee9f8 added d
654 | | () [default] draft
655 o | 9:917281f93fcb added c
656 |/ () [default] draft
657 o 8:171614c9a791 added b
658 | () [default] draft
659 o 1:c7586e2a9264 added a
660 | () [default] draft
661 o 0:8fa14d15e168 added hgignore
662 () [default] draft
663
664 $ hg evolve --content-divergent
665 merge:[25] added z
666 with: [23] added z
667 base: [22] added z
668 rebasing "other" content-divergent changeset 3f7a1f693080 on 7bbcf24ddecf
669 merging y
670 warning: conflicts while merging y! (edit, then use 'hg resolve --mark')
671 fix conflicts and see `hg help evolve.interrupted`
672 [1]
673
674 $ hg diff
675 diff -r 7bbcf24ddecf y
676 --- a/y Thu Jan 01 00:00:00 1970 +0000
677 +++ b/y Thu Jan 01 00:00:00 1970 +0000
678 @@ -1,1 +1,5 @@
679 +<<<<<<< destination: 7bbcf24ddecf bar - test: added y
680 watbar
681 +=======
682 +foo
683 +>>>>>>> evolving: 3f7a1f693080 - test: added z
684 diff -r 7bbcf24ddecf z
685 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
686 +++ b/z Thu Jan 01 00:00:00 1970 +0000
687 @@ -0,0 +1,1 @@
688 +z
689
690 $ echo foo > y
691 $ hg resolve -m
692 (no more unresolved files)
693 continue: hg evolve --continue
694
695 $ hg evolve --continue
696 evolving 23:3f7a1f693080 "added z"
697 updating to "local" side of the conflict: 53242575ffa9
698 merging "other" content-divergent changeset 'cdb0643c69fc'
699 merging y
700 warning: conflicts while merging y! (edit, then use 'hg resolve --mark')
701 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
702 fix conflicts and see `hg help evolve.interrupted`
703 [1]
704
705 $ hg diff
706 diff -r 53242575ffa9 y
707 --- a/y Thu Jan 01 00:00:00 1970 +0000
708 +++ b/y Thu Jan 01 00:00:00 1970 +0000
709 @@ -1,1 +1,5 @@
710 +<<<<<<< local: 53242575ffa9 bar - test: added z
711 watbar
712 +=======
713 +foo
714 +>>>>>>> other: cdb0643c69fc - test: added z
715
716 $ echo foo > y
717 $ hg resolve -m
718 (no more unresolved files)
719 continue: hg evolve --continue
720 $ hg evolve --continue
721 working directory is now at 6fc7d9682de6
722
723 $ hg glog
724 @ 27:6fc7d9682de6 added z
725 | () [bar] draft
726 o 21:7bbcf24ddecf added y
727 | () [bar] draft
728 o 15:b006cf317e0e added foo to x
729 | () [bar] draft
730 o 10:4ae4427ee9f8 added d
731 | () [default] draft
732 o 9:917281f93fcb added c
733 | () [default] draft
734 o 8:171614c9a791 added b
735 | () [default] draft
736 o 1:c7586e2a9264 added a
737 | () [default] draft
738 o 0:8fa14d15e168 added hgignore
739 () [default] draft
740
741 $ hg exp
742 # HG changeset patch
743 # User test
744 # Date 0 0
745 # Thu Jan 01 00:00:00 1970 +0000
746 # Branch bar
747 # Node ID 6fc7d9682de6e3bee6c8b1266b756ed7d522b7e4
748 # Parent 7bbcf24ddecfe97d7c2ac6fa8c07c155c8fda47b
749 added z
750
751 diff -r 7bbcf24ddecf -r 6fc7d9682de6 y
752 --- a/y Thu Jan 01 00:00:00 1970 +0000
753 +++ b/y Thu Jan 01 00:00:00 1970 +0000
754 @@ -1,1 +1,1 @@
755 -watbar
756 +foo
757 diff -r 7bbcf24ddecf -r 6fc7d9682de6 z
758 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
759 +++ b/z Thu Jan 01 00:00:00 1970 +0000
760 @@ -0,0 +1,1 @@
761 +bar
762
763 $ cd ..
764
765 Resolving content-divergence of a stack with same parents
766 ---------------------------------------------------------
767
768 $ hg init stacktest
769 $ cd stacktest
770 $ echo ".*\.orig" > .hgignore
771 $ hg add .hgignore
772 $ hg ci -m "added hgignore"
773 $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done;
774
775 $ hg glog
776 @ 4:c41c793e0ef1 added d
777 | () [default] draft
778 o 3:ca1b80f7960a added c
779 | () [default] draft
780 o 2:b1661037fa25 added b
781 | () [default] draft
782 o 1:c7586e2a9264 added a
783 | () [default] draft
784 o 0:8fa14d15e168 added hgignore
785 () [default] draft
786
787 $ cd ..
788 $ hg init stack2
789 $ cd stack2
790 $ hg pull ../stacktest
791 pulling from ../stacktest
792 requesting all changes
793 adding changesets
794 adding manifests
795 adding file changes
796 added 5 changesets with 5 changes to 5 files
797 new changesets 8fa14d15e168:c41c793e0ef1
798 (run 'hg update' to get a working copy)
799 $ hg glog
800 o 4:c41c793e0ef1 added d
801 | () [default] draft
802 o 3:ca1b80f7960a added c
803 | () [default] draft
804 o 2:b1661037fa25 added b
805 | () [default] draft
806 o 1:c7586e2a9264 added a
807 | () [default] draft
808 o 0:8fa14d15e168 added hgignore
809 () [default] draft
810
811 $ hg up c7586e2a9264
812 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
813 $ echo bar > a
814 $ hg amend -m "watbar to a"
815 3 new orphan changesets
816 $ echo wat > a
817 $ hg amend -m "watbar to a"
818 $ hg evolve --all
819 move:[2] added b
820 atop:[6] watbar to a
821 move:[3] added c
822 atop:[7] added b
823 move:[4] added d
824 atop:[8] added c
825 working directory is now at 15c781f93cac
826 $ hg glog
827 @ 9:15c781f93cac added d
828 | () [default] draft
829 o 8:9e5fb1d5b955 added c
830 | () [default] draft
831 o 7:88516dccf68a added b
832 | () [default] draft
833 o 6:82b74d5dc678 watbar to a
834 | () [default] draft
835 o 0:8fa14d15e168 added hgignore
836 () [default] draft
837
838 $ cd ../stacktest
839 $ hg up .^^^
840 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
841 $ echo wat > a
842 $ hg amend -m "watbar to a"
843 3 new orphan changesets
844 $ hg evolve --all
845 move:[2] added b
846 atop:[5] watbar to a
847 move:[3] added c
848 atop:[6] added b
849 move:[4] added d
850 atop:[7] added c
851 working directory is now at c72d2885eb51
852 $ hg glog
853 @ 8:c72d2885eb51 added d
854 | () [default] draft
855 o 7:3ce4be6d8e5e added c
856 | () [default] draft
857 o 6:d5f148423c16 added b
858 | () [default] draft
859 o 5:8e222f257bbf watbar to a
860 | () [default] draft
861 o 0:8fa14d15e168 added hgignore
862 () [default] draft
863
864 $ hg pull ../stack2
865 pulling from ../stack2
866 searching for changes
867 adding changesets
868 adding manifests
869 adding file changes
870 added 4 changesets with 0 changes to 4 files (+1 heads)
871 5 new obsolescence markers
872 8 new content-divergent changesets
873 new changesets 82b74d5dc678:15c781f93cac
874 (run 'hg heads' to see heads, 'hg merge' to merge)
875
876 $ hg glog
877 * 12:15c781f93cac added d
878 | () [default] draft
879 * 11:9e5fb1d5b955 added c
880 | () [default] draft
881 * 10:88516dccf68a added b
882 | () [default] draft
883 * 9:82b74d5dc678 watbar to a
884 | () [default] draft
885 | @ 8:c72d2885eb51 added d
886 | | () [default] draft
887 | * 7:3ce4be6d8e5e added c
888 | | () [default] draft
889 | * 6:d5f148423c16 added b
890 | | () [default] draft
891 | * 5:8e222f257bbf watbar to a
892 |/ () [default] draft
893 o 0:8fa14d15e168 added hgignore
894 () [default] draft
895
896 $ hg evolve --all --content-divergent
897 merge:[5] watbar to a
898 with: [9] watbar to a
899 base: [1] added a
900 updating to "local" side of the conflict: 8e222f257bbf
901 merging "other" content-divergent changeset '82b74d5dc678'
902 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
903 6 new orphan changesets
904 merge:[6] added b
905 with: [10] added b
906 base: [2] added b
907 updating to "local" side of the conflict: d5f148423c16
908 merging "other" content-divergent changeset '88516dccf68a'
909 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
910 merge:[7] added c
911 with: [11] added c
912 base: [3] added c
913 updating to "local" side of the conflict: 3ce4be6d8e5e
914 merging "other" content-divergent changeset '9e5fb1d5b955'
915 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
916 merge:[8] added d
917 with: [12] added d
918 base: [4] added d
919 updating to "local" side of the conflict: c72d2885eb51
920 merging "other" content-divergent changeset '15c781f93cac'
921 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
922 working directory is now at 038fe7db3d88
923
924 $ hg glog
925 @ 16:038fe7db3d88 added d
926 | () [default] draft
927 o 15:b2cac10f3836 added c
928 | () [default] draft
929 o 14:eadfd9d70680 added b
930 | () [default] draft
931 o 13:f66f262fff6c watbar to a
932 | () [default] draft
933 o 0:8fa14d15e168 added hgignore
934 () [default] draft