Patchwork [3,of,3,evolve] gup/gdown: reorder output so we print first, then update

login
register
mail settings
Submitter Dan Villiom Podlaski Christiansen
Date Jan. 2, 2014, 7:04 p.m.
Message ID <4162839ade1238fd07a2.1388689474@dork.local>
Download mbox | patch
Permalink /patch/3257/
State Superseded
Headers show

Comments

Dan Villiom Podlaski Christiansen - Jan. 2, 2014, 7:04 p.m.
# HG changeset patch
# User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
# Date 1388686158 -3600
#      Thu Jan 02 19:09:18 2014 +0100
# Node ID 4162839ade1238fd07a26ff88b8e0ea336154eec
# Parent  f7528d672be5c2c18476714f21c32670127236ab
gup/gdown: reorder output so we print first, then update

Print the changeset we're updating to first, so users see the output
*before* Mercurial fires up any merge tools. In addition, the output
will appear more consistent with most other commands that also update,
and almost always do so as their last step.
Pierre-Yves David - Jan. 8, 2014, 1:12 a.m.
Patch 1-2 have been pushed to bitbucket.

I'm not sure about this one. I like the "now at: xxxxxx" mq's style line 
to be the last. But I'll use this patches for a few week and get a real 
idea about it.



On 01/02/2014 11:04 AM, Dan Villiom Podlaski Christiansen wrote:
> # HG changeset patch
> # User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
> # Date 1388686158 -3600
> #      Thu Jan 02 19:09:18 2014 +0100
> # Node ID 4162839ade1238fd07a26ff88b8e0ea336154eec
> # Parent  f7528d672be5c2c18476714f21c32670127236ab
> gup/gdown: reorder output so we print first, then update
>
> Print the changeset we're updating to first, so users see the output
> *before* Mercurial fires up any merge tools. In addition, the output
> will appear more consistent with most other commands that also update,
> and almost always do so as their last step.
>
> diff --git a/README b/README
> --- a/README
> +++ b/README
> @@ -42,6 +42,10 @@ Be sure to check latest draft changeset
>   Changelog
>   =========
>   
> +3.3.0 --
> +
> +- next/previous: reorder output so we print first, then update
> +
>   3.2.0 -- 2013-11-15
>   
>   - conform to the Mercurial custom of lowercase messages
> diff --git a/hgext/evolve.py b/hgext/evolve.py
> --- a/hgext/evolve.py
> +++ b/hgext/evolve.py
> @@ -1278,8 +1278,8 @@ def cmdprevious(ui, repo):
>       displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})
>       if len(parents) == 1:
>           p = parents[0]
> +        displayer.show(p)
>           hg.update(repo, p.rev())
> -        displayer.show(p)
>           return 0
>       else:
>           for p in parents:
> @@ -1304,8 +1304,8 @@ def cmdnext(ui, repo):
>           return 1
>       if len(children) == 1:
>           c = children[0]
> +        displayer.show(c)
>           hg.update(repo, c.rev())
> -        displayer.show(c)
>           return 0
>       else:
>           for c in children:
> diff --git a/tests/test-stabilize-conflict.t b/tests/test-stabilize-conflict.t
> --- a/tests/test-stabilize-conflict.t
> +++ b/tests/test-stabilize-conflict.t
> @@ -59,8 +59,8 @@ proper behavior without conflict
>   ----------------------------------
>   
>     $ hg gdown
> +  [1] babar count up to ten
>     1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> -  [1] babar count up to ten
>     $ safesed 's/huit/eight/' babar
>     $ hg diff
>     diff -r 9d5daf8bd956 babar
> @@ -105,8 +105,8 @@ proper behavior with conflict using inte
>   --------------------------------------------------
>   
>     $ hg gdown
> +  [4] babar count up to ten
>     1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> -  [4] babar count up to ten
>     $ safesed 's/dix/ten/' babar
>     $ hg diff
>     diff -r 5977072d13c5 babar
> @@ -189,8 +189,8 @@ proper behavior with conflict using an e
>     $ safesed 's/merge=.*/merge=touch/' $HGRCPATH
>     $ safesed 's/touch.gui=.*/touch.gui=false/' $HGRCPATH
>     $ hg gdown
> +  [7] babar count up to ten
>     1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> -  [7] babar count up to ten
>     $ safesed 's/ten/zehn/' babar
>     $ hg diff
>     diff -r e04690b09bc6 babar
> diff --git a/tests/test-stabilize-order.t b/tests/test-stabilize-order.t
> --- a/tests/test-stabilize-order.t
> +++ b/tests/test-stabilize-order.t
> @@ -35,14 +35,14 @@
>     o  0:c471ef929e6a@default(draft) addroot
>     
>     $ hg gdown
> +  [2] addb
>     0 files updated, 0 files merged, 1 files removed, 0 files unresolved
> -  [2] addb
>     $ echo b >> b
>     $ hg amend
>     1 new unstable changesets
>     $ hg gdown
> +  [1] adda
>     0 files updated, 0 files merged, 1 files removed, 0 files unresolved
> -  [1] adda
>     $ echo a >> a
>     $ hg amend
>     1 new unstable changesets
> diff --git a/tests/test-stabilize-result.t b/tests/test-stabilize-result.t
> --- a/tests/test-stabilize-result.t
> +++ b/tests/test-stabilize-result.t
> @@ -64,8 +64,8 @@ Test evolve with conflict
>     $ echo 'newer a' >> a
>     $ hg ci -m 'newer a'
>     $ hg gdown
> +  [4] changea
>     1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> -  [4] changea
>     $ echo 'a' > a
>     $ hg amend
>     1 new unstable changesets
> @@ -111,8 +111,8 @@ Stabilize of late comer with different p
>   Add another commit
>   
>     $ hg gdown
> +  [7] changea
>     1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> -  [7] changea
>     $ echo 'c' > c
>     $ hg add c
>     $ hg commit -m 'add c'
> diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t
> --- a/tests/test-uncommit.t
> +++ b/tests/test-uncommit.t
> @@ -329,7 +329,7 @@ Test instability warning
>     $ echo unrelated > unrelated
>     $ hg ci -Am addunrelated unrelated
>     $ hg previous
> +  [8] touncommit
>     0 files updated, 0 files merged, 1 files removed, 0 files unresolved
> -  [8] touncommit
>     $ hg uncommit aa
>     1 new unstable changesets
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Dan Villiom Podlaski Christiansen - Jan. 8, 2014, 10:41 a.m.
On 8 Jan 2014, at 02:12, Pierre-Yves David <pierre-yves.david@ens-lyon.org> wrote:

