This is an archive of the discontinued Mercurial Phabricator instance.

merge: add merge action 'p' to record path conflicts during update
ClosedPublic

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

Details

Summary

Add a new merge action to record path conflicts. A status message is
printed, and the path conflict is added to the merge state.

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
ryanmce accepted this revision.Sep 25 2017, 3:35 PM
ryanmce added a subscriber: ryanmce.

There's some opportunities here but most are definitely outside the scope of this patch. One inline to consider but do what makes sense to you.

mercurial/merge.py
1254–1263

I've seen this trick used in the mercurial codebase to fit more on a single line:

s = repo.ui.status
...
s(_("%s: path conflict - a file or link has the same name as a directory\n") % f)
...
s(_("resolve manually then use 'hg resolve --mark %s'\n") % f)
...

It may help to tighten up the code a bit here.

1717

future refactoring opportunity! -- this is incredibly ugly, but it's not your fault.

mercurial/sparse.py
490

Another future refactoring opportunity.

mbthomas updated this revision to Diff 2212.Oct 1 2017, 5:32 AM
mbthomas marked an inline comment as done.Oct 1 2017, 6:38 AM
mbthomas updated this revision to Diff 2353.Oct 2 2017, 5:15 PM
ryanmce accepted this revision.Oct 5 2017, 10:51 AM

lgtm

This revision was automatically updated to reflect the committed changes.
mbolin added a subscriber: mbolin.Oct 31 2017, 12:56 PM

What test verifies this behavior? Do we need a new one?