Patchwork D8077: test: document test-copy-move-merge.t

login
register
mail settings
Submitter phabricator
Date Feb. 5, 2020, 2:37 p.m.
Message ID <differential-rev-PHID-DREV-u2cdlqjobgbhhet5su23-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44954/
State Superseded
Headers show

Comments

phabricator - Feb. 5, 2020, 2:37 p.m.
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D8077

AFFECTED FILES
  tests/test-copy-move-merge.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-copy-move-merge.t b/tests/test-copy-move-merge.t
--- a/tests/test-copy-move-merge.t
+++ b/tests/test-copy-move-merge.t
@@ -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