Mercurial > evolve
diff tests/test-sharing.t @ 4935:3874bc10d4a7 stable
docs: add two more amend commits to simulate temporary amend commits
sharing.rst made reference to temporary amend commits and used them to
demonstrate that hidden commits are not exchanged. Nowadays, evolve doesn't
create such commits, but it still makes sense to show how they are handled
during the exchange process. So let's add two more amend commits, one for each
repo. This way the guide doesn't have to be updated too much, but doesn't lose
this important detail of working with evolve.
Unfortunately, this means that tons of hashes change, but it's better than to
have figure 4 demonstrate absolutely nothing.
Temporary amend commits were removed from test-sharing.t in 06844693bb21,
but sharing.rst continued using them for demonstration purposes. It might've
been better to replace at least some of the temporary amend commits by extra
amends back then, but oh well.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Mon, 11 Nov 2019 02:42:37 +0700 |
parents | 3e748357a055 |
children | 9f69164cdc16 304de9a04172 |
line wrap: on
line diff
--- a/tests/test-sharing.t Mon Nov 11 02:33:54 2019 +0700 +++ b/tests/test-sharing.t Mon Nov 11 02:42:37 2019 +0700 @@ -70,6 +70,8 @@ Now let's switch to test-repo to test our change and amend:: $ cd ../test-repo $ hg update -q + $ echo 'Fix fix fix' > file1 + $ hg amend -m'fix bug 37' $ echo 'Fix fix fix.' > file1 $ hg amend -m'fix bug 37' @@ -80,8 +82,10 @@ o 0:0dc9 public create new project $ hg -R ../test-repo shortlog --hidden -G - @ 2:60ff draft fix bug 37 + @ 3:522d draft fix bug 37 | + | x 2:96d8 draft fix bug 37 + |/ | x 1:f649 draft prelim change |/ o 0:0dc9 public create new project @@ -96,31 +100,35 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) - 1 new obsolescence markers + 2 new obsolescence markers obsoleted 1 changesets - new changesets 60ffde5765c5 (1 drafts) + new changesets 522d503432a2 (1 drafts) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved - updated to "60ffde5765c5: fix bug 37" + updated to "522d503432a2: fix bug 37" 1 other heads for branch "default" Figure SG03 $ hg -R ../dev-repo shortlog --hidden -G - @ 2:60ff draft fix bug 37 + @ 2:522d draft fix bug 37 | | x 1:f649 draft prelim change |/ o 0:0dc9 public create new project Amend again in dev-repo + $ echo 'Fix, fix, and fix' > file1 + $ hg amend $ echo 'Fix, fix, and fix.' > file1 $ hg amend $ hg push -q Figure SG04 (dev-repo) $ hg shortlog --hidden -G - @ 3:de61 draft fix bug 37 + @ 4:7b49 draft fix bug 37 | - | x 2:60ff draft fix bug 37 + | x 3:e42b draft fix bug 37 + |/ + | x 2:522d draft fix bug 37 |/ | x 1:f649 draft prelim change |/ @@ -130,12 +138,14 @@ $ cd ../test-repo $ hg update 1 files updated, 0 files merged, 0 files removed, 0 files unresolved - updated to "de6151c48e1c: fix bug 37" + updated to "7b49f864d655: fix bug 37" 1 other heads for branch "default" $ hg shortlog --hidden -G - @ 3:de61 draft fix bug 37 + @ 4:7b49 draft fix bug 37 | - | x 2:60ff draft fix bug 37 + | x 3:522d draft fix bug 37 + |/ + | x 2:96d8 draft fix bug 37 |/ | x 1:f649 draft prelim change |/ @@ -149,23 +159,23 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files - 2 new obsolescence markers + 4 new obsolescence markers Now that the fix is public, we cannot amend it any more. $ hg amend -m 'fix bug 37' - abort: cannot amend public changesets: de6151c48e1c + abort: cannot amend public changesets: 7b49f864d655 (see 'hg help phases' for details) [255] Figure SG05 $ hg -R ../public shortlog -G - o 1:de61 public fix bug 37 + o 1:7b49 public fix bug 37 | o 0:0dc9 public create new project Oops, still have draft changesets in dev-repo: push the phase change there. $ hg -R ../dev-repo shortlog -r 'draft()' - 3:de61 draft fix bug 37 + 4:7b49 draft fix bug 37 $ hg push ../dev-repo pushing to ../dev-repo searching for changes @@ -205,7 +215,7 @@ added 1 changesets with 1 changes to 1 files exporting bookmark bug15 $ hg -R ../review bookmarks - bug15 2:f91e97234c2b + bug15 2:4e965c66c983 Alice receives code review, amends her fix, and goes out to lunch to await second review. @@ -222,15 +232,15 @@ obsoleted 1 changesets updating bookmark bug15 $ hg -R ../review bookmarks - bug15 3:cbdfbd5a5db2 + bug15 3:3363442626b3 Figure SG06: review repository after Alice pushes her amended changeset. $ hg --hidden -R ../review shortlog -G -r 1:: - o 3:cbdf draft fix bug 15 (v2) + o 3:3363 draft fix bug 15 (v2) | - | x 2:f91e draft fix bug 15 (v1) + | x 2:4e96 draft fix bug 15 (v1) |/ - @ 1:de61 public fix bug 37 + @ 1:7b49 public fix bug 37 | ~ @@ -242,15 +252,15 @@ $ hg push -B featureX pushing to $TESTTMP/review (glob) searching for changes - remote has heads on branch 'default' that are not known locally: cbdfbd5a5db2 + remote has heads on branch 'default' that are not known locally: 3363442626b3 adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) exporting bookmark featureX $ hg -R ../review bookmarks - bug15 3:cbdfbd5a5db2 - featureX 4:193657d1e852 + bug15 3:3363442626b3 + featureX 4:c7ff98c7916f Bob receives first review, amends and pushes. $ echo 'do stuff' > file1 @@ -258,7 +268,7 @@ $ hg push pushing to $TESTTMP/review (glob) searching for changes - remote has heads on branch 'default' that are not known locally: cbdfbd5a5db2 + remote has heads on branch 'default' that are not known locally: 3363442626b3 adding changesets adding manifests adding file changes @@ -284,7 +294,7 @@ $ hg push ../review pushing to ../review searching for changes - remote has heads on branch 'default' that are not known locally: cbdfbd5a5db2 + remote has heads on branch 'default' that are not known locally: 3363442626b3 adding changesets adding manifests adding file changes @@ -293,28 +303,28 @@ obsoleted 1 changesets updating bookmark featureX $ hg -R ../review bookmarks - bug15 3:cbdfbd5a5db2 - featureX 6:540ba8f317e6 + bug15 3:3363442626b3 + featureX 6:9d21d673314a Figure SG07: review and public repos after Bob implements feature X. $ hg --hidden -R ../review shortlog -G -r 1:: - o 6:540b public implement feature X (v3) + o 6:9d21 public implement feature X (v3) | - | x 5:0eb7 draft implement feature X (v2) + | x 5:1bb4 draft implement feature X (v2) |/ - | x 4:1936 draft implement feature X (v1) + | x 4:c7ff draft implement feature X (v1) |/ - | o 3:cbdf draft fix bug 15 (v2) + | o 3:3363 draft fix bug 15 (v2) |/ - | x 2:f91e draft fix bug 15 (v1) + | x 2:4e96 draft fix bug 15 (v1) |/ - @ 1:de61 public fix bug 37 + @ 1:7b49 public fix bug 37 | ~ $ hg --hidden -R ../public shortlog -G -r 1:: - o 2:540b public implement feature X (v3) + o 2:9d21 public implement feature X (v3) | - o 1:de61 public fix bug 37 + o 1:7b49 public fix bug 37 | ~ @@ -322,20 +332,20 @@ her change, so now she can publish it. $ cd ../alice $ hg --hidden shortlog -G -r 1:: - @ 3:cbdf draft fix bug 15 (v2) + @ 3:3363 draft fix bug 15 (v2) | - | x 2:f91e draft fix bug 15 (v1) + | x 2:4e96 draft fix bug 15 (v1) |/ - o 1:de61 public fix bug 37 + o 1:7b49 public fix bug 37 | ~ $ hg outgoing -q ../public - 3:cbdfbd5a5db2 + 3:3363442626b3 $ hg push ../public pushing to ../public searching for changes - remote has heads on branch 'default' that are not known locally: 540ba8f317e6 - abort: push creates new remote head cbdfbd5a5db2 with bookmark 'bug15'! + remote has heads on branch 'default' that are not known locally: 9d21d673314a + abort: push creates new remote head 3363442626b3 with bookmark 'bug15'! (pull and merge or see 'hg help push' for details about pushing new heads) [255] $ hg pull ../public @@ -346,30 +356,30 @@ adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) 2 new obsolescence markers - new changesets 540ba8f317e6 + new changesets 9d21d673314a (run 'hg heads' to see heads, 'hg merge' to merge) $ hg log -G -q -r 'head()' - o 4:540ba8f317e6 + o 4:9d21d673314a | ~ - @ 3:cbdfbd5a5db2 + @ 3:3363442626b3 | ~ $ hg --hidden shortlog -G -r 1:: - o 4:540b public implement feature X (v3) + o 4:9d21 public implement feature X (v3) | - | @ 3:cbdf draft fix bug 15 (v2) + | @ 3:3363 draft fix bug 15 (v2) |/ - | x 2:f91e draft fix bug 15 (v1) + | x 2:4e96 draft fix bug 15 (v1) |/ - o 1:de61 public fix bug 37 + o 1:7b49 public fix bug 37 | ~ Alice rebases her draft changeset on top of Bob's public changeset and publishes the result. - $ hg rebase -d 5 - rebasing 3:cbdfbd5a5db2 "fix bug 15 (v2)" (bug15) + $ hg rebase -d 4 + rebasing 3:3363442626b3 "fix bug 15 (v2)" (bug15) $ hg push ../public pushing to ../public searching for changes @@ -391,27 +401,27 @@ Figure SG08: review and public changesets after Alice pushes. $ hg --hidden -R ../review shortlog -G -r 1:: - o 7:a06e public fix bug 15 (v2) + o 7:dd15 public fix bug 15 (v2) | - o 6:540b public implement feature X (v3) + o 6:9d21 public implement feature X (v3) | - | x 5:0eb7 draft implement feature X (v2) + | x 5:1bb4 draft implement feature X (v2) |/ - | x 4:1936 draft implement feature X (v1) + | x 4:c7ff draft implement feature X (v1) |/ - | x 3:cbdf draft fix bug 15 (v2) + | x 3:3363 draft fix bug 15 (v2) |/ - | x 2:f91e draft fix bug 15 (v1) + | x 2:4e96 draft fix bug 15 (v1) |/ - @ 1:de61 public fix bug 37 + @ 1:7b49 public fix bug 37 | ~ $ hg --hidden -R ../public shortlog -G -r 1:: - o 3:a06e public fix bug 15 (v2) + o 3:dd15 public fix bug 15 (v2) | - o 2:540b public implement feature X (v3) + o 2:9d21 public implement feature X (v3) | - o 1:de61 public fix bug 37 + o 1:7b49 public fix bug 37 | ~ $ cd .. @@ -438,7 +448,7 @@ $ echo 'pretty good fix' >> file1 $ hg commit -u bob -m 'fix bug 24 (v1)' $ hg shortlog -r . - 4:2fe6 draft fix bug 24 (v1) + 4:b2be draft fix bug 24 (v1) Alice pulls Bob's draft changeset and amends it herself. :: @@ -450,7 +460,7 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files - new changesets 2fe6c4bd32d0 (1 drafts) + new changesets b2be254b3b9f (1 drafts) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 'better fix (alice)' >> file1 $ hg amend -u alice -m 'fix bug 24 (v2 by alice)' @@ -461,11 +471,11 @@ $ echo 'better fix (bob)' >> file1 $ hg amend -u bob -m 'fix bug 24 (v2 by bob)' $ hg --hidden shortlog -G -r 3:: - @ 5:a360 draft fix bug 24 (v2 by bob) + @ 5:541f draft fix bug 24 (v2 by bob) | - | x 4:2fe6 draft fix bug 24 (v1) + | x 4:b2be draft fix bug 24 (v1) |/ - o 3:a06e public fix bug 15 (v2) + o 3:dd15 public fix bug 15 (v2) | ~ @@ -479,23 +489,23 @@ added 1 changesets with 1 changes to 1 files (+1 heads) 1 new obsolescence markers 2 new content-divergent changesets - new changesets e3f99ce9d9cd (1 drafts) + new changesets e3a586fd2377 (1 drafts) (run 'hg heads' to see heads, 'hg merge' to merge) Figure SG09: multiple heads! divergence! oh my! $ hg --hidden shortlog -G -r 3:: - * 6:e3f9 draft fix bug 24 (v2 by alice) + * 6:e3a5 draft fix bug 24 (v2 by alice) | - | @ 5:a360 draft fix bug 24 (v2 by bob) + | @ 5:541f draft fix bug 24 (v2 by bob) |/ - | x 4:2fe6 draft fix bug 24 (v1) + | x 4:b2be draft fix bug 24 (v1) |/ - o 3:a06e public fix bug 15 (v2) + o 3:dd15 public fix bug 15 (v2) | ~ - $ hg --hidden shortlog -r 'successors(2fe6)' - 5:a360 draft fix bug 24 (v2 by bob) - 6:e3f9 draft fix bug 24 (v2 by alice) + $ hg --hidden shortlog -r 'successors(b2be)' + 5:541f draft fix bug 24 (v2 by bob) + 6:e3a5 draft fix bug 24 (v2 by alice) Use evolve to fix the divergence. $ cat > editor.sh <<EOF @@ -510,25 +520,25 @@ with: [6] fix bug 24 (v2 by alice) base: [4] fix bug 24 (v1) 0 files updated, 1 files merged, 0 files removed, 0 files unresolved - working directory is now at b1499b0f03ca + working directory is now at aa824ceedb8b $ hg log -q -r 'contentdivergent()' Figure SG10: Bob's repository after fixing divergence. $ hg --hidden shortlog -G -r 3:: - @ 7:b149 draft fix bug 24 (v2 by bob) + @ 7:aa82 draft fix bug 24 (v2 by bob) | - | x 6:e3f9 draft fix bug 24 (v2 by alice) + | x 6:e3a5 draft fix bug 24 (v2 by alice) |/ - | x 5:a360 draft fix bug 24 (v2 by bob) + | x 5:541f draft fix bug 24 (v2 by bob) |/ - | x 4:2fe6 draft fix bug 24 (v1) + | x 4:b2be draft fix bug 24 (v1) |/ - o 3:a06e public fix bug 15 (v2) + o 3:dd15 public fix bug 15 (v2) | ~ - $ hg --hidden shortlog -r 'predecessors(b1499b0f03ca)' - 5:a360 draft fix bug 24 (v2 by bob) - 6:e3f9 draft fix bug 24 (v2 by alice) + $ hg --hidden shortlog -r 'predecessors(aa82)' + 5:541f draft fix bug 24 (v2 by bob) + 6:e3a5 draft fix bug 24 (v2 by alice) $ cat file1 Do stuff. pretty good fix