D5961: copies: add test that makes both the merging csets dirty and run w/o error

khanchi97 (Sushil khanchi) phabricator at mercurial-scm.org
Mon Feb 25 14:32:49 EST 2019


khanchi97 updated this revision to Diff 14239.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5961?vs=14090&id=14239

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

AFFECTED FILES
  tests/test-copies.t

CHANGE DETAILS

diff --git a/tests/test-copies.t b/tests/test-copies.t
--- a/tests/test-copies.t
+++ b/tests/test-copies.t
@@ -491,3 +491,109 @@
   $ hg debugpathcopies 0 5
   x -> z
 
+
+Test for a case in fullcopytracing algorithm where both the merging csets are
+dirty which means no cset is descendant of merging base. This test reflect
+that for this particular case this algorithm correctly find the copies:
+
+  $ cat >> $HGRCPATH << EOF
+  > [experimental]
+  > evolution.createmarkers=True
+  > evolution.allowunstable=True
+  > EOF
+
+  $ newrepo
+  $ echo a > a
+  $ hg add a
+  $ hg ci -m "added a"
+  $ echo b > b
+  $ hg add b
+  $ hg ci -m "added b"
+
+  $ hg mv b b1
+  $ hg ci -m "rename b to b1"
+ 
+  $ hg up .^
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo d > d
+  $ hg add d
+  $ hg ci -m "added d"
+  created new head
+
+  $ echo baba >> b
+  $ hg ci --amend -m "added d"
+
+  $ hg log --git -pG --hidden -T "{rev}: {node|short} {desc}\n {phase} \n\n"
+  @  4: d70f3e12cfd9 added d
+  |   draft
+  |
+  |  diff --git a/b b/b
+  |  --- a/b
+  |  +++ b/b
+  |  @@ -1,1 +1,2 @@
+  |   b
+  |  +baba
+  |  diff --git a/d b/d
+  |  new file mode 100644
+  |  --- /dev/null
+  |  +++ b/d
+  |  @@ -0,0 +1,1 @@
+  |  +d
+  |
+  | x  3: c9241b0f2d5b added d
+  |/    draft
+  |
+  |    diff --git a/d b/d
+  |    new file mode 100644
+  |    --- /dev/null
+  |    +++ b/d
+  |    @@ -0,0 +1,1 @@
+  |    +d
+  |
+  | o  2: 5a4825cc2926 rename b to b1
+  |/    draft
+  |
+  |    diff --git a/b b/b1
+  |    rename from b
+  |    rename to b1
+  |
+  o  1: 5f6d8a4bf34a added b
+  |   draft
+  |
+  |  diff --git a/b b/b
+  |  new file mode 100644
+  |  --- /dev/null
+  |  +++ b/b
+  |  @@ -0,0 +1,1 @@
+  |  +b
+  |
+  o  0: 9092f1db7931 added a
+      draft
+  
+     diff --git a/a b/a
+     new file mode 100644
+     --- /dev/null
+     +++ b/a
+     @@ -0,0 +1,1 @@
+     +a
+  
+
+Grafting revision 4 on top of revision 2, showing that it respect the rename:
+
+  $ hg up 2 -q
+  $ hg graft -r 4 --base c9241b0f2d5b --hidden
+  grafting 4:d70f3e12cfd9 "added d" (tip)
+  merging b1 and b to b1
+
+  $ hg log --git -pG -l 1 -T "{rev}: {node|short} {desc}\n {phase} \n\n"
+  @  5: 54ee32fbd09a added d
+  |   draft
+  ~
+     diff --git a/b1 b/b1
+     --- a/b1
+     +++ b/b1
+     @@ -1,1 +1,2 @@
+      b
+     +baba
+  
+



To: khanchi97, #hg-reviewers
Cc: martinvonz, mercurial-devel


More information about the Mercurial-devel mailing list