> Patch 1-2 have been pushed to bitbucket.
> 
> I'm not sure about this one. I like the "now at: xxxxxx" mq's style line to be the last. But I'll use this patches for a few week and get a real idea about it.

It's worth noting that MQ only prints out that line when the patching succeeds. The very first thing it prints out is what it's going to do, i.e.:

>   $ hg qpop  
>   popping flaf.diff
>   now at: blyf.diff

I would consider the printout in evolve equivalent to the first line rather than the second.

> On 01/02/2014 11:04 AM, Dan Villiom Podlaski Christiansen wrote:
>> # HG changeset patch
>> # User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
>> # Date 1388686158 -3600
>> #      Thu Jan 02 19:09:18 2014 +0100
>> # Node ID 4162839ade1238fd07a26ff88b8e0ea336154eec
>> # Parent  f7528d672be5c2c18476714f21c32670127236ab
>> gup/gdown: reorder output so we print first, then update
>> 
>> Print the changeset we're updating to first, so users see the output
>> *before* Mercurial fires up any merge tools. In addition, the output
>> will appear more consistent with most other commands that also update,
>> and almost always do so as their last step.
>> 
>> diff --git a/README b/README
>> --- a/README
>> +++ b/README
>> @@ -42,6 +42,10 @@ Be sure to check latest draft changeset
>>  Changelog
>>  =========
>>  +3.3.0 --
>> +
>> +- next/previous: reorder output so we print first, then update
>> +
>>  3.2.0 -- 2013-11-15
>>    - conform to the Mercurial custom of lowercase messages
>> diff --git a/hgext/evolve.py b/hgext/evolve.py
>> --- a/hgext/evolve.py
>> +++ b/hgext/evolve.py
>> @@ -1278,8 +1278,8 @@ def cmdprevious(ui, repo):
>>      displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})
>>      if len(parents) == 1:
>>          p = parents[0]
>> +        displayer.show(p)
>>          hg.update(repo, p.rev())
>> -        displayer.show(p)
>>          return 0
>>      else:
>>          for p in parents:
>> @@ -1304,8 +1304,8 @@ def cmdnext(ui, repo):
>>          return 1
>>      if len(children) == 1:
>>          c = children[0]
>> +        displayer.show(c)
>>          hg.update(repo, c.rev())
>> -        displayer.show(c)
>>          return 0
>>      else:
>>          for c in children:
>> diff --git a/tests/test-stabilize-conflict.t b/tests/test-stabilize-conflict.t
>> --- a/tests/test-stabilize-conflict.t
>> +++ b/tests/test-stabilize-conflict.t
>> @@ -59,8 +59,8 @@ proper behavior without conflict
>>  ----------------------------------
>>      $ hg gdown
>> +  [1] babar count up to ten
>>    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>> -  [1] babar count up to ten
>>    $ safesed 's/huit/eight/' babar
>>    $ hg diff
>>    diff -r 9d5daf8bd956 babar
>> @@ -105,8 +105,8 @@ proper behavior with conflict using inte
>>  --------------------------------------------------
>>      $ hg gdown
>> +  [4] babar count up to ten
>>    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>> -  [4] babar count up to ten
>>    $ safesed 's/dix/ten/' babar
>>    $ hg diff
>>    diff -r 5977072d13c5 babar
>> @@ -189,8 +189,8 @@ proper behavior with conflict using an e
>>    $ safesed 's/merge=.*/merge=touch/' $HGRCPATH
>>    $ safesed 's/touch.gui=.*/touch.gui=false/' $HGRCPATH
>>    $ hg gdown
>> +  [7] babar count up to ten
>>    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>> -  [7] babar count up to ten
>>    $ safesed 's/ten/zehn/' babar
>>    $ hg diff
>>    diff -r e04690b09bc6 babar
>> diff --git a/tests/test-stabilize-order.t b/tests/test-stabilize-order.t
>> --- a/tests/test-stabilize-order.t
>> +++ b/tests/test-stabilize-order.t
>> @@ -35,14 +35,14 @@
>>    o  0:c471ef929e6a@default(draft) addroot
>>        $ hg gdown
>> +  [2] addb
>>    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>> -  [2] addb
>>    $ echo b >> b
>>    $ hg amend
>>    1 new unstable changesets
>>    $ hg gdown
>> +  [1] adda
>>    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>> -  [1] adda
>>    $ echo a >> a
>>    $ hg amend
>>    1 new unstable changesets
>> diff --git a/tests/test-stabilize-result.t b/tests/test-stabilize-result.t
>> --- a/tests/test-stabilize-result.t
>> +++ b/tests/test-stabilize-result.t
>> @@ -64,8 +64,8 @@ Test evolve with conflict
>>    $ echo 'newer a' >> a
>>    $ hg ci -m 'newer a'
>>    $ hg gdown
>> +  [4] changea
>>    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>> -  [4] changea
>>    $ echo 'a' > a
>>    $ hg amend
>>    1 new unstable changesets
>> @@ -111,8 +111,8 @@ Stabilize of late comer with different p
>>  Add another commit
>>      $ hg gdown
>> +  [7] changea
>>    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>> -  [7] changea
>>    $ echo 'c' > c
>>    $ hg add c
>>    $ hg commit -m 'add c'
>> diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t
>> --- a/tests/test-uncommit.t
>> +++ b/tests/test-uncommit.t
>> @@ -329,7 +329,7 @@ Test instability warning
>>    $ echo unrelated > unrelated
>>    $ hg ci -Am addunrelated unrelated
>>    $ hg previous
>> +  [8] touncommit
>>    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>> -  [8] touncommit
>>    $ hg uncommit aa
>>    1 new unstable changesets
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel@selenic.com
>> http://selenic.com/mailman/listinfo/mercurial-devel
> 

