tests/test-copytrace-heuristics.t
changeset 42183 802ae9772ced
parent 42181 1afd9d1e55ca
child 42541 3de4f17f4824
--- a/tests/test-copytrace-heuristics.t	Thu Apr 18 22:23:26 2019 -0700
+++ b/tests/test-copytrace-heuristics.t	Thu Apr 18 22:16:33 2019 -0700
@@ -17,8 +17,8 @@
   > rebase=
   > shelve=
   > [alias]
-  > l = log -G -T 'changeset: {node}\n desc: {desc}\n'
-  > pl = log -G -T 'changeset: {node}\n desc: {desc}, phase: {phase}\n'
+  > l = log -G -T 'rev: {rev}\ndesc: {desc}\n'
+  > pl = log -G -T 'rev: {rev}, phase: {phase}\ndesc: {desc}\n'
   > EOF
 
 NOTE: calling initclient() set copytrace.sourcecommitlimit=-1 as we want to
@@ -47,12 +47,12 @@
   $ hg ci -qm 'mod a, mod dir/file.txt'
 
   $ hg l
-  @  changeset: 557f403c0afd2a3cf15d7e2fb1f1001a8b85e081
-  |   desc: mod a, mod dir/file.txt
-  | o  changeset: 928d74bc9110681920854d845c06959f6dfc9547
-  |/    desc: mv a b, mv dir/ dir2/
-  o  changeset: 3c482b16e54596fed340d05ffaf155f156cda7ee
-      desc: initial
+  @  rev: 2
+  |  desc: mod a, mod dir/file.txt
+  | o  rev: 1
+  |/   desc: mv a b, mv dir/ dir2/
+  o  rev: 0
+     desc: initial
 
   $ hg rebase -s . -d 1
   rebasing 2:557f403c0afd "mod a, mod dir/file.txt" (tip)
@@ -80,12 +80,12 @@
   $ hg ci -qm 'mode a'
 
   $ hg l
-  @  changeset: d526312210b9e8f795d576a77dc643796384d86e
-  |   desc: mode a
-  | o  changeset: 46985f76c7e5e5123433527f5c8526806145650b
-  |/    desc: rm a, add b
-  o  changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
-      desc: initial
+  @  rev: 2
+  |  desc: mode a
+  | o  rev: 1
+  |/   desc: rm a, add b
+  o  rev: 0
+     desc: initial
 
   $ hg rebase -s . -d 1
   rebasing 2:d526312210b9 "mode a" (tip)
@@ -117,14 +117,14 @@
   $ hg ci -qm 'mod a'
 
   $ hg pl
-  @  changeset: 9d5cf99c3d9f8e8b05ba55421f7f56530cfcf3bc
-  |   desc: mod a, phase: draft
-  | o  changeset: d760186dd240fc47b91eb9f0b58b0002aaeef95d
-  |/    desc: mv a b, phase: draft
-  o  changeset: 48e1b6ba639d5d7fb313fa7989eebabf99c9eb83
-  |   desc: randomcommit, phase: draft
-  o  changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
-      desc: initial, phase: draft
+  @  rev: 3, phase: draft
+  |  desc: mod a
+  | o  rev: 2, phase: draft
+  |/   desc: mv a b
+  o  rev: 1, phase: draft
+  |  desc: randomcommit
+  o  rev: 0, phase: draft
+     desc: initial
 
   $ hg rebase -s . -d 2
   rebasing 3:9d5cf99c3d9f "mod a" (tip)
@@ -152,14 +152,14 @@
   $ hg ci -qm 'mod b'
 
   $ hg l
-  @  changeset: fbe97126b3969056795c462a67d93faf13e4d298
-  |   desc: mod b
-  o  changeset: d760186dd240fc47b91eb9f0b58b0002aaeef95d
-  |   desc: mv a b
-  o  changeset: 48e1b6ba639d5d7fb313fa7989eebabf99c9eb83
-  |   desc: randomcommit
-  o  changeset: e5b71fb099c29d9172ef4a23485aaffd497e4cc0
-      desc: initial
+  @  rev: 3
+  |  desc: mod b
+  o  rev: 2
+  |  desc: mv a b
+  o  rev: 1
+  |  desc: randomcommit
+  o  rev: 0
+     desc: initial
 
   $ hg rebase -s . -d 0
   rebasing 3:fbe97126b396 "mod b" (tip)
