From c6317e40fa3f7ad7b2b1551515ae4c78111768cf Mon Sep 17 00:00:00 2001 From: Phil Cohen Date: Tue, 14 Aug 2018 23:13:17 -0700 Subject: [PATCH] tests: add {node|short} to showgraph() Summary: I hit a bug where commit hashes were useful, but it only showed up in the `hg rebase` output late in a test. I think adding hashes to log output is generally a best practice in tests, since it prevents accidental regressions. Reviewed By: quark-zju Differential Revision: D9323265 fbshipit-source-id: a76a01ddd416c68fe8a1c440584b21e5d88dc82a --- tests/test-fb-hgext-fbamend-fold.t | 130 ++++----- tests/test-fb-hgext-fbamend-rebase.t | 18 +- tests/test-fb-hgext-fbamend-restack-auto.t | 50 ++-- ...test-fb-hgext-fbamend-restack-divergence.t | 46 ++-- .../test-fb-hgext-fbamend-restack-multidest.t | 70 ++--- tests/test-fb-hgext-fbamend-restack.t | 250 +++++++++--------- tests/test-fb-hgext-fbamend-split.t | 118 ++++----- tests/test-fb-hgext-fold-undo.t | 46 ++-- tests/tinit.sh | 2 +- 9 files changed, 365 insertions(+), 365 deletions(-) diff --git a/tests/test-fb-hgext-fbamend-fold.t b/tests/test-fb-hgext-fbamend-fold.t index 14af00dd90..538a1c130c 100644 --- a/tests/test-fb-hgext-fbamend-fold.t +++ b/tests/test-fb-hgext-fbamend-fold.t @@ -18,21 +18,21 @@ Set up repo. $ hg init repo && cd repo $ hg debugbuilddag -m "+5 *4 +2" $ showgraph - o 7 r7 + o 7 9c9414e0356c r7 | - o 6 r6 + o 6 ec6d8e65acbe r6 | - o 5 r5 + o 5 77d787dfa5b6 r5 | - | o 4 r4 + | o 4 b762560d23fd r4 | | - | o 3 r3 + | o 3 a422badec216 r3 | | - | o 2 r2 + | o 2 37d4c1cec295 r2 |/ - o 1 r1 + o 1 f177fbb9e8d1 r1 | - o 0 r0 + o 0 93cbaf5e6529 r0 Test that a fold works correctly on error. $ hg fold --exact 7 7 @@ -46,19 +46,19 @@ Test simple case of folding a head. Should work normally. 2 changesets folded 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - @ 8 r6 + @ 8 dd0541003d21 r6 | - o 5 r5 + o 5 77d787dfa5b6 r5 | - | o 4 r4 + | o 4 b762560d23fd r4 | | - | o 3 r3 + | o 3 a422badec216 r3 | | - | o 2 r2 + | o 2 37d4c1cec295 r2 |/ - o 1 r1 + o 1 f177fbb9e8d1 r1 | - o 0 r0 + o 0 93cbaf5e6529 r0 Test rebasing of stack after fold. $ hg up 3 @@ -69,17 +69,17 @@ Test rebasing of stack after fold. rebasing 4:b762560d23fd "r4" merging mf $ showgraph - o 10 r4 + o 10 c480ccdc36c0 r4 | - @ 9 r2 + @ 9 fac8d040c80b r2 | - | o 8 r6 + | o 8 dd0541003d21 r6 | | - | o 5 r5 + | o 5 77d787dfa5b6 r5 |/ - o 1 r1 + o 1 f177fbb9e8d1 r1 | - o 0 r0 + o 0 93cbaf5e6529 r0 Test rebasing of multiple children $ hg up 1 @@ -96,15 +96,15 @@ Test rebasing of multiple children rebasing 10:* "r4" (glob) merging mf $ showgraph - o 15 r4 + o 15 6b8dd87db039 r4 | - o 14 r2 + o 14 7fd219543f4f r2 | - | o 13 r6 + | o 13 31892267fa07 r6 | | - | o 12 r5 + | o 12 c74bb9c4eec9 r5 |/ - @ 11 r0 + @ 11 bfc9ee54b8f4 r0 Test folding multiple changesets, using default behavior of folding up to working copy parent. Also tests situation where the branch to @@ -112,21 +112,21 @@ rebase is not on the topmost folded commit. $ reset $ hg debugbuilddag -m "+5 *4 +2" $ showgraph - o 7 r7 + o 7 9c9414e0356c r7 | - o 6 r6 + o 6 ec6d8e65acbe r6 | - o 5 r5 + o 5 77d787dfa5b6 r5 | - | o 4 r4 + | o 4 b762560d23fd r4 | | - | o 3 r3 + | o 3 a422badec216 r3 | | - | o 2 r2 + | o 2 37d4c1cec295 r2 |/ - o 1 r1 + o 1 f177fbb9e8d1 r1 | - o 0 r0 + o 0 93cbaf5e6529 r0 $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -144,34 +144,34 @@ rebase is not on the topmost folded commit. rebasing 7:9c9414e0356c "r7" merging mf $ showgraph - o 13 r7 + o 13 69b8281910bd r7 | - o 12 r6 + o 12 b494e86b0fcd r6 | - o 11 r5 + o 11 3b418b2dcaeb r5 | - | o 10 r4 + | o 10 a78a744630c5 r4 | | - | o 9 r3 + | o 9 6032a3d5c310 r3 |/ - @ 8 r0 + @ 8 001b0872b432 r0 Test folding changesets unrelated to working copy parent using --exact. Also test that using node hashes instead of rev numbers works. $ reset $ hg debugbuilddag -m +6 $ showgraph - o 5 r5 + o 5 f2987ebe5838 r5 | - o 4 r4 + o 4 aa70f0fe546a r4 | - o 3 r3 + o 3 cb14eba0ad9c r3 | - o 2 r2 + o 2 f07e66f449d0 r2 | - o 1 r1 + o 1 09bb8c08de89 r1 | - o 0 r0 + o 0 fdaccbb26270 r0 $ hg fold --exact 09bb8c f07e66 cb14eb 3 changesets folded @@ -180,27 +180,27 @@ Also test that using node hashes instead of rev numbers works. rebasing 5:f2987ebe5838 "r5" merging mf $ showgraph - o 8 r5 + o 8 064f4cd2992f r5 | - o 7 r4 + o 7 e39a86ad4ff1 r4 | - o 6 r1 + o 6 b36e18e69785 r1 | - o 0 r0 + o 0 fdaccbb26270 r0 Test --no-rebase flag. $ hg fold --no-rebase --exact 6 7 2 changesets folded $ showgraph - o 9 r1 + o 9 b431410f50a9 r1 | - | o 8 r5 + | o 8 064f4cd2992f r5 | | - | x 7 r4 + | x 7 e39a86ad4ff1 r4 | | - | x 6 r1 + | x 6 b36e18e69785 r1 |/ - o 0 r0 + o 0 fdaccbb26270 r0 Test that bookmarks are correctly moved. $ reset @@ -225,17 +225,17 @@ Test JSON output $ hg up 5 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - @ 5 r5 + @ 5 f2987ebe5838 r5 | - o 4 r4 + o 4 aa70f0fe546a r4 | - o 3 r3 + o 3 cb14eba0ad9c r3 | - o 2 r2 + o 2 f07e66f449d0 r2 | - o 1 r1 + o 1 09bb8c08de89 r1 | - o 0 r0 + o 0 fdaccbb26270 r0 When rebase is not involved $ hg fold --from -r '.^' -Tjson -q @@ -250,13 +250,13 @@ When rebase is not involved {"329a7569e12e1828787ecfebc262b012abcf7077": ["befa2830d024c4b14c1d5331052d7a13ec2df124"], "cb14eba0ad9cc49472e54fe97c261f5f78a79dab": ["befa2830d024c4b14c1d5331052d7a13ec2df124"]} (no-eol) $ showgraph - @ 7 r3 + @ 7 befa2830d024 r3 | - o 2 r2 + o 2 f07e66f449d0 r2 | - o 1 r1 + o 1 09bb8c08de89 r1 | - o 0 r0 + o 0 fdaccbb26270 r0 XXX: maybe we also want the rebase nodechanges here. When rebase is involved diff --git a/tests/test-fb-hgext-fbamend-rebase.t b/tests/test-fb-hgext-fbamend-rebase.t index 55627576d8..85ea19f098 100644 --- a/tests/test-fb-hgext-fbamend-rebase.t +++ b/tests/test-fb-hgext-fbamend-rebase.t @@ -11,23 +11,23 @@ Test that rebased commits that would cause instability are inhibited. $ hg init repo && cd repo $ hg debugbuilddag -m '+3 *3' $ showgraph - o 3 r3 + o 3 e5d56d7a7894 r3 | - | o 2 r2 + | o 2 c175bafe34cb r2 | | - | o 1 r1 + | o 1 22094967a90d r1 |/ - o 0 r0 + o 0 1ad88bca4140 r0 $ hg rebase -r 1 -d 3 rebasing 1:* "r1" (glob) merging mf $ showgraph - o 4 r1 + o 4 309a29d7f33b r1 | - o 3 r3 + o 3 e5d56d7a7894 r3 | - | o 2 r2 + | o 2 c175bafe34cb r2 | | - | x 1 r1 + | x 1 22094967a90d r1 |/ - o 0 r0 + o 0 1ad88bca4140 r0 diff --git a/tests/test-fb-hgext-fbamend-restack-auto.t b/tests/test-fb-hgext-fbamend-restack-auto.t index abcc358f6b..a5aca8b502 100644 --- a/tests/test-fb-hgext-fbamend-restack-auto.t +++ b/tests/test-fb-hgext-fbamend-restack-auto.t @@ -149,15 +149,15 @@ amend.autorestack=no-conflict, and mergeable changes (expect restack) rebasing 2:ca039b450ae0 "C" (C) merging file $ showgraph - o 4 C + o 4 7ed7d67ad7bf C | - @ 3 B + @ 3 767372f778c5 B | - | x 2 C + | x 2 ca039b450ae0 C | | - | x 1 B + | x 1 fe14e2b67b65 B |/ - o 0 A + o 0 426bada5c675 A $ cat file 0 1 @@ -226,15 +226,15 @@ amend.autorestack=no-conflict, and conflicting changes (expect cancelled restack restacking would create conflicts (hit merge conflicts in file), so you must run it manually (run `hg restack` manually to restack this commit's children) $ showgraph - @ 4 B + @ 4 3000de962fa1 B | - | o 3 D + | o 3 02cc3cc1d010 D | | - | o 2 C + | o 2 b6c0d35dc9e9 C | | - | x 1 B + | x 1 fe14e2b67b65 B |/ - o 0 A + o 0 426bada5c675 A $ cat file unmergeable! @@ -268,15 +268,15 @@ amend.autorestack=always, and conflicting changes (expect restack) $ cat file unmergeable! $ showgraph - @ 4 B + @ 4 3000de962fa1 B | - | o 3 D + | o 3 02cc3cc1d010 D | | - | o 2 C + | o 2 b6c0d35dc9e9 C | | - | x 1 B + | x 1 fe14e2b67b65 B |/ - o 0 A + o 0 426bada5c675 A Test rebasing children with obsolete children themselves needing a restack. $ newrepo @@ -303,22 +303,22 @@ Test rebasing children with obsolete children themselves needing a restack. NOTE(phillco): This currently gives the wrong result; D should either be atop C (obsolete) or C2. `amend --rebase` yields the same bug. $ showgraph - o 9 D + o 9 07e186ae8e17 D | - | o 8 C2 + | o 8 84f362759e03 C2 |/ - o 7 B + o 7 23018262b14e B | - @ 6 A + @ 6 21006be03678 A | - | x 5 D + | x 5 01f26f1a10b2 D | | - | | x 4 C2 + | | x 4 ff9eba5e2480 C2 | | | - | x | 3 C + | x | 3 b45c90359798 C | |/ - | x 2 B + | x 2 917a077edb8d B | | - | x 1 A + | x 1 ac2f7407182b A |/ - o 0 Z + o 0 48b9aae0607f Z diff --git a/tests/test-fb-hgext-fbamend-restack-divergence.t b/tests/test-fb-hgext-fbamend-restack-divergence.t index f36c591e6a..70738f7389 100644 --- a/tests/test-fb-hgext-fbamend-restack-divergence.t +++ b/tests/test-fb-hgext-fbamend-restack-divergence.t @@ -29,28 +29,28 @@ onto the newest successor of their parent. $ hg up 1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - o 4 successor 2 + o 4 cef323f40828 successor 2 | - | o 3 successor 1 + | o 3 f60c1f15a70e successor 1 |/ - | o 2 add c + | o 2 4538525df7e2 add c | | - | @ 1 add b + | @ 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg rebase --restack rebasing 2:4538525df7e2 "add c" 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - o 5 add c + o 5 b0a0bc953ac3 add c | - @ 4 successor 2 + @ 4 cef323f40828 successor 2 | - | o 3 successor 1 + | o 3 f60c1f15a70e successor 1 |/ - | x 1 add b + | x 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a Test situation with divergence due to an unamend. This should actually succeed since the successor is obsolete. @@ -66,13 +66,13 @@ since the successor is obsolete. hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints $ showgraph - @ 3 add b + @ 3 c54ee8acf83d add b | - | o 2 add c + | o 2 4538525df7e2 add c | | - | x 1 add b + | x 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg up 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo c >> b @@ -80,23 +80,23 @@ since the successor is obsolete. hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints $ showgraph - @ 4 add b + @ 4 2c965323ca2a add b | - | o 3 add b + | o 3 c54ee8acf83d add b |/ - | o 2 add c + | o 2 4538525df7e2 add c | | - | x 1 add b + | x 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg unamend $ hg up -C 3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - @ 3 add b + @ 3 c54ee8acf83d add b | - | o 2 add c + | o 2 4538525df7e2 add c | | - | o 1 add b + | o 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a diff --git a/tests/test-fb-hgext-fbamend-restack-multidest.t b/tests/test-fb-hgext-fbamend-restack-multidest.t index 01ccd6395f..e8d6bd360c 100644 --- a/tests/test-fb-hgext-fbamend-restack-multidest.t +++ b/tests/test-fb-hgext-fbamend-restack-multidest.t @@ -28,38 +28,38 @@ Restack does topological sort and only rebases "D" once: $ hg commit --amend -m B3 -q --no-rebase 2>/dev/null $ hg tag --local B3 $ showgraph - @ 6 B3 + @ 6 da1d4fe88e84 B3 | - | o 5 C + | o 5 ca53c8ceb284 C | | - | x 4 B2 + | x 4 fdcbd16a7d51 B2 |/ - | o 3 D + | o 3 f585351a92f8 D | | - | x 2 C + | x 2 26805aba1e60 C | | - | x 1 B + | x 1 112478962961 B |/ - o 0 A + o 0 426bada5c675 A $ hg rebase --restack rebasing 5:ca53c8ceb284 "C" rebasing 3:f585351a92f8 "D" (D) $ showgraph - o 8 D + o 8 981f3734c126 D | - o 7 C + o 7 bab9c1b0a249 C | - @ 6 B3 + @ 6 da1d4fe88e84 B3 | - | x 4 B2 + | x 4 fdcbd16a7d51 B2 |/ - | x 3 D + | x 3 f585351a92f8 D | | - | x 2 C + | x 2 26805aba1e60 C | | - | x 1 B + | x 1 112478962961 B |/ - o 0 A + o 0 426bada5c675 A Restack will only restack the "current" stack and leave other stacks untouched. @@ -93,25 +93,25 @@ Restack will only restack the "current" stack and leave other stacks untouched. $ rm .hg/localtags $ showgraph - o 15 K + o 15 c97827ce80f6 K | - | o 14 H + | o 14 47528c67632b H | | - | | o 13 D + | | o 13 5cb8c357af9e D | | | - o | | 9 L + o | | 9 a975bfef72d2 L | | | - | o | 7 G + | o | 7 889f49cd29f6 G | | | - | | o 5 C + | | o 5 dc0947a82db8 C | | | - | | | o 3 Z + | | | o 3 48b9aae0607f Z | | | - @ | | 2 I + @ | | 2 02a9ac6a13a6 I / / - o / 1 E + o / 1 e8e0a81d950f E / - o 0 A + o 0 426bada5c675 A The "prune" cases. @@ -139,15 +139,15 @@ The "prune" cases. $ rm .hg/localtags $ showgraph - @ 13 H + @ 13 3e1fefc3c8db H - o 12 G + o 12 0706cfb95b41 G - o 11 E + o 11 8c0ccd1582b3 E | - | o 10 D + | o 10 f88ac1d7b477 D |/ - o 9 B + o 9 653ee58caf75 B @@ -195,13 +195,13 @@ Restack could resume after resolving merge conflicts. rebasing 6:4d1ef7d890c5 "G" $ showgraph - o 8 G + o 8 3b00517bf275 G | - | @ 7 F + | @ 7 2282fe522d5c F | | - o | 4 E + o | 4 7fb047a69f22 E | | - | o 2 C + | o 2 dc0947a82db8 C |/ - o 0 A + o 0 426bada5c675 A diff --git a/tests/test-fb-hgext-fbamend-restack.t b/tests/test-fb-hgext-fbamend-restack.t index dd493d759c..8f30c53733 100644 --- a/tests/test-fb-hgext-fbamend-restack.t +++ b/tests/test-fb-hgext-fbamend-restack.t @@ -49,26 +49,26 @@ Test basic case of a single amend in a small stack. hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints $ showgraph - @ 4 add b + @ 4 c54ee8acf83d add b | - | o 3 add d + | o 3 47d2a3944de8 add d | | - | o 2 add c + | o 2 4538525df7e2 add c | | - | x 1 add b + | x 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg rebase --restack rebasing 2:4538525df7e2 "add c" rebasing 3:47d2a3944de8 "add d" $ showgraph - o 6 add d + o 6 a5821d37b1b7 add d | - o 5 add c + o 5 1764a93dcfdf add c | - @ 4 add b + @ 4 c54ee8acf83d add b | - o 0 add a + o 0 1f0dee641bb7 add a Test multiple amends of same commit. $ newrepo @@ -78,11 +78,11 @@ Test multiple amends of same commit. $ hg up 1 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ showgraph - o 2 add c + o 2 4538525df7e2 add c | - @ 1 add b + @ 1 7c3bad9141dc add b | - o 0 add a + o 0 1f0dee641bb7 add a $ echo b >> b $ hg amend @@ -91,21 +91,21 @@ Test multiple amends of same commit. $ echo b >> b $ hg amend $ showgraph - @ 4 add b + @ 4 c4c2e155d8e8 add b | - | o 2 add c + | o 2 4538525df7e2 add c | | - | x 1 add b + | x 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg rebase --restack rebasing 2:4538525df7e2 "add c" $ showgraph - o 5 add c + o 5 81909827477c add c | - @ 4 add b + @ 4 c4c2e155d8e8 add b | - o 0 add a + o 0 1f0dee641bb7 add a Test conflict during rebasing. $ newrepo @@ -122,17 +122,17 @@ Test conflict during rebasing. hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints $ showgraph - @ 5 add b + @ 5 f19e51f4d5ab add b | - | o 4 add e + | o 4 9d206ffc875e add e | | - | o 3 add d + | o 3 47d2a3944de8 add d | | - | o 2 add c + | o 2 4538525df7e2 add c | | - | x 1 add b + | x 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg rebase --restack rebasing 2:4538525df7e2 "add c" rebasing 3:47d2a3944de8 "add d" @@ -153,15 +153,15 @@ Test conflict during rebasing. rebasing 3:47d2a3944de8 "add d" rebasing 4:9d206ffc875e "add e" $ showgraph - o 8 add e + o 8 661cf3d06b05 add e | - o 7 add d + o 7 fa39a0ff8b82 add d | - o 6 add c + o 6 5532778357fd add c | - @ 5 add b + @ 5 f19e51f4d5ab add b | - o 0 add a + o 0 1f0dee641bb7 add a Test finding a stable base commit from within the old stack. $ newrepo @@ -178,26 +178,26 @@ Test finding a stable base commit from within the old stack. $ hg up 3 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - o 4 add b + o 4 c54ee8acf83d add b | - | @ 3 add d + | @ 3 47d2a3944de8 add d | | - | o 2 add c + | o 2 4538525df7e2 add c | | - | x 1 add b + | x 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg rebase --restack rebasing 2:4538525df7e2 "add c" rebasing 3:47d2a3944de8 "add d" $ showgraph - @ 6 add d + @ 6 a5821d37b1b7 add d | - o 5 add c + o 5 1764a93dcfdf add c | - o 4 add b + o 4 c54ee8acf83d add b | - o 0 add a + o 0 1f0dee641bb7 add a Test finding a stable base commit from a new child of the amended commit. $ newrepo @@ -213,30 +213,30 @@ Test finding a stable base commit from a new child of the amended commit. hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints $ mkcommit e $ showgraph - @ 5 add e + @ 5 c1992d8998fa add e | - o 4 add b + o 4 c54ee8acf83d add b | - | o 3 add d + | o 3 47d2a3944de8 add d | | - | o 2 add c + | o 2 4538525df7e2 add c | | - | x 1 add b + | x 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg rebase --restack rebasing 2:4538525df7e2 "add c" rebasing 3:47d2a3944de8 "add d" $ showgraph - o 7 add d + o 7 a5821d37b1b7 add d | - o 6 add c + o 6 1764a93dcfdf add c | - | @ 5 add e + | @ 5 c1992d8998fa add e |/ - o 4 add b + o 4 c54ee8acf83d add b | - o 0 add a + o 0 1f0dee641bb7 add a Test finding a stable base commit when there are multiple amends and a commit on top of one of the obsolete intermediate commits. @@ -262,33 +262,33 @@ a commit on top of one of the obsolete intermediate commits. $ hg up 5 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - o 6 add b + o 6 c4c2e155d8e8 add b | - | @ 5 add e + | @ 5 c1992d8998fa add e | | - | x 4 add b + | x 4 c54ee8acf83d add b |/ - | o 3 add d + | o 3 47d2a3944de8 add d | | - | o 2 add c + | o 2 4538525df7e2 add c | | - | x 1 add b + | x 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg rebase --restack rebasing 2:4538525df7e2 "add c" rebasing 3:47d2a3944de8 "add d" rebasing 5:c1992d8998fa "add e" $ showgraph - @ 9 add e + @ 9 d52a0251f17f add e | - | o 8 add d + | o 8 98270af1e2d8 add d | | - | o 7 add c + | o 7 81909827477c add c |/ - o 6 add b + o 6 c4c2e155d8e8 add b | - o 0 add a + o 0 1f0dee641bb7 add a Test that we start from the bottom of the stack. (Previously, restack would only repair the unstable children closest to the current changeset. This @@ -313,28 +313,28 @@ behavior is now incorrect -- restack should always fix the whole stack.) $ hg up 3 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - o 5 add c + o 5 a43fcd08f41f add c | - | o 4 add b + | o 4 c54ee8acf83d add b | | - | | @ 3 add d + | | @ 3 47d2a3944de8 add d | | | - +---x 2 add c + +---x 2 4538525df7e2 add c | | - x | 1 add b + x | 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg rebase --restack rebasing 5:a43fcd08f41f "add c" (tip) rebasing 3:47d2a3944de8 "add d" $ showgraph - @ 7 add d + @ 7 eb17ba71882a add d | - o 6 add c + o 6 036064f96b60 add c | - o 4 add b + o 4 c54ee8acf83d add b | - o 0 add a + o 0 1f0dee641bb7 add a Test what happens if there is no base commit found. The command should fix up everything above the current commit, leaving other commits @@ -357,33 +357,33 @@ below the current commit alone. $ hg up 1 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ showgraph - o 6 add f + o 6 79bfbab36011 add f | - | o 5 add d + | o 5 c5b31a43cdc5 add d | | - | | o 4 add e + | | o 4 9d206ffc875e add e | | | - | | x 3 add d + | | x 3 47d2a3944de8 add d | |/ - | o 2 add c + | o 2 4538525df7e2 add c | | - | @ 1 add b + | @ 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg rebase --restack rebasing 4:9d206ffc875e "add e" $ showgraph - o 7 add e + o 7 2f4697538c37 add e | - | o 6 add f + | o 6 79bfbab36011 add f | | - o | 5 add d + o | 5 c5b31a43cdc5 add d | | - o | 2 add c + o | 2 4538525df7e2 add c | | - @ | 1 add b + @ | 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a Test having an unamended commit. $ newrepo @@ -403,24 +403,24 @@ Test having an unamended commit. $ hg up -C 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - o 3 Amended + o 3 a5c6a6c11eb6 Amended | - | o 2 add c + | o 2 4538525df7e2 add c | | - | @ 1 add b + | @ 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg rebase --restack rebasing 2:4538525df7e2 "add c" 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - o 5 add c + o 5 34b2b8ed2689 add c | - @ 3 Amended + @ 3 a5c6a6c11eb6 Amended | - | x 1 add b + | x 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a Revision 2 "add c" is already stable (not orphaned) so restack does nothing: @@ -448,31 +448,31 @@ Test recursive restacking -- basic case. $ hg up 1 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ showgraph - o 5 add c + o 5 a43fcd08f41f add c | - | o 4 add b + | o 4 c54ee8acf83d add b | | - | | o 3 add d + | | o 3 47d2a3944de8 add d | | | - +---x 2 add c + +---x 2 4538525df7e2 add c | | - @ | 1 add b + @ | 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg rebase --restack rebasing 5:a43fcd08f41f "add c" (tip) rebasing 3:47d2a3944de8 "add d" 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - o 7 add d + o 7 eb17ba71882a add d | - o 6 add c + o 6 036064f96b60 add c | - @ 4 add b + @ 4 c54ee8acf83d add b | - | x 1 add b + | x 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a Test recursive restacking -- more complex case. This test is designed to to check for a bug encountered if rebasing is performed naively from the @@ -516,29 +516,29 @@ stack is lost upon rebasing lower levels. $ hg up 1 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ showgraph - o 11 add g + o 11 604f34a1983d add g | - | o 10 add h + | o 10 9f2a7cefd4b4 add h | | - | x 9 add g + | x 9 0261378a5dc1 add g |/ - o 8 add c + o 8 a43fcd08f41f add c | - | o 7 add e + | o 7 581ab389e415 add e | | - | | o 6 add f + | | o 6 2a79e3a98cd6 add f | | | - | | x 5 add e + | | x 5 c1992d8998fa add e | |/ - | o 4 add b + | o 4 c54ee8acf83d add b | | - | | o 3 add d + | | o 3 47d2a3944de8 add d | | | - +---x 2 add c + +---x 2 4538525df7e2 add c | | - @ | 1 add b + @ | 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a $ hg rebase --restack rebasing 6:2a79e3a98cd6 "add f" rebasing 8:a43fcd08f41f "add c" @@ -547,20 +547,20 @@ stack is lost upon rebasing lower levels. rebasing 10:9f2a7cefd4b4 "add h" 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - o 16 add h + o 16 02e6213e1c27 add h | - | o 15 add d + | o 15 eb17ba71882a add d | | - o | 14 add g + o | 14 cc14f12b1775 add g |/ - o 13 add c + o 13 036064f96b60 add c | - | o 12 add f + | o 12 d27ae4ec354c add f | | - | o 7 add e + | o 7 581ab389e415 add e |/ - @ 4 add b + @ 4 c54ee8acf83d add b | - | x 1 add b + | x 1 7c3bad9141dc add b |/ - o 0 add a + o 0 1f0dee641bb7 add a diff --git a/tests/test-fb-hgext-fbamend-split.t b/tests/test-fb-hgext-fbamend-split.t index b290c6fe69..0cb0716cfb 100644 --- a/tests/test-fb-hgext-fbamend-split.t +++ b/tests/test-fb-hgext-fbamend-split.t @@ -32,13 +32,13 @@ Initialize repo. $ mkcommit c $ mkcommit d $ showgraph - @ 3 add d1 and d2 + @ 3 d86136f6dbff add d1 and d2 | - o 2 add c1 and c2 + o 2 e5cbbeb3434b add c1 and c2 | - o 1 add b1 and b2 + o 1 b7fb8fde59b2 add b1 and b2 | - o 0 add a1 and a2 + o 0 c20cc4d302fc add a1 and a2 Test that split behaves correctly on error. $ hg split -r 0 1 2 @@ -71,15 +71,15 @@ Test basic case of splitting a head. Done splitting? [yN] y $ showgraph - @ 5 add d1 and d2 + @ 5 43b9beefca2e add d1 and d2 | - o 4 add d1 and d2 + o 4 3c66f08f0fd3 add d1 and d2 | - o 2 add c1 and c2 + o 2 e5cbbeb3434b add c1 and c2 | - o 1 add b1 and b2 + o 1 b7fb8fde59b2 add b1 and b2 | - o 0 add a1 and a2 + o 0 c20cc4d302fc add a1 and a2 Split in the middle of a stack. $ hg up 2 @@ -110,17 +110,17 @@ Split in the middle of a stack. rebasing 5:* "add d1 and d2"* (glob) $ showgraph - o 9 add d1 and d2 + o 9 bdb846f063c6 add d1 and d2 | - o 8 add d1 and d2 + o 8 acbc5d06143b add d1 and d2 | - @ 7 add c1 and c2 + @ 7 bff303a2c228 add c1 and c2 | - o 6 add c1 and c2 + o 6 6227053e403e add c1 and c2 | - o 1 add b1 and b2 + o 1 b7fb8fde59b2 add b1 and b2 | - o 0 add a1 and a2 + o 0 c20cc4d302fc add a1 and a2 Split with multiple children and using hash. $ hg up c20c @@ -156,21 +156,21 @@ Split with multiple children and using hash. rebasing 10:* "add d1 and d2"* (glob) $ showgraph - o 18 add d1 and d2 + o 18 5ad76779e999 add d1 and d2 | - | o 17 add d1 and d2 + | o 17 c2fa6cc56f60 add d1 and d2 | | - | o 16 add d1 and d2 + | o 16 7c766f705803 add d1 and d2 | | - | o 15 add c1 and c2 + | o 15 7300aee81508 add c1 and c2 | | - | o 14 add c1 and c2 + | o 14 7c57722f849b add c1 and c2 | | - | o 13 add b1 and b2 + | o 13 cf2484b29d75 add b1 and b2 |/ - @ 12 add a1 and a2 + @ 12 a265b3c6c419 add a1 and a2 | - o 11 add a1 and a2 + o 11 5a5595e342b1 add a1 and a2 Split using revset. $ hg strip 18 @@ -203,25 +203,25 @@ Split using revset. rebasing 17:* "add d1 and d2"* (glob) $ showgraph - o 23 add d1 and d2 + o 23 065a5bb834a6 add d1 and d2 | - o 22 add d1 and d2 + o 22 e3e63b66173e add d1 and d2 | - o 21 add c1 and c2 + o 21 6b6c4cdbcb5c add c1 and c2 | - o 20 add c1 and c2 + o 20 216c1cfd66ba add c1 and c2 | - @ 19 add b1 and b2 + @ 19 ef9770b15bd8 add b1 and b2 | - o 18 add b1 and b2 + o 18 172212eeb9e4 add b1 and b2 | - o 12 add a1 and a2 + o 12 a265b3c6c419 add a1 and a2 | - o 11 add a1 and a2 + o 11 5a5595e342b1 add a1 and a2 - o 10 add d1 and d2 + o 10 bd98a3c83a29 add d1 and d2 | - x 0 add a1 and a2 + x 0 c20cc4d302fc add a1 and a2 Test that command aborts when given multiple commits. $ hg split 11 12 @@ -237,27 +237,27 @@ Test --no-rebase flag. rebasing 22:* "add d1 and d2" (glob) rebasing 23:* "add d1 and d2" (glob) $ showgraph - o 28 add d1 and d2 + o 28 5f8ed24aed8c add d1 and d2 | - o 27 add d1 and d2 + o 27 b5591417a3eb add d1 and d2 | - o 26 add c1 and c2 + o 26 484cd1d66520 add c1 and c2 | - o 25 add c1 and c2 + o 25 e051398780c8 add c1 and c2 | - @ 24 add e1 and e2 + @ 24 c1d00dbe112a add e1 and e2 | - o 19 add b1 and b2 + o 19 ef9770b15bd8 add b1 and b2 | - o 18 add b1 and b2 + o 18 172212eeb9e4 add b1 and b2 | - o 12 add a1 and a2 + o 12 a265b3c6c419 add a1 and a2 | - o 11 add a1 and a2 + o 11 5a5595e342b1 add a1 and a2 - o 10 add d1 and d2 + o 10 bd98a3c83a29 add d1 and d2 | - x 0 add a1 and a2 + x 0 c20cc4d302fc add a1 and a2 $ hg split --no-rebase << EOF > y > y @@ -282,31 +282,31 @@ Test --no-rebase flag. Done splitting? [yN] y $ showgraph - @ 30 add e1 and e2 + @ 30 f98ad9103c3d add e1 and e2 | - o 29 add e1 and e2 + o 29 cc95492dd94d add e1 and e2 | - | o 28 add d1 and d2 + | o 28 5f8ed24aed8c add d1 and d2 | | - | o 27 add d1 and d2 + | o 27 b5591417a3eb add d1 and d2 | | - | o 26 add c1 and c2 + | o 26 484cd1d66520 add c1 and c2 | | - | o 25 add c1 and c2 + | o 25 e051398780c8 add c1 and c2 | | - | x 24 add e1 and e2 + | x 24 c1d00dbe112a add e1 and e2 |/ - o 19 add b1 and b2 + o 19 ef9770b15bd8 add b1 and b2 | - o 18 add b1 and b2 + o 18 172212eeb9e4 add b1 and b2 | - o 12 add a1 and a2 + o 12 a265b3c6c419 add a1 and a2 | - o 11 add a1 and a2 + o 11 5a5595e342b1 add a1 and a2 - o 10 add d1 and d2 + o 10 bd98a3c83a29 add d1 and d2 | - x 0 add a1 and a2 + x 0 c20cc4d302fc add a1 and a2 Test that bookmarks are correctly moved. $ reset @@ -341,9 +341,9 @@ Test that bookmarks are correctly moved. Done splitting? [yN] y $ showgraph - @ 2 add a1 and a2 + @ 2 a265b3c6c419 add a1 and a2 | - o 1 add a1 and a2 + o 1 5a5595e342b1 add a1 and a2 $ hg bookmarks test1 2:* (glob) * test2 2:* (glob) diff --git a/tests/test-fb-hgext-fold-undo.t b/tests/test-fb-hgext-fold-undo.t index 9b3236b5a3..6d79dcd339 100644 --- a/tests/test-fb-hgext-fold-undo.t +++ b/tests/test-fb-hgext-fold-undo.t @@ -20,21 +20,21 @@ Set up repo. $ hg init repo && cd repo $ hg debugbuilddag -m "+5 *4 +2" $ showgraph - o 7 r7 + o 7 9c9414e0356c r7 | - o 6 r6 + o 6 ec6d8e65acbe r6 | - o 5 r5 + o 5 77d787dfa5b6 r5 | - | o 4 r4 + | o 4 b762560d23fd r4 | | - | o 3 r3 + | o 3 a422badec216 r3 | | - | o 2 r2 + | o 2 37d4c1cec295 r2 |/ - o 1 r1 + o 1 f177fbb9e8d1 r1 | - o 0 r0 + o 0 93cbaf5e6529 r0 $ hg up 7 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -43,36 +43,36 @@ Do a fold 2 changesets folded 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ showgraph - @ 8 r7 + @ 8 ecdfa824af18 r7 | - o 5 r5 + o 5 77d787dfa5b6 r5 | - | o 4 r4 + | o 4 b762560d23fd r4 | | - | o 3 r3 + | o 3 a422badec216 r3 | | - | o 2 r2 + | o 2 37d4c1cec295 r2 |/ - o 1 r1 + o 1 f177fbb9e8d1 r1 | - o 0 r0 + o 0 93cbaf5e6529 r0 Do an undo $ hg undo undone to *, before fold --exact 7 6 (glob) $ showgraph - @ 7 r7 + @ 7 9c9414e0356c r7 | - o 6 r6 + o 6 ec6d8e65acbe r6 | - o 5 r5 + o 5 77d787dfa5b6 r5 | - | o 4 r4 + | o 4 b762560d23fd r4 | | - | o 3 r3 + | o 3 a422badec216 r3 | | - | o 2 r2 + | o 2 37d4c1cec295 r2 |/ - o 1 r1 + o 1 f177fbb9e8d1 r1 | - o 0 r0 + o 0 93cbaf5e6529 r0 diff --git a/tests/tinit.sh b/tests/tinit.sh index 692b29619e..9f81e0a2fe 100644 --- a/tests/tinit.sh +++ b/tests/tinit.sh @@ -49,5 +49,5 @@ setconfig() { } showgraph() { - hg log --graph -T "{rev} {desc|firstline}" | sed \$d + hg log --graph -T "{rev} {node|short} {desc|firstline}" | sed \$d }