# HG changeset patch # User Martin von Zweigbergk # Date 2020-09-10 20:12:34 # Node ID 85b03b1e47151f052460d9b34d3e3f6d1866f964 # Parent e7c8a5030a90d99640beb51623ab5dec996c1e20 graphlog: use '%' only if there are *unresolved* conflicts 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". Differential Revision: https://phab.mercurial-scm.org/D9007 diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -422,7 +422,7 @@ def getgraphnodecurrent(repo, ctx, cache from . import mergestate as mergestatemod mergestate = mergestatemod.mergestate.read(repo) - if mergestate.active(): + if mergestate.unresolvedcount(): merge_nodes = (mergestate.local, mergestate.other) else: merge_nodes = () diff --git a/tests/test-graft-interrupted.t b/tests/test-graft-interrupted.t --- a/tests/test-graft-interrupted.t +++ b/tests/test-graft-interrupted.t @@ -622,7 +622,7 @@ Resolve conflict: $ hg log -GT "{rev}:{node|short} {desc}\n" @ 4:2aa9ad1006ff B in file a | - | % 3:09e253b87e17 A in file a + | o 3:09e253b87e17 A in file a | | | o 2:d36c0562f908 c | | @@ -669,7 +669,7 @@ Resolve conflict: $ hg log -GT "{rev}:{node|short} {desc}\n" @ 4:2aa9ad1006ff B in file a | - | % 3:09e253b87e17 A in file a + | o 3:09e253b87e17 A in file a | | | o 2:d36c0562f908 c | | @@ -712,7 +712,7 @@ When there is conflict: $ hg log -GT "{rev}:{node|short} {desc}\n" @ 4:2aa9ad1006ff B in file a | - | % 3:09e253b87e17 A in file a + | o 3:09e253b87e17 A in file a | | | o 2:d36c0562f908 c | | diff --git a/tests/test-rebase-collapse.t b/tests/test-rebase-collapse.t --- a/tests/test-rebase-collapse.t +++ b/tests/test-rebase-collapse.t @@ -762,7 +762,7 @@ Test aborted editor on final message abort: edit failed: false exited with status 1 [255] $ hg tglog - % 3: 63668d570d21 'C' + o 3: 63668d570d21 'C' | | @ 2: 82b8abf9c185 'D' | |