@@ -189,14 +189,14 @@
   $ hg ci -qm 'mod dir/a'
 
   $ hg l
-  @  changeset: 6b2f4cece40fd320f41229f23821256ffc08efea
-  |   desc: mod dir/a
-  | o  changeset: 4494bf7efd2e0dfdd388e767fb913a8a3731e3fa
-  | |   desc: create dir2/a
-  | o  changeset: b1784dfab6ea6bfafeb11c0ac50a2981b0fe6ade
-  |/    desc: mv dir/a dir/b
-  o  changeset: 36859b8907c513a3a87ae34ba5b1e7eea8c20944
-      desc: initial
+  @  rev: 3
+  |  desc: mod dir/a
+  | o  rev: 2
+  | |  desc: create dir2/a
+  | o  rev: 1
+  |/   desc: mv dir/a dir/b
+  o  rev: 0
+     desc: initial
 
   $ hg rebase -s . -d 2
   rebasing 3:6b2f4cece40f "mod dir/a" (tip)
@@ -234,12 +234,12 @@
   created new head
 
   $ hg l
-  @  changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
-  |   desc: mod a
-  | o  changeset: 8329d5c6bf479ec5ca59b9864f3f45d07213f5a4
-  |/    desc: mv a foo, add many files
-  o  changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
-      desc: initial
+  @  rev: 2
+  |  desc: mod a
+  | o  rev: 1
+  |/   desc: mv a foo, add many files
+  o  rev: 0
+     desc: initial
 
 With small limit
 
@@ -282,12 +282,12 @@
   created new head
 
   $ hg pl
-  @  changeset: 7d61ee3b1e48577891a072024968428ba465c47b
-  |   desc: del a, phase: draft
-  | o  changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
-  |/    desc: mv a b, phase: draft
-  o  changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
-      desc: initial, phase: draft
+  @  rev: 2, phase: draft
+  |  desc: del a
+  | o  rev: 1, phase: draft
+  |/   desc: mv a b
+  o  rev: 0, phase: draft
+     desc: initial
 
   $ hg rebase -s 1 -d 2
   rebasing 1:472e38d57782 "mv a b"
@@ -315,12 +315,12 @@
   $ hg ci -qm 'mv dir/ dir2/'
 
   $ hg l
-  @  changeset: a33d80b6e352591dfd82784e1ad6cdd86b25a239
-  |   desc: mv dir/ dir2/
-  | o  changeset: 6b2f4cece40fd320f41229f23821256ffc08efea
-  |/    desc: mod dir/a
-  o  changeset: 36859b8907c513a3a87ae34ba5b1e7eea8c20944
-      desc: initial
+  @  rev: 2
+  |  desc: mv dir/ dir2/
+  | o  rev: 1
+  |/   desc: mod dir/a
+  o  rev: 0
+     desc: initial
 
   $ hg rebase -s . -d 1
   rebasing 2:a33d80b6e352 "mv dir/ dir2/" (tip)
@@ -349,14 +349,14 @@
   created new head
 
   $ hg l
-  @  changeset: d413169422167a3fa5275fc5d71f7dea9f5775f3
-  |   desc: mod a
-  | o  changeset: d3efd280421d24f9f229997c19e654761c942a71
-  | |   desc: mv b c
-  | o  changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
-  |/    desc: mv a b
-  o  changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
-      desc: initial
+  @  rev: 3
+  |  desc: mod a
+  | o  rev: 2
+  | |  desc: mv b c
+  | o  rev: 1
+  |/   desc: mv a b
+  o  rev: 0
+     desc: initial
   $ hg rebase -s . -d 2
   rebasing 3:d41316942216 "mod a" (tip)
   merging c and a to c
@@ -383,14 +383,14 @@
   $ hg ci -m 'mod a'
   created new head
   $ hg l
