This is an archive of the discontinued Mercurial Phabricator instance.

merge: add pathconflict merge state
ClosedPublic

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

Details

Summary

Path conflicts that occur during merges are represented by 'pu' (unresolved)
and 'pr' (resolved) records in the merge state. These are stored on disk
in 'P' records.

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:27 AM
ryanmce requested changes to this revision.Sep 25 2017, 3:07 PM
ryanmce added a subscriber: ryanmce.

Logic looks good to me. Just a couple of inline nits about comments to improve understanding that I think would be useful.

mercurial/merge.py
84–87

I think it's worth mentioning why these need to be separate states (eg, so you can round-trip from resolved path conflict to unresolved path conflict)

88

Thanks for adding this!

367–368

Even though there's not a lot of good comments here, now, could you add some when you modify this?

Something like "if the state includes a path conflict (pu or pr), include a Path (P) record which ...." (I don't know what to write here -- why don't we need to distinguish between pu and pr in the record? A reader should not have to figure this out on their own, ideally.

437

Maybe this should be called addpathconflict?

This revision now requires changes to proceed.Sep 25 2017, 3:07 PM
mbthomas updated this revision to Diff 2210.Oct 1 2017, 5:32 AM
mbthomas marked 2 inline comments as done.Oct 1 2017, 6:38 AM
mbthomas added inline comments.
mercurial/merge.py
437

I named it addpath for symmetry with add. The merge state stores conflicts, so it seems superfluous to have it in the name.

kiilerix added inline comments.
mercurial/merge.py
88

Some of this is adding documentation for existing functionality? It could be nice to have this changeset show exactly what it is adding.

mbthomas updated this revision to Diff 2351.Oct 2 2017, 5:15 PM
mbthomas added inline comments.Oct 5 2017, 10:45 AM
mercurial/merge.py
367–368

This could use some improvement in general, so I'll write some comments on how this function works as a follow-up patch.

ryanmce accepted this revision.Oct 5 2017, 10:48 AM

lgtm

mercurial/merge.py
88

I'm not sure it makes sense to split out a one line comment addition into a separate patch -- but will let a more experienced reviewer make the call here.

367–368

that works for me

437

makes sense

This revision was automatically updated to reflect the committed changes.