Patchwork [4,of,5,v2] summary: add other/local markers for merges [RFC]

login
register
mail settings
Submitter timeless@mozdev.org
Date March 23, 2016, 3:23 a.m.
Message ID <f8b55256f2bf7613df37.1458703439@waste.org>
Download mbox | patch
Permalink /patch/14039/
State Superseded
Headers show

Comments

timeless@mozdev.org - March 23, 2016, 3:23 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1458683883 0
#      Tue Mar 22 21:58:03 2016 +0000
# Node ID f8b55256f2bf7613df37760b87052cb79c036834
# Parent  4bff81fb8154285cf1c9a335d6700eab7cc81bb1
summary: add other/local markers for merges [RFC]
Pierre-Yves David - March 29, 2016, 6:34 p.m.
On 03/22/2016 08:23 PM, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1458683883 0
> #      Tue Mar 22 21:58:03 2016 +0000
> # Node ID f8b55256f2bf7613df37760b87052cb79c036834
> # Parent  4bff81fb8154285cf1c9a335d6700eab7cc81bb1
> 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
> @@ -6602,6 +6602,14 @@
>               else:
>                   ui.write(_(' (no revision checked out)'))
>           ui.write('\n')
> +        if conflicts:
> +            merging = ''
> +            # these are not for translation
> +            if p == localctx:
> +                merging = 'local'
> +            elif p == otherctx:
> +                merging = 'other'
> +            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

I'm not fan of having this extra line between 'parent:' and the 
description. I find it quit confusing. Could we sneak that into the 
above line? This "make" sense as this is a label for the changeset

   parent: 4:ed99997b793d tip (merging as local)
     ypples

What do you think ?

Cheers,
timeless - March 30, 2016, 5:56 p.m.
I put it on its own line because conceivably there could be a dozen
tags on that line and I don't want to deal with the position shifting
around based on tag count / length.

(Our tests here are unhelpful in that they're too simplistic to show
this problem.)

My initial proposal to avoid that problem was to put it before the tag
list, but someone objected...

On Tue, Mar 29, 2016 at 2:34 PM, Pierre-Yves David
<pierre-yves.david@ens-lyon.org> wrote:
>
>
> On 03/22/2016 08:23 PM, timeless wrote:
>>
>> # HG changeset patch
>> # User timeless <timeless@mozdev.org>
>> # Date 1458683883 0
>> #      Tue Mar 22 21:58:03 2016 +0000
>> # Node ID f8b55256f2bf7613df37760b87052cb79c036834
>> # Parent  4bff81fb8154285cf1c9a335d6700eab7cc81bb1
>> 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
>> @@ -6602,6 +6602,14 @@
>>               else:
>>                   ui.write(_(' (no revision checked out)'))
>>           ui.write('\n')
>> +        if conflicts:
>> +            merging = ''
>> +            # these are not for translation
>> +            if p == localctx:
>> +                merging = 'local'
>> +            elif p == otherctx:
>> +                merging = 'other'
>> +            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
>
>
> I'm not fan of having this extra line between 'parent:' and the description.
> I find it quit confusing. Could we sneak that into the above line? This
> "make" sense as this is a label for the changeset
>
>   parent: 4:ed99997b793d tip (merging as local)
>     ypples
>
> What do you think ?
>
> Cheers,
>
> --
> Pierre-Yves David
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Pierre-Yves David - April 1, 2016, 12:23 a.m.
On 03/30/2016 10:56 AM, timeless wrote:
> I put it on its own line because conceivably there could be a dozen
> tags on that line and I don't want to deal with the position shifting
> around based on tag count / length.

Dozen of tag on a changesets is probably a rare case, I'm not sure we 
should optimise for it. Also I'm not sure why that would be a huge 
problem the data would still be there and user would be used to looking 
for it from all the simpler case).

> (Our tests here are unhelpful in that they're too simplistic to show
> this problem.)
>
> My initial proposal to avoid that problem was to put it before the tag
> list, but someone objected...

Can you provide a link to that objection ?

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6602,6 +6602,14 @@ 
             else:
                 ui.write(_(' (no revision checked out)'))
         ui.write('\n')
+        if conflicts:
+            merging = ''
+            # these are not for translation
+            if p == localctx:
+                merging = 'local'
+            elif p == otherctx:
+                merging = 'other'
+            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-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
    c2
   parent: 2:e4e3f3546619 tip
+  merging: other
    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
@@ -865,8 +865,10 @@ 
   ? foo/foo
   $ hg summary
   parent: 4:33f7f61e6c5e tip
+  merging: local
    create conflict
   source: -1:000000000000  (no associated revision)
+  merging: other
   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
    b
   source: 0:9ab35a2d17cb 
+  merging: local
    a
   branch: default
   commit: 1 modified, 1 unknown, 1 unresolved