This is an archive of the discontinued Mercurial Phabricator instance.

merge: check for path conflicts when merging (issue5628)
ClosedPublic

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

Details

Summary

When merging, check for any path conflicts introduced by the manifest
merge and rename the conflicting file to a safe name.

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
mbthomas added inline comments.Sep 22 2017, 5:31 AM
mercurial/merge.py
905–923

This is potentially slow for large repos, as it has to iterate over the whole manifest.

What I actually want to do is find the files in the directories named by remoteconflicts, which should be a small set, however I can't see a way to do that with the manifest API. Suggestions for improvement welcome.

mbthomas updated this revision to Diff 2220.Oct 1 2017, 5:33 AM
mbthomas retitled this revision from merge: check for path conflicts when merging to merge: check for path conflicts when merging (issue5628).Oct 2 2017, 5:15 PM
mbthomas updated this revision to Diff 2361.
ryanmce accepted this revision.Oct 5 2017, 12:46 PM
ryanmce added a subscriber: ryanmce.

I'm sooooo excited by these improvements. one nit inline but this is such an improvement!

mercurial/merge.py
905–923

Correct is more important. In a future with treemanifest, I could see some potential optimization opportunities. We may consider experimenting with them inside of treemanifest and upstream the results if this turns out to be a performance concern in very large repos in the wild.

952

nit: we can be more precise here for clarity:

repo.ui.warn(_("%s: is both a file and a directory at destination\n") % p)
tests/test-audit-path.t
106–108

so much better!

ryanmce added inline comments.Oct 5 2017, 12:52 PM
mercurial/merge.py
927

nit: worth a comment as to why we strip the +

This revision was automatically updated to reflect the committed changes.