Patchwork [evolve-ext] list: report the phase for divergent commits

login
register
mail settings
Submitter timeless@gcc2-power8.osuosl.org
Date April 14, 2016, 9:32 p.m.
Message ID <e8a6a77ecfbde3d122fb.1460669546@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/14634/
State Accepted
Headers show

Comments

timeless@gcc2-power8.osuosl.org - April 14, 2016, 9:32 p.m.
# HG changeset patch
# User timeless@gmail.com
# Date 1460669457 0
#      Thu Apr 14 21:30:57 2016 +0000
# Node ID e8a6a77ecfbde3d122fb262ae0fa622f9fdbe55a
# Parent  bbf897714e70529923c1b1ccca181a49c9adb747
# Available At https://bitbucket.org/timeless/mutable-history/
#              hg pull https://bitbucket.org/timeless/mutable-history/ -r e8a6a77ecfbd
# EXP-Topic list
list: report the phase for divergent commits
Pierre-Yves David - April 15, 2016, 8:38 a.m.
On 04/14/2016 02:32 PM, timeless@gcc2-power8.osuosl.org wrote:
> # HG changeset patch
> # User timeless@gmail.com
> # Date 1460669457 0
> #      Thu Apr 14 21:30:57 2016 +0000
> # Node ID e8a6a77ecfbde3d122fb262ae0fa622f9fdbe55a
> # Parent  bbf897714e70529923c1b1ccca181a49c9adb747
> # Available At https://bitbucket.org/timeless/mutable-history/
> #              hg pull https://bitbucket.org/timeless/mutable-history/ -r e8a6a77ecfbd
> # EXP-Topic list
> list: report the phase for divergent commits

I've taken that one, but I would like a follow up.

>
> diff -r bbf897714e70 -r e8a6a77ecfbd hgext/evolve.py
> --- a/hgext/evolve.py	Thu Apr 14 03:42:48 2016 +0000
> +++ b/hgext/evolve.py	Thu Apr 14 21:30:57 2016 +0000
> @@ -1600,9 +1600,9 @@
>                   fm.plain('  divergent: ')
>                   first = True
>                   for n in dset['divergentnodes']:
> -                    t = "%s" if first else " %s"
> +                    t = "%s (%s)" if first else " %s (%s)"
>                       first = False
> -                    fm.plain(t % node.hex(n)[:hashlen])
> +                    fm.plain(t % (node.hex(n)[:hashlen], repo[n].phasestr()))

Can we add the phase info the the template data too?
timeless - May 3, 2016, 4:32 p.m.
For the record, this is fe4b41a2af4e in evolve-ext

On Fri, Apr 15, 2016 at 4:38 AM, Pierre-Yves David
<pierre-yves.david@ens-lyon.org> wrote:
>
>
> On 04/14/2016 02:32 PM, timeless@gcc2-power8.osuosl.org wrote:
>>
>> # HG changeset patch
>> # User timeless@gmail.com
>> # Date 1460669457 0
>> #      Thu Apr 14 21:30:57 2016 +0000
>> # Node ID e8a6a77ecfbde3d122fb262ae0fa622f9fdbe55a
>> # Parent  bbf897714e70529923c1b1ccca181a49c9adb747
>> # Available At https://bitbucket.org/timeless/mutable-history/
>> #              hg pull https://bitbucket.org/timeless/mutable-history/ -r
>> e8a6a77ecfbd
>> # EXP-Topic list
>> list: report the phase for divergent commits
>
>
> I've taken that one, but I would like a follow up.
>
>>
>> diff -r bbf897714e70 -r e8a6a77ecfbd hgext/evolve.py
>> --- a/hgext/evolve.py   Thu Apr 14 03:42:48 2016 +0000
>> +++ b/hgext/evolve.py   Thu Apr 14 21:30:57 2016 +0000
>> @@ -1600,9 +1600,9 @@
>>                   fm.plain('  divergent: ')
>>                   first = True
>>                   for n in dset['divergentnodes']:
>> -                    t = "%s" if first else " %s"
>> +                    t = "%s (%s)" if first else " %s (%s)"
>>                       first = False
>> -                    fm.plain(t % node.hex(n)[:hashlen])
>> +                    fm.plain(t % (node.hex(n)[:hashlen],
>> repo[n].phasestr()))
>
>
> Can we add the phase info the the template data too?
>
> --
> Pierre-Yves David
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff -r bbf897714e70 -r e8a6a77ecfbd hgext/evolve.py
--- a/hgext/evolve.py	Thu Apr 14 03:42:48 2016 +0000
+++ b/hgext/evolve.py	Thu Apr 14 21:30:57 2016 +0000
@@ -1600,9 +1600,9 @@ 
                 fm.plain('  divergent: ')
                 first = True
                 for n in dset['divergentnodes']:
-                    t = "%s" if first else " %s"
+                    t = "%s (%s)" if first else " %s (%s)"
                     first = False
-                    fm.plain(t % node.hex(n)[:hashlen])
+                    fm.plain(t % (node.hex(n)[:hashlen], repo[n].phasestr()))
                 comprec = node.hex(dset['commonprecursor'])[:hashlen]
                 fm.plain(" (precursor %s)\n" % comprec)
         fm.plain("\n")
diff -r bbf897714e70 -r e8a6a77ecfbd tests/test-evolve-list.t
--- a/tests/test-evolve-list.t	Thu Apr 14 03:42:48 2016 +0000
+++ b/tests/test-evolve-list.t	Thu Apr 14 21:30:57 2016 +0000
@@ -67,9 +67,14 @@ 
   2 new divergent changesets
   $ hg evolve --list
   c882616e9d84: b
-    divergent: a922b3733e98 (precursor d2ae7f538514)
+    divergent: a922b3733e98 (draft) (precursor d2ae7f538514)
   
   a922b3733e98: b
-    divergent: c882616e9d84 (precursor d2ae7f538514)
+    divergent: c882616e9d84 (draft) (precursor d2ae7f538514)
+  
+  $ hg phase -p a922b3733e98
+  $ hg evolve --list
+  c882616e9d84: b
+    divergent: a922b3733e98 (public) (precursor d2ae7f538514)
   
   $ cd ..