D6330: tests: add test where copy source is deleted and added back

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed May 1 22:13:42 EDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc83c08cf02b7: tests: add test where copy source is deleted and added back (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6330?vs=14963&id=14975

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

AFFECTED FILES
  tests/test-rename-merge1.t

CHANGE DETAILS

diff --git a/tests/test-rename-merge1.t b/tests/test-rename-merge1.t
--- a/tests/test-rename-merge1.t
+++ b/tests/test-rename-merge1.t
@@ -184,3 +184,52 @@
   $ hg status
   M newfile
   $ cd ..
+
+Check that file is considered unrelated when deleted and recreated
+
+  $ hg init unrelated
+  $ cd unrelated
+  $ echo foo > file
+  $ hg add file
+  $ hg commit -m "added file"
+  $ hg cp file newfile
+  $ hg commit -m "copy file"
+  $ hg update 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg rm file
+  $ hg commit -m "deleted file"
+  created new head
+  $ echo bar > file
+  $ hg add file
+  $ hg ci -m 'recreate file'
+  $ hg log -G -T '{rev} {desc}\n'
+  @  3 recreate file
+  |
+  o  2 deleted file
+  |
+  | o  1 copy file
+  |/
+  o  0 added file
+  
+BROKEN: this is inconsistent with `hg merge` (below), which doesn't consider
+'file' renamed same since it was deleted for a while
+  $ hg st --copies --rev 3 --rev 1
+  M file
+  A newfile
+    file
+  $ hg merge --debug 1
+    unmatched files in other:
+     newfile
+    all copies found (* = to merge, ! = divergent, % = renamed and deleted):
+     src: 'file' -> dst: 'newfile' 
+    checking for directory renames
+  resolving manifests
+   branchmerge: True, force: False, partial: False
+   ancestor: 19d7f95df299, local: 4e4a42b1cbdf+, remote: 45b14aae7432
+   newfile: remote created -> g
+  getting newfile
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg status
+  M newfile
+  $ cd ..



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


More information about the Mercurial-devel mailing list