This is an archive of the discontinued Mercurial Phabricator instance.

merge: add merge action 'pr' to rename files during update
ClosedPublic

Authored by mbthomas on Sep 22 2017, 5:28 AM.

Details

Summary

Add a new merge action to handle a path conflict by renaming the conflicting
file to a safe name.

The rename is just to avoid problems on the filesystem. The conflict is still
considered unresolved until the user marks the original path as resolved.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mbthomas created this revision.Sep 22 2017, 5:28 AM

Looks good. One question inline.

mercurial/merge.py
1463

Thanks for remembering to preserve copy information!

Did you test with transitive renames? Something like:

I rename a -> b
I run hg update @ and @ has a new directory b
Then b gets renamed to b.blahblah
Does this properly cover the rename from a to b.blahblah after that?

mbthomas added inline comments.Sep 26 2017, 10:58 AM
mercurial/merge.py
1463

I had tested transitive renames after update, but not before. I'll fix it up and add a test.

mbthomas updated this revision to Diff 2213.Oct 1 2017, 5:32 AM
mbthomas marked 2 inline comments as done.Oct 1 2017, 5:51 AM
mbthomas updated this revision to Diff 2354.Oct 2 2017, 5:15 PM
mbthomas added inline comments.Oct 5 2017, 12:03 PM
mercurial/merge.py
1463

Test added as Update - local renamed file conflicts with remote directory in D786.

ryanmce accepted this revision.Oct 5 2017, 12:18 PM

lgtm

This revision was automatically updated to reflect the committed changes.