Patchwork D8241: copies-tests: add a case where a file is deleted/added but with a merge

login
register
mail settings
Submitter phabricator
Date March 6, 2020, 11:52 p.m.
Message ID <4d227456b55af5e65739b4247c746ad0@localhost.localdomain>
Download mbox | patch
Permalink /patch/45595/
State Not Applicable
Headers show

Comments

phabricator - March 6, 2020, 11:52 p.m.
marmoute added a comment.
marmoute updated this revision to Diff 20593.


  series update after Martin feedback

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8241?vs=20548&id=20593

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8241/new/

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

AFFECTED FILES
  tests/test-copies-chain-merge.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
--- a/tests/test-copies-chain-merge.t
+++ b/tests/test-copies-chain-merge.t
@@ -347,6 +347,48 @@ 
   o  0 i-0 initial commit: a b h]
   
 
+Merge:
+- one with change to a file
+- one deleting and recreating the file
+
+  $ hg up 'desc("i-2")'
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo "some update" >> d
+  $ hg commit -m "g-1: update d"
+  created new head
+  $ hg up 'desc("d-2")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 'desc("g-1")' --tool :union
+  merging d
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'mDGm-0 simple merge - one way'
+  $ hg up 'desc("g-1")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 'desc("d-2")' --tool :union
+  merging d
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'mGDm-0 simple merge - the other way'
+  created new head
+  $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
+  @    27 mGDm-0 simple merge - the other way]
+  |\
+  +---o  26 mDGm-0 simple merge - one way]
+  | |/
+  | o  25 g-1]
+  | |
+  o |  14 d-2 re-add d]
+  | |
+  o |  13 d-1 delete d]
+  |/
+  o  2 i-2: c -move-> d]
+  |
+  o  1 i-1: a -move-> c]
+  |
+  o  0 i-0 initial commit: a b]
+  
+
 
 Check results
 =============
@@ -499,6 +541,9 @@ 
        2      15 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
        3      22 c72365ee036f 000000000000 000000000000
        4      23 863d9bc49190 01c2f5eabdc4 c72365ee036f
+       5      25 7bded9d9da1f 01c2f5eabdc4 000000000000
+       6      26 f04cac32d703 b004912a8510 7bded9d9da1f
+       7      27 d7a5eafb9322 7bded9d9da1f b004912a8510
 
 (This `hg log` output if wrong, since no merge actually happened).
 
@@ -655,3 +700,56 @@ 
   :
   o  0 i-0 initial commit: a b h]
   
+
+Merge:
+- one with change to a file
+- one deleting and recreating the file
+
+Unlike in the 'BD/DB' cases, an actuall merge happened here. So we should
+consider history and rename on both branch of the merge.
+
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
+  A d
+    a
+  R a
+  $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
+  A d
+    a
+  R a
+  $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
+  M d
+  $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
+  M d
+  $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
+  M d
+  $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
+  M d
+
+  $ hg log -Gfr 'desc("mDGm-0")' d
+  o    26 mDGm-0 simple merge - one way]
+  |\
+  | o  25 g-1]
+  | |
+  o |  14 d-2 re-add d]
+  |/
+  o  2 i-2: c -move-> d]
+  |
+  o  1 i-1: a -move-> c]
+  |
+  o  0 i-0 initial commit: a b]
+  
+
+
+  $ hg log -Gfr 'desc("mDGm-0")' d
+  o    26 mDGm-0 simple merge - one way]
+  |\
+  | o  25 g-1]
+  | |
+  o |  14 d-2 re-add d]
+  |/
+  o  2 i-2: c -move-> d]
+  |
+  o  1 i-1: a -move-> c]
+  |
+  o  0 i-0 initial commit: a b]
+