This is an archive of the discontinued Mercurial Phabricator instance.

graphlog: use '%' only if there are *unresolved* conflicts
ClosedPublic

Authored by martinvonz on Sep 10 2020, 4:13 PM.

Details

Summary

In 14d0e89520a2, I made graphlog use '%' for the "other" context when
there's an existing merge state. However, that has confused many
people because it shows up even if all conflicts are already resolved,
which makes it show up even after e.g. hg update -m with
automatically resolved conflicts. This patch makes it so we show the
'%' only if there still unresolved conflicts.

This patch replaces my earlier attempt in D8930, where I decided to
automatically clear the mergestate if there are no remaining
conflicts. That had the problem that it wouldn't let the user
re-resolve the conflicts using hg resolve.

Note that an in-progress "proper" merge (one that will result in a
commit with two parents, such as after hg merge) will already have
two dirstate parents before the commit happens. That means that both
sides of the merge will get drawn as '@' in the graph, since "is
dirstate parent" takes precedence over "is involved in merge
conflict".

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

martinvonz created this revision.Sep 10 2020, 4:13 PM
martinvonz edited the summary of this revision. (Show Details)Sep 10 2020, 4:21 PM
pulkit added a subscriber: pulkit.Sep 11 2020, 5:11 AM

It still does not feels good to me. In case of hg merge, we will like to show both parents even after conflicts are resolved. Showing a single parent might make user do hg commit.
But I do understand the problem you are trying to solve. I think we can have either of D8930 or this one behind a config option.

Does this affect all merge (especially hg merge) ? or just the one where the working copy has only one parent?

Since you both ask basically the same question...

It still does not feels good to me. In case of hg merge, we will like to show both parents even after conflicts are resolved. Showing a single parent might make user do hg commit.

Does this affect all merge (especially hg merge) ? or just the one where the working copy has only one parent?

No, this does not affect hg merge. After hg merge, the dirstate will have two parents, so we show two '@' symbols in the graph. The '%' has lower precedence and only shows up if it's on a node that's different from the '@' node(s).

marmoute accepted this revision.Sep 12 2020, 6:01 AM

Sounds good then :-)

(maybe update the description to state this since this is a common question)

martinvonz edited the summary of this revision. (Show Details)Sep 12 2020, 2:30 PM

(maybe update the description to state this since this is a common question)

Yes, makes sense. Done.

pulkit accepted this revision.Sep 14 2020, 3:06 AM

Since you both ask basically the same question...

It still does not feels good to me. In case of hg merge, we will like to show both parents even after conflicts are resolved. Showing a single parent might make user do hg commit.

! In D9007#135063, @marmoute wrote:

Does this affect all merge (especially hg merge) ? or just the one where the working copy has only one parent?

No, this does not affect hg merge. After hg merge, the dirstate will have two parents, so we show two '@' symbols in the graph. The '%' has lower precedence and only shows up if it's on a node that's different from the '@' node(s).

Oh, I see.

This revision is now accepted and ready to land.Sep 14 2020, 3:06 AM