--

Dan Villiom Podlaski Christiansen
danchr@gmail.com (mail & IM)

Patch

diff --git a/README b/README
--- a/README
+++ b/README
@@ -42,6 +42,10 @@  Be sure to check latest draft changeset 
 Changelog
 =========
 
+3.3.0 --
+
+- next/previous: reorder output so we print first, then update
+
 3.2.0 -- 2013-11-15
 
 - conform to the Mercurial custom of lowercase messages
diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -1278,8 +1278,8 @@  def cmdprevious(ui, repo):
     displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})
     if len(parents) == 1:
         p = parents[0]
+        displayer.show(p)
         hg.update(repo, p.rev())
-        displayer.show(p)
         return 0
     else:
         for p in parents:
@@ -1304,8 +1304,8 @@  def cmdnext(ui, repo):
         return 1
     if len(children) == 1:
         c = children[0]
+        displayer.show(c)
         hg.update(repo, c.rev())
-        displayer.show(c)
         return 0
     else:
         for c in children:
diff --git a/tests/test-stabilize-conflict.t b/tests/test-stabilize-conflict.t
--- a/tests/test-stabilize-conflict.t
+++ b/tests/test-stabilize-conflict.t
@@ -59,8 +59,8 @@  proper behavior without conflict
 ----------------------------------
 
   $ hg gdown
