This is an archive of the discontinued Mercurial Phabricator instance.

copies: move short-circuiting of dirstate copies out of _forwardcopies()
ClosedPublic

Authored by martinvonz on Jul 2 2019, 1:13 PM.

Details

Summary

I'd like to move the filtering of copies we do after chaining to the
end of all chaining (in a single place in pathcopies()). One problem
that came up when trying that was that we allow things like `hg cp -f
<file> <existing file>` so the user can later amend that in. Filtering
at the end would mean that we remove those copies. That would break
hg st -C. This patch therefore moves the short-circuiting of
dirstate copies into pathcopies() so we can more easily handle the
dirstate-only case differently.

I initially thought this might change some behavior when the user does
hg status --rev 'wdir()' --rev . during an uncommitted merge, since
_backwardrenames() would reverse the copies in that case. However, I
couldn't come up with a test case where it made a difference.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

martinvonz created this revision.Jul 2 2019, 1:13 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.