-  @  changeset: d413169422167a3fa5275fc5d71f7dea9f5775f3
-  |   desc: mod a
-  | o  changeset: d3efd280421d24f9f229997c19e654761c942a71
-  | |   desc: mv b c
-  | o  changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
-  |/    desc: mv a b
-  o  changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
-      desc: initial
+  @  rev: 3
+  |  desc: mod a
+  | o  rev: 2
+  | |  desc: mv b c
+  | o  rev: 1
+  |/   desc: mv a b
+  o  rev: 0
+     desc: initial
   $ hg rebase -s 1 -d .
   rebasing 1:472e38d57782 "mv a b"
   merging a and b to b
@@ -421,14 +421,14 @@
   created new head
 
   $ hg l
-  @  changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
-  |   desc: mod a
-  | o  changeset: b1a6187e79fbce851bb584eadcb0cc4a80290fd9
-  | |   desc: add c
-  | o  changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
-  |/    desc: mv a b
-  o  changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
-      desc: initial
+  @  rev: 3
+  |  desc: mod a
+  | o  rev: 2
+  | |  desc: add c
+  | o  rev: 1
+  |/   desc: mv a b
+  o  rev: 0
+     desc: initial
 
   $ hg rebase -s . -d 2
   rebasing 3:ef716627c70b "mod a" (tip)
@@ -459,12 +459,12 @@
   $ hg up -q 2
 
   $ hg l
-  @  changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
-  |   desc: mv a b
-  | o  changeset: b0357b07f79129a3d08a68621271ca1352ae8a09
-  |/    desc: modify a
-  o  changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
-      desc: initial
+  @  rev: 2
+  |  desc: mv a b
+  | o  rev: 1
+  |/   desc: modify a
+  o  rev: 0
+     desc: initial
 
   $ hg merge 1
   merging b and a to b
@@ -494,12 +494,12 @@
   created new head
 
   $ hg l
-  @  changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
-  |   desc: mod a
-  | o  changeset: 4fc3fd13fbdb89ada6b75bfcef3911a689a0dde8
-  |/    desc: cp a c, mv a b
-  o  changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
-      desc: initial
+  @  rev: 2
+  |  desc: mod a
+  | o  rev: 1
+  |/   desc: cp a c, mv a b
+  o  rev: 0
+     desc: initial
 
   $ hg rebase -s . -d 1
   rebasing 2:ef716627c70b "mod a" (tip)
@@ -534,14 +534,14 @@
   $ hg ci -qm 'mv b c'
   $ hg up -q 1
   $ hg l
-  o  changeset: d3efd280421d24f9f229997c19e654761c942a71
-  |   desc: mv b c
-  o  changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
-  |   desc: mv a b
-  | @  changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
-  |/    desc: mod a
-  o  changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
-      desc: initial
+  o  rev: 3
+  |  desc: mv b c
+  o  rev: 2
+  |  desc: mv a b
+  | @  rev: 1
+  |/   desc: mod a
+  o  rev: 0
+     desc: initial
 
   $ hg merge 3
   merging a and c to c
