This is an archive of the discontinued Mercurial Phabricator instance.

simplemerge: take arguments as annotated context objects
ClosedPublic

Authored by martinvonz on Jan 21 2022, 6:31 PM.

Details

Summary

The labels we put in conflict markers are formatted so the part before
the ':' (typically says things like "local") is padded so the ':' is
aligned among the labels. That means that if you specify a long label
for "base" but the conflict marker style is "merge" (i.e. 2-way), the
other two will have unwanted padding. We often don't specify a label
for the base, so we don't notice the problem (and it may very well be
that it didn't exist before my D11972).

I think the best fix is to pass the labels along with the context
objects, so the low-level code that switches on the marker style to
use (i.e. simplemerge) can do the formatting. This patch starts
doing that by passing a fully-formatted label to simplemerge. A
coming patch will move the formatting to simplemerge.

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

martinvonz created this revision.Jan 21 2022, 6:31 PM
Alphare requested changes to this revision.Jan 24 2022, 4:54 AM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
mercurial/simplemerge.py
520

This is slightly out of date now

This revision now requires changes to proceed.Jan 24 2022, 4:54 AM
martinvonz marked an inline comment as done.Jan 24 2022, 11:41 AM
Alphare accepted this revision.Jan 24 2022, 11:49 AM
This revision is now accepted and ready to land.Jan 24 2022, 11:49 AM