diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -313,14 +313,6 @@ source = prev[1] newcopies[dest] = (c, source) assert newcopies is not copies - for f in changes.removed: - if f in newcopies: - if newcopies is copies: - # copy on write to avoid affecting potential other - # branches. when there are no other branches, this - # could be avoided. - newcopies = copies.copy() - newcopies[f] = (c, None) othercopies = all_copies.get(c) if othercopies is None: all_copies[c] = newcopies @@ -390,7 +382,6 @@ * p2: revision number of first parent * p1copies: mapping of copies from p1 * p2copies: mapping of copies from p2 - * removed: a list of removed files * ismerged: a callback to know if file was merged in that revision """ cl = repo.changelog @@ -416,8 +407,7 @@ p1, p2 = parents(rev) ctx = repo[rev] p1copies, p2copies = ctx._copies - removed = ctx.filesremoved() - return p1, p2, p1copies, p2copies, removed, get_ismerged(rev) + return p1, p2, p1copies, p2copies, get_ismerged(rev) return revinfo @@ -435,7 +425,7 @@ # this is a root copies = {} for i, c in enumerate(children[r]): - p1, p2, p1copies, p2copies, removed, ismerged = revinfo(c) + p1, p2, p1copies, p2copies, ismerged = revinfo(c) if r == p1: parent = 1 childcopies = p1copies @@ -456,14 +446,6 @@ source = prev[1] newcopies[dest] = (c, source) assert newcopies is not copies - for f in removed: - if f in newcopies: - if newcopies is copies: - # copy on write to avoid affecting potential other - # branches. when there are no other branches, this - # could be avoided. - newcopies = copies.copy() - newcopies[f] = (c, None) othercopies = all_copies.get(c) if othercopies is None: all_copies[c] = newcopies @@ -693,8 +675,6 @@ # thing in pathcopies(): pathcopies(x, y) can return a copy where the # destination doesn't exist in y. pass - elif mb[src] != m2[src] and not _related(c2[src], base[src]): - return elif mb[src] != m2[src] or mb.flags(src) != m2.flags(src): # modified on side 2 for dst in dsts1: 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 @@ -324,10 +324,12 @@ $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")' M b A d + a (no-filelog !) R a $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")' M b A d + a (no-filelog !) R a Comparing with a merge re-adding the file afterward @@ -429,10 +431,12 @@ $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")' M b A d + a (no-filelog !) R a $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")' M b A d + a (no-filelog !) R a @@ -743,7 +747,7 @@ $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")' A d - a (filelog !) + a R a $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")' A d @@ -1010,11 +1014,11 @@ $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")' A d - a (no-compatibility no-changeset !) + a R a $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")' A d - a (no-compatibility no-changeset !) + a R a $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")' A d @@ -1074,12 +1078,12 @@ $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")' M b A d - a (no-compatibility no-changeset !) + a R a $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")' M b A d - a (no-compatibility no-changeset !) + a R a $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")' M b diff --git a/tests/test-copies-unrelated.t b/tests/test-copies-unrelated.t --- a/tests/test-copies-unrelated.t +++ b/tests/test-copies-unrelated.t @@ -100,6 +100,13 @@ |/ x o 0 add x x +#if no-filelog + $ hg debugpathcopies 0 4 + x -> y + $ hg graft -r 1 + grafting 1:* "modify x" (glob) + merging y and x to y +#else $ hg debugpathcopies 0 4 BROKEN: This should succeed and merge the changes from x into y $ hg graft -r 1 @@ -110,6 +117,7 @@ abort: unresolved conflicts, can't continue (use 'hg resolve' and 'hg graft --continue') [1] +#endif Add x, remove it, then add it back, then rename x to y. Similar to the case above, but here the break in history is before the rename. @@ -196,15 +204,9 @@ [1] #endif $ hg co -qC 2 -BROKEN: This should succeed and merge the changes from x into y $ hg graft -r 5 grafting 5:* "rename x to y"* (glob) - file 'x' was deleted in other [graft] but was modified in local [local]. - You can use (c)hanged version, (d)elete, or leave (u)nresolved. - What do you want to do? u - abort: unresolved conflicts, can't continue - (use 'hg resolve' and 'hg graft --continue') - [1] + merging x and y to y Add x, remove it, then add it back, rename x to y from the first commit. Similar to the case above, but here the break in history is parallel to the @@ -270,15 +272,9 @@ $ hg graft -r 2 grafting 2:* "add x again with different content" (glob) $ hg co -qC 2 -BROKEN: This should succeed and merge the changes from x into y $ hg graft -r 3 grafting 3:* "rename x to y" (glob) - file 'x' was deleted in other [graft] but was modified in local [local]. - You can use (c)hanged version, (d)elete, or leave (u)nresolved. - What do you want to do? u - abort: unresolved conflicts, can't continue - (use 'hg resolve' and 'hg graft --continue') - [1] + merging x and y to y Add x on two branches, then rename x to y on one side. Similar to the case above, but here the break in history is via the base commit. @@ -364,15 +360,9 @@ [1] #endif $ hg co -qC 2 -BROKEN: This should succeed and merge the changes from x into y $ hg graft -r 5 grafting 5:* "rename x to y"* (glob) - file 'x' was deleted in other [graft] but was modified in local [local]. - You can use (c)hanged version, (d)elete, or leave (u)nresolved. - What do you want to do? u - abort: unresolved conflicts, can't continue - (use 'hg resolve' and 'hg graft --continue') - [1] + merging x and y to y Copies via null revision (there shouldn't be any) $ newrepo