+  [1] babar count up to ten
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  [1] babar count up to ten
   $ safesed 's/huit/eight/' babar
   $ hg diff
   diff -r 9d5daf8bd956 babar
@@ -105,8 +105,8 @@  proper behavior with conflict using inte
 --------------------------------------------------
 
   $ hg gdown
+  [4] babar count up to ten
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  [4] babar count up to ten
   $ safesed 's/dix/ten/' babar
   $ hg diff
   diff -r 5977072d13c5 babar
@@ -189,8 +189,8 @@  proper behavior with conflict using an e
   $ safesed 's/merge=.*/merge=touch/' $HGRCPATH
   $ safesed 's/touch.gui=.*/touch.gui=false/' $HGRCPATH
   $ hg gdown
+  [7] babar count up to ten
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  [7] babar count up to ten
   $ safesed 's/ten/zehn/' babar
   $ hg diff
   diff -r e04690b09bc6 babar
diff --git a/tests/test-stabilize-order.t b/tests/test-stabilize-order.t
--- a/tests/test-stabilize-order.t
+++ b/tests/test-stabilize-order.t
@@ -35,14 +35,14 @@ 
   o  0:c471ef929e6a@default(draft) addroot
   
   $ hg gdown
+  [2] addb
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  [2] addb
   $ echo b >> b
   $ hg amend
   1 new unstable changesets
   $ hg gdown
+  [1] adda
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  [1] adda
   $ echo a >> a
   $ hg amend
   1 new unstable changesets
diff --git a/tests/test-stabilize-result.t b/tests/test-stabilize-result.t
--- a/tests/test-stabilize-result.t
+++ b/tests/test-stabilize-result.t
@@ -64,8 +64,8 @@  Test evolve with conflict
   $ echo 'newer a' >> a
   $ hg ci -m 'newer a'
   $ hg gdown
+  [4] changea
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  [4] changea
   $ echo 'a' > a
   $ hg amend
   1 new unstable changesets
@@ -111,8 +111,8 @@  Stabilize of late comer with different p
 Add another commit
 
   $ hg gdown
+  [7] changea
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  [7] changea
   $ echo 'c' > c
   $ hg add c
   $ hg commit -m 'add c'
diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t
--- a/tests/test-uncommit.t
+++ b/tests/test-uncommit.t
@@ -329,7 +329,7 @@  Test instability warning
   $ echo unrelated > unrelated
   $ hg ci -Am addunrelated unrelated
   $ hg previous
+  [8] touncommit
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  [8] touncommit
   $ hg uncommit aa
   1 new unstable changesets