test: document test-copy-move-merge.t
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 13 Dec 2019 11:32:36 +0100
changeset 44258 9659ec161644
parent 44257 dbbae122f5e4
child 44259 141ceec06b55
test: document test-copy-move-merge.t Differential Revision: https://phab.mercurial-scm.org/D8077
tests/test-copy-move-merge.t
--- a/tests/test-copy-move-merge.t	Mon Feb 03 22:16:36 2020 -0500
+++ b/tests/test-copy-move-merge.t	Fri Dec 13 11:32:36 2019 +0100
@@ -1,6 +1,19 @@
 Test for the full copytracing algorithm
 =======================================
 
+
+Initial Setup
+=============
+
+use git diff to see rename
+
+  $ cat << EOF >> $HGRCPATH
+  > [diff]
+  > git=yes
+  > EOF
+
+Setup an history where one side copy and rename a file (and update it) while the other side update it.
+
   $ hg init t
   $ cd t
 
@@ -22,6 +35,59 @@
 
   $ hg ci -qAm "other"
 
+  $ hg log -G --patch
+  @  changeset:   2:add3f11052fa
+  |  tag:         tip
+  |  parent:      0:b8bf91eeebbc
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     other
+  |
+  |  diff --git a/a b/a
+  |  --- a/a
+  |  +++ b/a
+  |  @@ -1,1 +1,2 @@
+  |  +0
+  |   1
+  |
+  | o  changeset:   1:17c05bb7fcb6
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     second
+  |
+  |    diff --git a/a b/b
+  |    rename from a
+  |    rename to b
+  |    --- a/a
+  |    +++ b/b
+  |    @@ -1,1 +1,2 @@
+  |     1
+  |    +2
+  |    diff --git a/a b/c
+  |    copy from a
+  |    copy to c
+  |    --- a/a
+  |    +++ b/c
+  |    @@ -1,1 +1,2 @@
+  |     1
+  |    +2
+  |
+  o  changeset:   0:b8bf91eeebbc
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     first
+  
+     diff --git a/a b/a
+     new file mode 100644
+     --- /dev/null
+     +++ b/a
+     @@ -0,0 +1,1 @@
+     +1
+  
+
+Test Simple Merge
+=================
+
   $ hg merge --debug
     unmatched files in other:
      b
@@ -64,8 +130,10 @@
   2
 
 Test disabling copy tracing
+===========================
 
-- first verify copy metadata was kept
+first verify copy metadata was kept
+-----------------------------------
 
   $ hg up -qC 2
   $ hg rebase --keep -d 1 -b 2 --config extensions.rebase=
@@ -78,7 +146,8 @@
   1
   2
 
-- next verify copy metadata is lost when disabled
+ next verify copy metadata is lost when disabled
+------------------------------------------------
 
   $ hg strip -r . --config extensions.strip=
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -99,6 +168,7 @@
   $ cd ..
 
 Verify disabling copy tracing still keeps copies from rebase source
+-------------------------------------------------------------------
 
   $ hg init copydisable
   $ cd copydisable
@@ -131,7 +201,14 @@
 
   $ cd ../
 
-Verify we duplicate existing copies, instead of detecting them
+
+test storage preservation
+-------------------------
+
+Verify rebase do not discard recorded copies data when copy tracing usage is
+disabled.
+
+Setup
 
   $ hg init copydisable3
   $ cd copydisable3
@@ -154,6 +231,12 @@
   |/
   o  0 add a
   
+
+Actual Test
+
+A file is copied on one side and has been moved twice on the other side. the
+file is copied from `0:a`, so the file history of the `3:b` should trace directly to `0:a`.
+
   $ hg rebase -d 2 -s 3 --config extensions.rebase= --config experimental.copytrace=off
   rebasing 3:47e1a9e6273b "copy a->b (2)" (tip)
   saved backup bundle to $TESTTMP/copydisable3/.hg/strip-backup/47e1a9e6273b-2d099c59-rebase.hg