Patchwork [2,of,3] summary: add other/local markers for merges [RFC]

login
register
mail settings
Submitter timeless@mozdev.org
Date April 4, 2016, 9:13 a.m.
Message ID <8b2619f31878755dbe66.1459761218@waste.org>
Download mbox | patch
Permalink /patch/14333/
State Superseded, archived
Headers show

Comments

timeless@mozdev.org - April 4, 2016, 9:13 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1459760948 0
#      Mon Apr 04 09:09:08 2016 +0000
# Node ID 8b2619f31878755dbe66e15788df455625c16aa0
# Parent  351a972e12d3fae7e291bb8ce61b2a2e9f0225d6
summary: add other/local markers for merges [RFC]
Pierre-Yves David - April 13, 2016, 6:12 a.m.
What happened to the proposal to have the label on the same line as the  
"parent: 4:ed99997b793d" thing?

On 04/04/2016 02:13 AM, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1459760948 0
> #      Mon Apr 04 09:09:08 2016 +0000
> # Node ID 8b2619f31878755dbe66e15788df455625c16aa0
> # Parent  351a972e12d3fae7e291bb8ce61b2a2e9f0225d6
> summary: add other/local markers for merges [RFC]
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -6598,6 +6598,13 @@
>       conflicts = ms is not None and ms.active()
>       localctx = otherctx = repo[nullrev]
>       def shownode(label, p):
> +        def mergelabel(key, v):
> +            try:
> +                label = ms._labels[v]
> +                return '%s (%s)' % (key, label)
> +            except TypeError:
> +                return key
> +
>           # label with log.changeset (instead of log.parent) since this
>           # shows a working directory parent *changeset*:
>           ui.write(label % (p.rev(), str(p)),
> @@ -6613,6 +6620,14 @@
>               else:
>                   ui.write(_(' (no revision checked out)'))
>           ui.write('\n')
> +        if conflicts:
> +            merging = ''
> +            # these are not for translation
> +            if p == localctx:
> +                merging = mergelabel('local', 0)
> +            elif p == otherctx:
> +                merging = mergelabel('other', 1)
> +            ui.write(_('merging: %s\n') % merging)
>           if p.description():
>               ui.status(' ' + p.description().splitlines()[0].strip() + '\n',
>                         label='log.summary')
> diff --git a/tests/test-backout.t b/tests/test-backout.t
> --- a/tests/test-backout.t
> +++ b/tests/test-backout.t
> @@ -81,8 +81,10 @@
>     [1]
>     $ hg summary
>     parent: 4:ed99997b793d tip
> +  merging: local
>      ypples
>     source: 1:22cb4f70d813
> +  merging: other
>      chair
>     branch: default
>     commit: 1 unresolved (clean)
> @@ -706,8 +708,10 @@
>     U foo
>     $ hg summary
>     parent: 2:b71750c4b0fd tip
> +  merging: local
>      capital ten
>     source: 0:a30dd8addae3
> +  merging: other
>      initial
>     branch: default
>     commit: 1 unresolved (clean)
> @@ -727,8 +731,10 @@
>     R foo
>     $ hg summary
>     parent: 2:b71750c4b0fd tip
> +  merging: local
>      capital ten
>     source: 0:a30dd8addae3
> +  merging: other
>      initial
>     branch: default
>     commit: 1 modified, 1 unknown
> diff --git a/tests/test-graft.t b/tests/test-graft.t
> --- a/tests/test-graft.t
> +++ b/tests/test-graft.t
> @@ -214,7 +214,7 @@
>   
>   Summary should mention graft:
>   
> -  $ hg summary |grep graft
> +  $ hg summary |grep 'graft in'
>     commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
>   
>   Commit while interrupted should fail:
> diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t
> --- a/tests/test-rebase-parameters.t
> +++ b/tests/test-rebase-parameters.t
> @@ -471,8 +471,10 @@
>   
>     $ hg summary
>     parent: 1:56daeba07f4b
> +  merging: local (dest)
>      c2
>     parent: 2:e4e3f3546619 tip
> +  merging: other (source)
>      c2b
>     branch: default
>     commit: 1 modified, 1 unresolved (merge)
> diff --git a/tests/test-shelve.t b/tests/test-shelve.t
> --- a/tests/test-shelve.t
> +++ b/tests/test-shelve.t
> @@ -866,8 +866,10 @@
>     ? foo/foo
>     $ hg summary
>     parent: 4:33f7f61e6c5e tip
> +  merging: local (dest)
>      create conflict
>     source: -1:000000000000  (no associated revision)
> +  merging: other (source)
>     branch: default
>     bookmarks: *test
>     commit: 2 unknown (clean)
> diff --git a/tests/test-strip.t b/tests/test-strip.t
> --- a/tests/test-strip.t
> +++ b/tests/test-strip.t
> @@ -490,8 +490,10 @@
>     [1]
>     $ hg sum
>     parent: 1:76dcf9fab855 tip
> +  merging: other (destination)
>      b
>     source: 0:9ab35a2d17cb
> +  merging: local (working copy)
>      a
>     branch: default
>     commit: 1 modified, 1 unknown, 1 unresolved
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
timeless - May 3, 2016, 4:41 p.m.
Some of these have too many potential tags (from tags), making the
lines potentially hard to read/scan.
Also, there are multiple pieces of information to expose (merging,
side, label) each of which could be localized. Mixing three things
into a potentially unbounded line of other stuff is too complicated
for me to reason through at this point.

If someone else wants to rearrange the bike shed later, they're
welcome to do so. I might even be able to help them pick the color.

In the interim, I can't get my bike w/ sidecar out of the shed because
I can't find the door for the sidecar. :/

On Wed, Apr 13, 2016 at 2:12 AM, Pierre-Yves David
<pierre-yves.david@ens-lyon.org> wrote:
> What happened to the proposal to have the label on the same line as the
> "parent: 4:ed99997b793d" thing?
>
>
> On 04/04/2016 02:13 AM, timeless wrote:
>>
>> # HG changeset patch
>> # User timeless <timeless@mozdev.org>
>> # Date 1459760948 0
>> #      Mon Apr 04 09:09:08 2016 +0000
>> # Node ID 8b2619f31878755dbe66e15788df455625c16aa0
>> # Parent  351a972e12d3fae7e291bb8ce61b2a2e9f0225d6
>> summary: add other/local markers for merges [RFC]
>>
>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>> --- a/mercurial/commands.py
>> +++ b/mercurial/commands.py
>> @@ -6598,6 +6598,13 @@
>>       conflicts = ms is not None and ms.active()
>>       localctx = otherctx = repo[nullrev]
>>       def shownode(label, p):
>> +        def mergelabel(key, v):
>> +            try:
>> +                label = ms._labels[v]
>> +                return '%s (%s)' % (key, label)
>> +            except TypeError:
>> +                return key
>> +
>>           # label with log.changeset (instead of log.parent) since this
>>           # shows a working directory parent *changeset*:
>>           ui.write(label % (p.rev(), str(p)),
>> @@ -6613,6 +6620,14 @@
>>               else:
>>                   ui.write(_(' (no revision checked out)'))
>>           ui.write('\n')
>> +        if conflicts:
>> +            merging = ''
>> +            # these are not for translation
>> +            if p == localctx:
>> +                merging = mergelabel('local', 0)
>> +            elif p == otherctx:
>> +                merging = mergelabel('other', 1)
>> +            ui.write(_('merging: %s\n') % merging)
>>           if p.description():
>>               ui.status(' ' + p.description().splitlines()[0].strip() +
>> '\n',
>>                         label='log.summary')
>> diff --git a/tests/test-backout.t b/tests/test-backout.t
>> --- a/tests/test-backout.t
>> +++ b/tests/test-backout.t
>> @@ -81,8 +81,10 @@
>>     [1]
>>     $ hg summary
>>     parent: 4:ed99997b793d tip
>> +  merging: local
>>      ypples
>>     source: 1:22cb4f70d813
>> +  merging: other
>>      chair
>>     branch: default
>>     commit: 1 unresolved (clean)
>> @@ -706,8 +708,10 @@
>>     U foo
>>     $ hg summary
>>     parent: 2:b71750c4b0fd tip
>> +  merging: local
>>      capital ten
>>     source: 0:a30dd8addae3
>> +  merging: other
>>      initial
>>     branch: default
>>     commit: 1 unresolved (clean)
>> @@ -727,8 +731,10 @@
>>     R foo
>>     $ hg summary
>>     parent: 2:b71750c4b0fd tip
>> +  merging: local
>>      capital ten
>>     source: 0:a30dd8addae3
>> +  merging: other
>>      initial
>>     branch: default
>>     commit: 1 modified, 1 unknown
>> diff --git a/tests/test-graft.t b/tests/test-graft.t
>> --- a/tests/test-graft.t
>> +++ b/tests/test-graft.t
>> @@ -214,7 +214,7 @@
>>     Summary should mention graft:
>>   -  $ hg summary |grep graft
>> +  $ hg summary |grep 'graft in'
>>     commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
>>     Commit while interrupted should fail:
>> diff --git a/tests/test-rebase-parameters.t
>> b/tests/test-rebase-parameters.t
>> --- a/tests/test-rebase-parameters.t
>> +++ b/tests/test-rebase-parameters.t
>> @@ -471,8 +471,10 @@
>>       $ hg summary
>>     parent: 1:56daeba07f4b
>> +  merging: local (dest)
>>      c2
>>     parent: 2:e4e3f3546619 tip
>> +  merging: other (source)
>>      c2b
>>     branch: default
>>     commit: 1 modified, 1 unresolved (merge)
>> diff --git a/tests/test-shelve.t b/tests/test-shelve.t
>> --- a/tests/test-shelve.t
>> +++ b/tests/test-shelve.t
>> @@ -866,8 +866,10 @@
>>     ? foo/foo
>>     $ hg summary
>>     parent: 4:33f7f61e6c5e tip
>> +  merging: local (dest)
>>      create conflict
>>     source: -1:000000000000  (no associated revision)
>> +  merging: other (source)
>>     branch: default
>>     bookmarks: *test
>>     commit: 2 unknown (clean)
>> diff --git a/tests/test-strip.t b/tests/test-strip.t
>> --- a/tests/test-strip.t
>> +++ b/tests/test-strip.t
>> @@ -490,8 +490,10 @@
>>     [1]
>>     $ hg sum
>>     parent: 1:76dcf9fab855 tip
>> +  merging: other (destination)
>>      b
>>     source: 0:9ab35a2d17cb
>> +  merging: local (working copy)
>>      a
>>     branch: default
>>     commit: 1 modified, 1 unknown, 1 unresolved
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel@mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Pierre-Yves David - May 5, 2016, 11:30 p.m.
On 05/03/2016 06:41 PM, timeless wrote:
> Some of these have too many potential tags (from tags), making the
> lines potentially hard to read/scan.

I don't really get this argument. if we put this data first (and it 
probably deserve it is rare and important), it will always be 
accessible, in case of many tags, this will always be messy so it does 
not really change anything.

However this highlight the fact if people are parsing this line, we 
cannot really change its content :-/

> Also, there are multiple pieces of information to expose (merging,
> side, label) each of which could be localized. Mixing three things
> into a potentially unbounded line of other stuff is too complicated
> for me to reason through at this point.

The "merging" data seems already included in the fact we have two 
parents. But it is true that we have already two pieces of information 
(and can find more in the future) so it deserve some space.

> If someone else wants to rearrange the bike shed later, they're
> welcome to do so. I might even be able to help them pick the color.
>
> In the interim, I can't get my bike w/ sidecar out of the shed because
> I can't find the door for the sidecar. :/

My main issue is that I find the proposed format very confusing:

Even before you change, the link between parent and the summary line is 
not obvious to me,

   parent: 4:ed99997b793d tip
      ypples

But with your change,

   parent: 4:ed99997b793d tip
   merging: local
      ypples

I find this link even more confusing. Part of it comes from the fact 
"merging:" looks like any other summary entry so the link with the 
previous one is not clear to me. Maybe some extra indentation would help.

Do you think you could come with a couple of other output proposal we 
could discuss?

On Wed, Apr 13, 2016 at 2:12 AM, Pierre-Yves David 
<pierre-yves.david@ens-lyon.org> wrote:
>> What happened to the proposal to have the label on the same line as the
>> "parent: 4:ed99997b793d" thing?
>>
>>
>> On 04/04/2016 02:13 AM, timeless wrote:
>>> # HG changeset patch
>>> # User timeless <timeless@mozdev.org>
>>> # Date 1459760948 0
>>> #      Mon Apr 04 09:09:08 2016 +0000
>>> # Node ID 8b2619f31878755dbe66e15788df455625c16aa0
>>> # Parent  351a972e12d3fae7e291bb8ce61b2a2e9f0225d6
>>> summary: add other/local markers for merges [RFC]
>>>
>>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>>> --- a/mercurial/commands.py
>>> +++ b/mercurial/commands.py
>>> @@ -6598,6 +6598,13 @@
>>>        conflicts = ms is not None and ms.active()
>>>        localctx = otherctx = repo[nullrev]
>>>        def shownode(label, p):
>>> +        def mergelabel(key, v):
>>> +            try:
>>> +                label = ms._labels[v]
>>> +                return '%s (%s)' % (key, label)
>>> +            except TypeError:
>>> +                return key
>>> +
>>>            # label with log.changeset (instead of log.parent) since this
>>>            # shows a working directory parent *changeset*:
>>>            ui.write(label % (p.rev(), str(p)),
>>> @@ -6613,6 +6620,14 @@
>>>                else:
>>>                    ui.write(_(' (no revision checked out)'))
>>>            ui.write('\n')
>>> +        if conflicts:
>>> +            merging = ''
>>> +            # these are not for translation
>>> +            if p == localctx:
>>> +                merging = mergelabel('local', 0)
>>> +            elif p == otherctx:
>>> +                merging = mergelabel('other', 1)
>>> +            ui.write(_('merging: %s\n') % merging)
>>>            if p.description():
>>>                ui.status(' ' + p.description().splitlines()[0].strip() +
>>> '\n',
>>>                          label='log.summary')
>>> diff --git a/tests/test-backout.t b/tests/test-backout.t
>>> --- a/tests/test-backout.t
>>> +++ b/tests/test-backout.t
>>> @@ -81,8 +81,10 @@
>>>      [1]
>>>      $ hg summary
>>>      parent: 4:ed99997b793d tip
>>> +  merging: local
>>>       ypples
>>>      source: 1:22cb4f70d813
>>> +  merging: other
>>>       chair
>>>      branch: default
>>>      commit: 1 unresolved (clean)
>>> @@ -706,8 +708,10 @@
>>>      U foo
>>>      $ hg summary
>>>      parent: 2:b71750c4b0fd tip
>>> +  merging: local
>>>       capital ten
>>>      source: 0:a30dd8addae3
>>> +  merging: other
>>>       initial
>>>      branch: default
>>>      commit: 1 unresolved (clean)
>>> @@ -727,8 +731,10 @@
>>>      R foo
>>>      $ hg summary
>>>      parent: 2:b71750c4b0fd tip
>>> +  merging: local
>>>       capital ten
>>>      source: 0:a30dd8addae3
>>> +  merging: other
>>>       initial
>>>      branch: default
>>>      commit: 1 modified, 1 unknown
>>> diff --git a/tests/test-graft.t b/tests/test-graft.t
>>> --- a/tests/test-graft.t
>>> +++ b/tests/test-graft.t
>>> @@ -214,7 +214,7 @@
>>>      Summary should mention graft:
>>>    -  $ hg summary |grep graft
>>> +  $ hg summary |grep 'graft in'
>>>      commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
>>>      Commit while interrupted should fail:
>>> diff --git a/tests/test-rebase-parameters.t
>>> b/tests/test-rebase-parameters.t
>>> --- a/tests/test-rebase-parameters.t
>>> +++ b/tests/test-rebase-parameters.t
>>> @@ -471,8 +471,10 @@
>>>        $ hg summary
>>>      parent: 1:56daeba07f4b
>>> +  merging: local (dest)
>>>       c2
>>>      parent: 2:e4e3f3546619 tip
>>> +  merging: other (source)
>>>       c2b
>>>      branch: default
>>>      commit: 1 modified, 1 unresolved (merge)
>>> diff --git a/tests/test-shelve.t b/tests/test-shelve.t
>>> --- a/tests/test-shelve.t
>>> +++ b/tests/test-shelve.t
>>> @@ -866,8 +866,10 @@
>>>      ? foo/foo
>>>      $ hg summary
>>>      parent: 4:33f7f61e6c5e tip
>>> +  merging: local (dest)
>>>       create conflict
>>>      source: -1:000000000000  (no associated revision)
>>> +  merging: other (source)
>>>      branch: default
>>>      bookmarks: *test
>>>      commit: 2 unknown (clean)
>>> diff --git a/tests/test-strip.t b/tests/test-strip.t
>>> --- a/tests/test-strip.t
>>> +++ b/tests/test-strip.t
>>> @@ -490,8 +490,10 @@
>>>      [1]
>>>      $ hg sum
>>>      parent: 1:76dcf9fab855 tip
>>> +  merging: other (destination)
>>>       b
>>>      source: 0:9ab35a2d17cb
>>> +  merging: local (working copy)
>>>       a
>>>      branch: default
>>>      commit: 1 modified, 1 unknown, 1 unresolved
>>> _______________________________________________
>>> Mercurial-devel mailing list
>>> Mercurial-devel@mercurial-scm.org
>>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>>
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel@mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
timeless - May 6, 2016, 11:51 a.m.
Note that there are a bunch of ways to have only one parent known, part of
this patch is trying to surface the other "parent"in some of those cases.
There will probably be other cases where the second parent isn't known.

I'm vaguely sympathetic to the parsing concern. I believe my initial
proposal was to have the label near the left edge of the first line, and
someone specifically complained about that (probably on IRC, with some
effort I could find the reference).

We could add a desc label when we add an additional line.

Right now I'm abandoning this series because from my perspective it's stuck
at someone's bike shed.
On May 5, 2016 7:30 PM, "Pierre-Yves David" <pierre-yves.david@ens-lyon.org>
wrote:

>
>
> On 05/03/2016 06:41 PM, timeless wrote:
>
>> Some of these have too many potential tags (from tags), making the
>> lines potentially hard to read/scan.
>>
>
> I don't really get this argument. if we put this data first (and it
> probably deserve it is rare and important), it will always be accessible,
> in case of many tags, this will always be messy so it does not really
> change anything.
>
> However this highlight the fact if people are parsing this line, we cannot
> really change its content :-/
>
> Also, there are multiple pieces of information to expose (merging,
>> side, label) each of which could be localized. Mixing three things
>> into a potentially unbounded line of other stuff is too complicated
>> for me to reason through at this point.
>>
>
> The "merging" data seems already included in the fact we have two parents.
> But it is true that we have already two pieces of information (and can find
> more in the future) so it deserve some space.
>
> If someone else wants to rearrange the bike shed later, they're
>> welcome to do so. I might even be able to help them pick the color.
>>
>> In the interim, I can't get my bike w/ sidecar out of the shed because
>> I can't find the door for the sidecar. :/
>>
>
> My main issue is that I find the proposed format very confusing:
>
> Even before you change, the link between parent and the summary line is
> not obvious to me,
>
>   parent: 4:ed99997b793d tip
>      ypples
>
> But with your change,
>
>   parent: 4:ed99997b793d tip
>   merging: local
>      ypples
>
> I find this link even more confusing. Part of it comes from the fact
> "merging:" looks like any other summary entry so the link with the previous
> one is not clear to me. Maybe some extra indentation would help.
>
> Do you think you could come with a couple of other output proposal we
> could discuss?
>
> On Wed, Apr 13, 2016 at 2:12 AM, Pierre-Yves David <
> pierre-yves.david@ens-lyon.org> wrote:
>
>> What happened to the proposal to have the label on the same line as the
>>> "parent: 4:ed99997b793d" thing?
>>>
>>>
>>> On 04/04/2016 02:13 AM, timeless wrote:
>>>
>>>> # HG changeset patch
>>>> # User timeless <timeless@mozdev.org>
>>>> # Date 1459760948 0
>>>> #      Mon Apr 04 09:09:08 2016 +0000
>>>> # Node ID 8b2619f31878755dbe66e15788df455625c16aa0
>>>> # Parent  351a972e12d3fae7e291bb8ce61b2a2e9f0225d6
>>>> summary: add other/local markers for merges [RFC]
>>>>
>>>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>>>> --- a/mercurial/commands.py
>>>> +++ b/mercurial/commands.py
>>>> @@ -6598,6 +6598,13 @@
>>>>        conflicts = ms is not None and ms.active()
>>>>        localctx = otherctx = repo[nullrev]
>>>>        def shownode(label, p):
>>>> +        def mergelabel(key, v):
>>>> +            try:
>>>> +                label = ms._labels[v]
>>>> +                return '%s (%s)' % (key, label)
>>>> +            except TypeError:
>>>> +                return key
>>>> +
>>>>            # label with log.changeset (instead of log.parent) since this
>>>>            # shows a working directory parent *changeset*:
>>>>            ui.write(label % (p.rev(), str(p)),
>>>> @@ -6613,6 +6620,14 @@
>>>>                else:
>>>>                    ui.write(_(' (no revision checked out)'))
>>>>            ui.write('\n')
>>>> +        if conflicts:
>>>> +            merging = ''
>>>> +            # these are not for translation
>>>> +            if p == localctx:
>>>> +                merging = mergelabel('local', 0)
>>>> +            elif p == otherctx:
>>>> +                merging = mergelabel('other', 1)
>>>> +            ui.write(_('merging: %s\n') % merging)
>>>>            if p.description():
>>>>                ui.status(' ' + p.description().splitlines()[0].strip() +
>>>> '\n',
>>>>                          label='log.summary')
>>>> diff --git a/tests/test-backout.t b/tests/test-backout.t
>>>> --- a/tests/test-backout.t
>>>> +++ b/tests/test-backout.t
>>>> @@ -81,8 +81,10 @@
>>>>      [1]
>>>>      $ hg summary
>>>>      parent: 4:ed99997b793d tip
>>>> +  merging: local
>>>>       ypples
>>>>      source: 1:22cb4f70d813
>>>> +  merging: other
>>>>       chair
>>>>      branch: default
>>>>      commit: 1 unresolved (clean)
>>>> @@ -706,8 +708,10 @@
>>>>      U foo
>>>>      $ hg summary
>>>>      parent: 2:b71750c4b0fd tip
>>>> +  merging: local
>>>>       capital ten
>>>>      source: 0:a30dd8addae3
>>>> +  merging: other
>>>>       initial
>>>>      branch: default
>>>>      commit: 1 unresolved (clean)
>>>> @@ -727,8 +731,10 @@
>>>>      R foo
>>>>      $ hg summary
>>>>      parent: 2:b71750c4b0fd tip
>>>> +  merging: local
>>>>       capital ten
>>>>      source: 0:a30dd8addae3
>>>> +  merging: other
>>>>       initial
>>>>      branch: default
>>>>      commit: 1 modified, 1 unknown
>>>> diff --git a/tests/test-graft.t b/tests/test-graft.t
>>>> --- a/tests/test-graft.t
>>>> +++ b/tests/test-graft.t
>>>> @@ -214,7 +214,7 @@
>>>>      Summary should mention graft:
>>>>    -  $ hg summary |grep graft
>>>> +  $ hg summary |grep 'graft in'
>>>>      commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
>>>>      Commit while interrupted should fail:
>>>> diff --git a/tests/test-rebase-parameters.t
>>>> b/tests/test-rebase-parameters.t
>>>> --- a/tests/test-rebase-parameters.t
>>>> +++ b/tests/test-rebase-parameters.t
>>>> @@ -471,8 +471,10 @@
>>>>        $ hg summary
>>>>      parent: 1:56daeba07f4b
>>>> +  merging: local (dest)
>>>>       c2
>>>>      parent: 2:e4e3f3546619 tip
>>>> +  merging: other (source)
>>>>       c2b
>>>>      branch: default
>>>>      commit: 1 modified, 1 unresolved (merge)
>>>> diff --git a/tests/test-shelve.t b/tests/test-shelve.t
>>>> --- a/tests/test-shelve.t
>>>> +++ b/tests/test-shelve.t
>>>> @@ -866,8 +866,10 @@
>>>>      ? foo/foo
>>>>      $ hg summary
>>>>      parent: 4:33f7f61e6c5e tip
>>>> +  merging: local (dest)
>>>>       create conflict
>>>>      source: -1:000000000000  (no associated revision)
>>>> +  merging: other (source)
>>>>      branch: default
>>>>      bookmarks: *test
>>>>      commit: 2 unknown (clean)
>>>> diff --git a/tests/test-strip.t b/tests/test-strip.t
>>>> --- a/tests/test-strip.t
>>>> +++ b/tests/test-strip.t
>>>> @@ -490,8 +490,10 @@
>>>>      [1]
>>>>      $ hg sum
>>>>      parent: 1:76dcf9fab855 tip
>>>> +  merging: other (destination)
>>>>       b
>>>>      source: 0:9ab35a2d17cb
>>>> +  merging: local (working copy)
>>>>       a
>>>>      branch: default
>>>>      commit: 1 modified, 1 unknown, 1 unresolved
>>>> _______________________________________________
>>>> Mercurial-devel mailing list
>>>> Mercurial-devel@mercurial-scm.org
>>>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>>>>
>>>
>>> _______________________________________________
>>> Mercurial-devel mailing list
>>> Mercurial-devel@mercurial-scm.org
>>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>>>
>>
>

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6598,6 +6598,13 @@ 
     conflicts = ms is not None and ms.active()
     localctx = otherctx = repo[nullrev]
     def shownode(label, p):
+        def mergelabel(key, v):
+            try:
+                label = ms._labels[v]
+                return '%s (%s)' % (key, label)
+            except TypeError:
+                return key
+
         # label with log.changeset (instead of log.parent) since this
         # shows a working directory parent *changeset*:
         ui.write(label % (p.rev(), str(p)),
@@ -6613,6 +6620,14 @@ 
             else:
                 ui.write(_(' (no revision checked out)'))
         ui.write('\n')
+        if conflicts:
+            merging = ''
+            # these are not for translation
+            if p == localctx:
+                merging = mergelabel('local', 0)
+            elif p == otherctx:
+                merging = mergelabel('other', 1)
+            ui.write(_('merging: %s\n') % merging)
         if p.description():
             ui.status(' ' + p.description().splitlines()[0].strip() + '\n',
                       label='log.summary')
diff --git a/tests/test-backout.t b/tests/test-backout.t
--- a/tests/test-backout.t
+++ b/tests/test-backout.t
@@ -81,8 +81,10 @@ 
   [1]
   $ hg summary
   parent: 4:ed99997b793d tip
+  merging: local
    ypples
   source: 1:22cb4f70d813 
+  merging: other
    chair
   branch: default
   commit: 1 unresolved (clean)
@@ -706,8 +708,10 @@ 
   U foo
   $ hg summary
   parent: 2:b71750c4b0fd tip
+  merging: local
    capital ten
   source: 0:a30dd8addae3 
+  merging: other
    initial
   branch: default
   commit: 1 unresolved (clean)
@@ -727,8 +731,10 @@ 
   R foo
   $ hg summary
   parent: 2:b71750c4b0fd tip
+  merging: local
    capital ten
   source: 0:a30dd8addae3 
+  merging: other
    initial
   branch: default
   commit: 1 modified, 1 unknown
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -214,7 +214,7 @@ 
 
 Summary should mention graft:
 
-  $ hg summary |grep graft
+  $ hg summary |grep 'graft in'
   commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
 
 Commit while interrupted should fail:
diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t
--- a/tests/test-rebase-parameters.t
+++ b/tests/test-rebase-parameters.t
@@ -471,8 +471,10 @@ 
 
   $ hg summary
   parent: 1:56daeba07f4b 
+  merging: local (dest)
    c2
   parent: 2:e4e3f3546619 tip
+  merging: other (source)
    c2b
   branch: default
   commit: 1 modified, 1 unresolved (merge)
diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -866,8 +866,10 @@ 
   ? foo/foo
   $ hg summary
   parent: 4:33f7f61e6c5e tip
+  merging: local (dest)
    create conflict
   source: -1:000000000000  (no associated revision)
+  merging: other (source)
   branch: default
   bookmarks: *test
   commit: 2 unknown (clean)
diff --git a/tests/test-strip.t b/tests/test-strip.t
--- a/tests/test-strip.t
+++ b/tests/test-strip.t
@@ -490,8 +490,10 @@ 
   [1]
   $ hg sum
   parent: 1:76dcf9fab855 tip
+  merging: other (destination)
    b
   source: 0:9ab35a2d17cb 
+  merging: local (working copy)
    a
   branch: default
   commit: 1 modified, 1 unknown, 1 unresolved