Read about our upcoming Code of Conduct on this issue

Commit 896da244 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

copies: fix an incorrect comment in graftcopies() from recent D9802

I don't think the bit about creating a merge in the filelog was
correct. Or at least I couldn't find a case where it happened.

Differential Revision: https://phab.mercurial-scm.org/D9899
parent 29e3e46b0a22
Pipeline #17153 failed with stages
in 24 minutes and 22 seconds
......@@ -1229,8 +1229,11 @@ def graftcopies(wctx, ctx, base):
new_copies = pathcopies(base, ctx)
parent = wctx.p1()
_filter(parent, wctx, new_copies)
# extra filtering to drop copy information for files that existed before
# the graft (otherwise we would create merge filelog for non-merge commit
# Extra filtering to drop copy information for files that existed before
# the graft. This is to handle the case of grafting a rename onto a commit
# that already has the rename. Otherwise the presence of copy information
# would result in the creation of an empty commit where we would prefer to
# not create one.
for dest, __ in list(new_copies.items()):
if dest in parent:
del new_copies[dest]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment