comparison tests/test-evolve.t @ 4511:e4fc3af2d0a9 mercurial-4.8

test-compat: merge stable into mercurial-4.8
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 11 Apr 2019 22:41:25 +0200
parents 3caa4a459439
children 7a779a288793 96ce1030d2fb
comparison
equal deleted inserted replaced
4358:72f4e924f25a 4511:e4fc3af2d0a9
79 79
80 Obsolescence markers will be exchanged between repositories that 80 Obsolescence markers will be exchanged between repositories that
81 explicitly assert support for the obsolescence feature (this can currently 81 explicitly assert support for the obsolescence feature (this can currently
82 only be done via an extension). 82 only be done via an extension).
83 83
84 Instability ========== 84 Instability
85 85 ===========
86 (note: the vocabulary is in the process of being updated) 86
87 87 Rewriting changesets might introduce instability.
88 Rewriting changesets might introduce instability (currently 'trouble').
89 88
90 There are two main kinds of instability: orphaning and diverging. 89 There are two main kinds of instability: orphaning and diverging.
91 90
92 Orphans are changesets left behind when their ancestors are rewritten, 91 Orphans are changesets left behind when their ancestors are rewritten.
93 (currently: 'unstable'). Divergence has two variants: 92 Divergence has two variants:
94 93
95 * Content-divergence occurs when independent rewrites of the same 94 * Content-divergence occurs when independent rewrites of the same
96 changesets lead to different results. (currently: 'divergent') 95 changesets lead to different results.
97 * Phase-divergence occurs when the old (obsolete) version of a changeset 96 * Phase-divergence occurs when the old (obsolete) version of a changeset
98 becomes public. (currently: 'bumped') 97 becomes public.
99 98
100 If it possible to prevent local creation of orphans by using the following 99 It is possible to prevent local creation of orphans by using the following
101 config: 100 config:
102 101
103 [experimental] 102 [experimental]
104 evolution=createmarkers,allnewcommands,exchange 103 evolution=createmarkers,allnewcommands,exchange
105 104
143 test kill and immutable changeset 142 test kill and immutable changeset
144 143
145 $ hg log -r 1 --template '{rev} {phase} {obsolete}\n' 144 $ hg log -r 1 --template '{rev} {phase} {obsolete}\n'
146 1 public 145 1 public
147 $ hg prune 1 146 $ hg prune 1
148 abort: cannot touch public changesets: 7c3bad9141dc 147 abort: cannot prune public changesets: 7c3bad9141dc
149 (see 'hg help phases' for details) 148 (see 'hg help phases' for details)
150 [255] 149 [255]
151 $ hg log -r 1 --template '{rev} {phase} {obsolete}\n' 150 $ hg log -r 1 --template '{rev} {phase} {obsolete}\n'
152 1 public 151 1 public
153 152
388 $ hg log 387 $ hg log
389 6 feature-B: another feature that rox - test 388 6 feature-B: another feature that rox - test
390 4 feature-A: a nifty feature - test 389 4 feature-A: a nifty feature - test
391 0 : base - test 390 0 : base - test
392 391
393 phase change turning obsolete changeset public issue a bumped warning 392 phase change turning obsolete changeset public issues a phase divergence warning
394 393
395 $ hg phase --hidden --public 99833d22b0c6 394 $ hg phase --hidden --public 99833d22b0c6
396 1 new phase-divergent changesets 395 1 new phase-divergent changesets
397 396
398 all solving bumped troubled 397 all solving phase-divergent
399 398
400 $ glog 399 $ glog
401 @ 6:47d52a103155@default(draft) another feature that rox 400 @ 6:47d52a103155@default(draft) another feature that rox
402 | 401 |
403 | o 5:99833d22b0c6@default(public) another feature (child of ba0ec09b1bab) 402 | o 5:99833d22b0c6@default(public) another feature (child of ba0ec09b1bab)
407 o 0:e55e0562ee93@default(public) base 406 o 0:e55e0562ee93@default(public) base
408 407
409 $ hg evolve --any --traceback --phase-divergent 408 $ hg evolve --any --traceback --phase-divergent
410 recreate:[6] another feature that rox 409 recreate:[6] another feature that rox
411 atop:[5] another feature (child of ba0ec09b1bab) 410 atop:[5] another feature (child of ba0ec09b1bab)
412 computing new diff
413 committed as aca219761afb 411 committed as aca219761afb
414 working directory is now at aca219761afb 412 working directory is now at aca219761afb
415 $ glog 413 $ glog
416 @ 7:aca219761afb@default(draft) phase-divergent update to 99833d22b0c6: 414 @ 7:aca219761afb@default(draft) phase-divergent update to 99833d22b0c6:
417 | 415 |
427 --- a/main-file-1 425 --- a/main-file-1
428 +++ b/main-file-1 426 +++ b/main-file-1
429 @@ -3,1 +3,1 @@ 427 @@ -3,1 +3,1 @@
430 -Zwei 428 -Zwei
431 +deux 429 +deux
432 $ hg log -r 'phasedivergent()' # no more bumped 430 $ hg log -r 'phasedivergent()' # no more phase-divergent
433 431
434 test evolve --all 432 test evolve --all
435 $ sed -i'' -e s/deux/to/ main-file-1 433 $ sed -i'' -e s/deux/to/ main-file-1
436 $ hg commit -m 'dansk 2!' 434 $ hg commit -m 'dansk 2!'
437 $ sed -i'' -e s/Three/tre/ main-file-1 435 $ sed -i'' -e s/Three/tre/ main-file-1
998 | x 6:faafc6cea0ba@default(draft) a1_ 996 | x 6:faafc6cea0ba@default(draft) a1_
999 |/ 997 |/
1000 o 0:07c1c36d9ef0@default(draft) a0 998 o 0:07c1c36d9ef0@default(draft) a0
1001 999
1002 1000
1003 Possibility to select what trouble to solve first, asking for bumped before 1001 Possibility to select what instability to solve first, asking for
1004 divergent 1002 phase-divergent before content-divergent
1005 $ hg up -r "desc('a1__')" 1003 $ hg up -r "desc('a1__')"
1006 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 1004 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1007 $ hg revert -r d952e93add6f --all 1005 $ hg revert -r d952e93add6f --all
1008 reverting a 1006 reverting a
1009 $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n' 1007 $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n'
1038 | x 6 : a1_ - test 1036 | x 6 : a1_ - test
1039 |/ 1037 |/
1040 o 0 : a0 - test 1038 o 0 : a0 - test
1041 1039
1042 1040
1043 Now we have a bumped and an unstable changeset, we solve the bumped first 1041 Now we have a phase-divergent and an orphan changeset, we solve the
1044 normally the unstable changeset would be solve first 1042 phase-divergent first. Normally the orphan changeset would be solved first
1045 1043
1046 $ hg log -G 1044 $ hg log -G
1047 @ 11 : add new file bumped - test 1045 @ 11 : add new file bumped - test
1048 | 1046 |
1049 | o 10 : a2 - test 1047 | o 10 : a2 - test
1059 o 0 : a0 - test 1057 o 0 : a0 - test
1060 1058
1061 $ hg evolve -r "desc('add new file bumped')" --phase-divergent 1059 $ hg evolve -r "desc('add new file bumped')" --phase-divergent
1062 recreate:[11] add new file bumped 1060 recreate:[11] add new file bumped
1063 atop:[10] a2 1061 atop:[10] a2
1064 computing new diff
1065 committed as a8bb31d4b7f2 1062 committed as a8bb31d4b7f2
1066 working directory is now at a8bb31d4b7f2 1063 working directory is now at a8bb31d4b7f2
1067 $ hg evolve --any 1064 $ hg evolve --any
1068 move:[8] a3 1065 move:[8] a3
1069 atop:[12] phase-divergent update to d952e93add6f: 1066 atop:[12] phase-divergent update to d952e93add6f:
1078 o 9:9f8b83c2e7f3@default(public) a1__ 1075 o 9:9f8b83c2e7f3@default(public) a1__
1079 | 1076 |
1080 o 0:07c1c36d9ef0@default(public) a0 1077 o 0:07c1c36d9ef0@default(public) a0
1081 1078
1082 1079
1083 Check that we can resolve troubles in a revset with more than one commit 1080 Check that we can resolve instabilities in a revset with more than one commit
1084 $ hg up b88539ad24d7 -C 1081 $ hg up b88539ad24d7 -C
1085 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 1082 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1086 $ mkcommit gg 1083 $ mkcommit gg
1087 $ hg up b88539ad24d7 1084 $ hg up b88539ad24d7
1088 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 1085 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1308 $ hg up 98e171e2f272 1305 $ hg up 98e171e2f272
1309 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 1306 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1310 $ mkcommit c5_ 1307 $ mkcommit c5_
1311 created new head 1308 created new head
1312 $ hg prune '0ef9ff75f8e2 + f1b85956c48c' 1309 $ hg prune '0ef9ff75f8e2 + f1b85956c48c'
1313 abort: touch will orphan 1 descendants 1310 abort: prune will orphan 1 descendants
1314 (see 'hg help evolution.instability') 1311 (see 'hg help evolution.instability')
1315 [255] 1312 [255]
1316 $ hg prune '98e171e2f272::0d9203b74542' 1313 $ hg prune '98e171e2f272::0d9203b74542'
1317 abort: touch will orphan 1 descendants 1314 abort: prune will orphan 1 descendants
1318 (see 'hg help evolution.instability') 1315 (see 'hg help evolution.instability')
1319 [255] 1316 [255]
1320 $ hg prune '0ef9ff75f8e2::' 1317 $ hg prune '0ef9ff75f8e2::'
1321 3 changesets pruned 1318 3 changesets pruned
1322 $ glog -r "0cf3707e8971::" 1319 $ glog -r "0cf3707e8971::"
1535 $ echo a > a 1532 $ echo a > a
1536 $ for fn in a b c; do echo foo > $fn; hg ci -Am "added "$fn; done; 1533 $ for fn in a b c; do echo foo > $fn; hg ci -Am "added "$fn; done;
1537 adding a 1534 adding a
1538 adding b 1535 adding b
1539 adding c 1536 adding c
1540 Lets create a merge commit so that we can create orhpan merge later: 1537 Let's create a merge commit so that we can create orphan merge later:
1541 $ hg up 1 -q 1538 $ hg up 1 -q
1542 $ echo feature > f 1539 $ echo feature > f
1543 $ hg ci -Am "added feature f" 1540 $ hg ci -Am "added feature f"
1544 adding f 1541 adding f
1545 created new head 1542 created new head
1582 | 1579 |
1583 o 0:f7ad41964313@default(draft) added a 1580 o 0:f7ad41964313@default(draft) added a
1584 1581
1585 1582
1586 To check `lastsolved` contain right value after completion of orphan-merge 1583 To check `lastsolved` contain right value after completion of orphan-merge
1587 resolution there should be one more trouble to be evolved; lets create one: 1584 resolution there should be one more instability to be evolved; lets create one:
1588 $ hg up 1 -q 1585 $ hg up 1 -q
1589 $ echo d > d 1586 $ echo d > d
1590 $ hg ci -Am "added d" 1587 $ hg ci -Am "added d"
1591 adding c 1588 adding c
1592 adding d 1589 adding d