@@ -549,16 +549,16 @@
   (branch merge, don't forget to commit)
   $ hg ci -qm 'merge'
   $ hg pl
-  @    changeset: cd29b0d08c0f39bfed4cde1b40e30f419db0c825
-  |\    desc: merge, phase: draft
-  | o  changeset: d3efd280421d24f9f229997c19e654761c942a71
-  | |   desc: mv b c, phase: draft
-  | o  changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
-  | |   desc: mv a b, phase: draft
-  o |  changeset: ef716627c70bf4ca0bdb623cfb0d6fe5b9acc51e
-  |/    desc: mod a, phase: draft
-  o  changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
-      desc: initial, phase: draft
+  @    rev: 4, phase: draft
+  |\   desc: merge
+  | o  rev: 3, phase: draft
+  | |  desc: mv b c
+  | o  rev: 2, phase: draft
+  | |  desc: mv a b
+  o |  rev: 1, phase: draft
+  |/   desc: mod a
+  o  rev: 0, phase: draft
+     desc: initial
   $ ls
   c
   $ cd ..
@@ -581,10 +581,10 @@
   $ hg ci -m 'mv a b'
 
   $ hg l
-  @  changeset: 472e38d57782172f6c6abed82a94ca0d998c3a22
-  |   desc: mv a b
-  o  changeset: 1451231c87572a7d3f92fc210b4b35711c949a98
-      desc: initial
+  @  rev: 1
+  |  desc: mv a b
+  o  rev: 0
+     desc: initial
   $ hg unshelve
   unshelving change 'default'
   rebasing shelved changes
@@ -618,12 +618,12 @@
   $ hg ci -qm 'mod a'
 
   $ hg pl
-  @  changeset: 6207d2d318e710b882e3d5ada2a89770efc42c96
-  |   desc: mod a, phase: draft
-  | o  changeset: abffdd4e3dfc04bc375034b970299b2a309a1cce
-  |/    desc: mv a b; mv dir1 dir2, phase: draft
-  o  changeset: 81973cd24b58db2fdf18ce3d64fb2cc3284e9ab3
-      desc: initial, phase: draft
+  @  rev: 2, phase: draft
+  |  desc: mod a
+  | o  rev: 1, phase: draft
+  |/   desc: mv a b; mv dir1 dir2
+  o  rev: 0, phase: draft
+     desc: initial
 
   $ hg rebase -s . -d 1 --config experimental.copytrace.sourcecommitlimit=100
   rebasing 2:6207d2d318e7 "mod a" (tip)
@@ -656,12 +656,12 @@
   $ hg ci -qm 'mv dir1 dir2'
 
   $ hg pl
-  @  changeset: e8919e7df8d036e07b906045eddcd4a42ff1915f
-  |   desc: mv dir1 dir2, phase: draft
-  | o  changeset: 7c7c6f339be00f849c3cb2df738ca91db78b32c8
-  |/    desc: hg add dir1/a, phase: draft
-  o  changeset: a235dcce55dcf42034c4e374cb200662d0bb4a13
-      desc: initial, phase: draft
+  @  rev: 2, phase: draft
+  |  desc: mv dir1 dir2
+  | o  rev: 1, phase: draft
+  |/   desc: hg add dir1/a
+  o  rev: 0, phase: draft
+     desc: initial
 
   $ hg rebase -s . -d 1 --config experimental.copytrace.sourcecommitlimit=100
   rebasing 2:e8919e7df8d0 "mv dir1 dir2" (tip)
@@ -689,18 +689,18 @@
   $ hg mv a foo/bar
   $ hg ci -m "Moved a to foo/bar"
   $ hg pl
-  @  changeset: b4b0f7880e500b5c364a5f07b4a2b167de7a6fb0
-  |   desc: Moved a to foo/bar, phase: draft
-  o  changeset: 5f6d8a4bf34ab274ccc9f631c2536964b8a3666d
-  |   desc: added b, phase: draft
-  | o  changeset: 8b6e13696c38e8445a759516474640c2f8dddef6
-  |/    desc: added more things to a, phase: draft
-  o  changeset: 9092f1db7931481f93b37d5c9fbcfc341bcd7318
-      desc: added a, phase: draft
+  @  rev: 3, phase: draft
+  |  desc: Moved a to foo/bar
+  o  rev: 2, phase: draft
+  |  desc: added b
+  | o  rev: 1, phase: draft
+  |/   desc: added more things to a
+  o  rev: 0, phase: draft
+     desc: added a
 
 When the sourcecommitlimit is small and we have more drafts, we use heuristics only
 
-  $ hg rebase -s 8b6e13696 -d .
+  $ hg rebase -s 1 -d .
   rebasing 1:8b6e13696c38 "added more things to a"
   file 'a' was deleted in local [dest] but was modified in other [source].
   What do you want to do?
@@ -713,7 +713,7 @@
 
   $ hg rebase --abort
   rebase aborted
-  $ hg rebase -s 8b6e13696 -d . --config experimental.copytrace.sourcecommitlimit=100
+  $ hg rebase -s 1 -d . --config experimental.copytrace.sourcecommitlimit=100
   rebasing 1:8b6e13696c38 "added more things to a"
   merging foo/bar and a to foo/bar
   saved backup bundle to $TESTTMP/repo/repo/repo/.hg/strip-backup/8b6e13696c38-fc14ac83-rebase.hg