diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -287,6 +287,7 @@ def mergecopies(repo, c1, c2, ca): checkcopies(f, m2, m1) renamedelete = {} + renamedelete2 = set() diverge2 = set() for of, fl in diverge.items(): if len(fl) == 1 or of in c1 or of in c2: @@ -295,17 +296,21 @@ def mergecopies(repo, c1, c2, ca): # renamed on one side, deleted on the other side, but filter # out files that have been renamed and then deleted renamedelete[of] = [f for f in fl if f in c1 or f in c2] + renamedelete2.update(fl) # reverse map for below else: diverge2.update(fl) # reverse map for below if fullcopy: - repo.ui.debug(" all copies found (* = to merge, ! = divergent):\n") + repo.ui.debug(" all copies found (* = to merge, ! = divergent, " + "% = renamed and deleted):\n") for f in fullcopy: note = "" if f in copy: note += "*" if f in diverge2: note += "!" + if f in renamedelete2: + note += "%" repo.ui.debug(" %s -> %s %s\n" % (f, fullcopy[f], note)) del diverge2 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 @@ -24,7 +24,7 @@ unmatched files in other: b c - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): c -> a * b -> a * checking for directory renames diff --git a/tests/test-double-merge.t b/tests/test-double-merge.t --- a/tests/test-double-merge.t +++ b/tests/test-double-merge.t @@ -29,7 +29,7 @@ we get conflicts that shouldn't be there searching for copies back to rev 1 unmatched files in other: bar - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): bar -> foo * checking for directory renames resolving manifests diff --git a/tests/test-graft.t b/tests/test-graft.t --- a/tests/test-graft.t +++ b/tests/test-graft.t @@ -118,7 +118,7 @@ Graft out of order, skipping a merge and searching for copies back to rev 1 unmatched files in local: b - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b -> a * checking for directory renames resolving manifests diff --git a/tests/test-issue672.t b/tests/test-issue672.t --- a/tests/test-issue672.t +++ b/tests/test-issue672.t @@ -28,7 +28,7 @@ http://mercurial.selenic.com/bts/issue67 searching for copies back to rev 1 unmatched files in other: 1a - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): 1a -> 1 checking for directory renames resolving manifests @@ -59,7 +59,7 @@ http://mercurial.selenic.com/bts/issue67 searching for copies back to rev 1 unmatched files in local: 1a - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): 1a -> 1 * checking for directory renames resolving manifests @@ -82,7 +82,7 @@ http://mercurial.selenic.com/bts/issue67 searching for copies back to rev 1 unmatched files in other: 1a - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): 1a -> 1 * checking for directory renames resolving manifests diff --git a/tests/test-rename-dir-merge.t b/tests/test-rename-dir-merge.t --- a/tests/test-rename-dir-merge.t +++ b/tests/test-rename-dir-merge.t @@ -30,7 +30,7 @@ unmatched files in other: b/a b/b - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b/a -> a/a b/b -> a/b checking for directory renames @@ -81,7 +81,7 @@ b/b unmatched files in other: a/c - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b/a -> a/a b/b -> a/b checking for directory renames 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 @@ -28,7 +28,7 @@ unmatched files in other: b b2 - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): c2 -> a2 ! b -> a * b2 -> a2 ! @@ -171,9 +171,23 @@ Check for issue3074 $ hg rm file $ hg commit -m "deleted file" created new head - $ hg merge + $ hg merge --debug + searching for copies back to rev 1 + unmatched files in other: + newfile + all copies found (* = to merge, ! = divergent, % = renamed and deleted): + newfile -> file % + checking for directory renames + file: rename and delete -> rd + resolving manifests + overwrite: False, partial: False + ancestor: 19d7f95df299, local: 0084274f6b67+, remote: 5d32493049f0 + newfile: remote created -> g + updating: file 1/2 files (50.00%) note: possible conflict - file was deleted and renamed to: newfile + updating: newfile 2/2 files (100.00%) + getting newfile 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t --- a/tests/test-rename-merge2.t +++ b/tests/test-rename-merge2.t @@ -80,7 +80,7 @@ args: searching for copies back to rev 1 unmatched files in other: b - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b -> a * checking for directory renames resolving manifests @@ -115,7 +115,7 @@ args: searching for copies back to rev 1 unmatched files in local: b - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b -> a * checking for directory renames resolving manifests @@ -153,7 +153,7 @@ args: searching for copies back to rev 1 unmatched files in other: b - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b -> a * checking for directory renames resolving manifests @@ -188,7 +188,7 @@ args: searching for copies back to rev 1 unmatched files in local: b - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b -> a * checking for directory renames resolving manifests @@ -222,7 +222,7 @@ args: searching for copies back to rev 1 unmatched files in other: b - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b -> a checking for directory renames resolving manifests @@ -252,7 +252,7 @@ args: searching for copies back to rev 1 unmatched files in local: b - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b -> a checking for directory renames resolving manifests @@ -279,7 +279,7 @@ args: searching for copies back to rev 1 unmatched files in other: b - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b -> a checking for directory renames resolving manifests @@ -311,7 +311,7 @@ args: searching for copies back to rev 1 unmatched files in local: b - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b -> a checking for directory renames resolving manifests @@ -369,7 +369,7 @@ m "um a c" "um x c" " " "10 do merg b unmatched files in other: c - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): c -> a ! b -> a ! checking for directory renames @@ -648,7 +648,7 @@ m "um a c" "um x c" " " "10 do merg searching for copies back to rev 1 unmatched files in other: b - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b -> a * checking for directory renames resolving manifests @@ -682,7 +682,7 @@ m "um a c" "um x c" " " "10 do merg searching for copies back to rev 1 unmatched files in local: b - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b -> a * checking for directory renames resolving manifests @@ -720,7 +720,7 @@ m "nm a b" "um x a" " " "22 get a, b unmatched files in other: c - all copies found (* = to merge, ! = divergent): + all copies found (* = to merge, ! = divergent, % = renamed and deleted): b -> a * checking for directory renames resolving manifests