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

login
register
mail settings
Submitter phabricator
Date March 11, 2019, 3:44 p.m.
Message ID <e681382d56d61a3f1f09a0093c0f080e@localhost.localdomain>
Download mbox | patch
Permalink /patch/39212/
State Not Applicable
Headers show

Comments

phabricator - March 11, 2019, 3:44 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGcbdd2b56d4c3: copies: add test that makes both the merging csets dirty and run w/o error (authored by khanchi97, committed by ).

REPOSITORY
  rHG Mercurial

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

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

AFFECTED FILES
  tests/test-copies.t

CHANGE DETAILS




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

Patch

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,64 @@ 
   $ hg debugpathcopies 0 5
   x -> z
 
+
+Test for a case in fullcopytracing algorithm where both the merging csets are
+"dirty"; where a dirty cset means that cset is descendant of merge 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, modified b"
+
+  $ hg l --hidden
+  @  4 added d, modified b
+  |  b d
+  | x  3 added d
+  |/   d
+  | o  2 rename b to b1
+  |/   b b1
+  o  1 added b
+  |  b
+  o  0 added a
+     a
+
+Grafting revision 4 on top of revision 2, showing that it respect the rename:
+
+  $ hg up 2 -q
+  $ hg graft -r 4 --base 3 --hidden
+  grafting 4:af28412ec03c "added d, modified b" (tip)
+  merging b1 and b to b1
+
+  $ hg l -l1 -p
+  @  5 added d, modified b
+  |  b1
+  ~  diff -r 5a4825cc2926 -r 94a2f1a0e8e2 b1
+     --- a/b1	Thu Jan 01 00:00:00 1970 +0000
+     +++ b/b1	Thu Jan 01 00:00:00 1970 +0000
+     @@ -1,1 +1,2 @@
+      b
+     +baba
+