Commits

Dan Villiom Podlaski Christiansen committed 8addce2 Draft

rename gdown/gup to next/previous and make them update after their output

gdown/gup refer to the customary order in log output rather than
concepts; as such, it may be confusing to the user. Previous and next,
however, imply a clear parent/child relationship. We retain the
previous names as aliases.

In addition, print the changeset we're updating to first; in the
sense, a user will see the output *before* any Mercurial fires up any
merge tools, and the output will appear more consistent with most
other commands that also update, and commonly do so as their last
step.

Comments (0)

Files changed (7)

docs/evolve-faq.rst

 
 Just use ``hg prune <some-rev>``.
 
-Moving within the history: ``up`` ``gdown`` and ``gup``
+Moving within the history: ``previous`` and ``next``
 ------------------------------------------------------------
 
 While working on mutable part of the history you often need to move between
 mutable commits.
 
-You just need to use standard update to work with evolve. For convenience, you
-can use ``hg gup`` to move to the child commit or ``hg gdown`` to move to the parent commit.
+You just need to use standard update to work with evolve. For
+convenience, you can use :hg:``next`` to move to the child commit or
+:hg:``previous`` to move to the parent commit.
 
 .. note:: Those commands only exist for the convenience of getting qpush and qpop
           feeling back.
 qnew                            ``commit``
 qrefresh                        ``amend``
 qrefresh --exclude              ``uncommit``
-qpop                            ``update`` or ``gdown``
-qpush                           ``update`` or ``gup`` sometimes ``evolve``
+qpop                            ``update`` or ``previous``
+qpush                           ``update`` or ``next`` sometimes ``evolve``
 qrm                             ``prune``
 qfold                           ``fold``
 qdiff                           ``odiff``
 
 The following command emulates the behavior of hg qpop:
 
-  $ hg gdown
+  $ hg previous
 
 If you need to go back to an arbitrary commit you can use:
 
   $ hg update
 
-.. note:: gdown and update allow movement with working directory
+.. note:: previous and update allow movement with working directory
           changes applied, and gracefully merge them.
 
 hg qpush
 
 shorttemplate = '[{rev}] {desc|firstline}\n'
 
-@command('^gdown',
+@command('^previous|gdown',
          [],
          '')
-def cmdgdown(ui, repo):
+def cmdprevious(ui, repo):
     """update to parent and display summary lines"""
     wkctx = repo[None]
     wparents = wkctx.parents()
     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:
         ui.warn(_('multiple parents, explicitly update to one\n'))
         return 1
 
-@command('^gup',
+@command('^next|gup',
          [],
          '')
-def cmdup(ui, repo):
+def cmdnext(ui, repo):
     """update to child and display summary lines"""
     wkctx = repo[None]
     wparents = wkctx.parents()
         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:

tests/test-stabilize-conflict.t

 proper behavior without conflict
 ----------------------------------
 
-  $ hg gdown
+  $ hg previous
+  [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
 proper behavior with conflict using internal:merge
 --------------------------------------------------
 
-  $ hg gdown
+  $ hg previous
+  [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 6bd654225435 babar
 
   $ safesed 's/merge=.*/merge=touch/' $HGRCPATH
   $ safesed 's/touch.gui=.*/touch.gui=false/' $HGRCPATH
-  $ hg gdown
+  $ hg previous
+  [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 3e191dd96e18 babar

tests/test-stabilize-order.t

   |
   o  0:c471ef929e6a@default(draft) addroot
   
-  $ hg gdown
+  $ hg previous
+  [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
+  $ hg previous
+  [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

tests/test-stabilize-result.t

   +a
   $ echo 'newer a' >> a
   $ hg ci -m 'newer a'
-  $ hg gdown
+  $ hg previous
+  [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
   
 Add another commit
 
-  $ hg gdown
+  $ hg previous
+  [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'

tests/test-uncommit.t

   $ hg ci -m touncommit
   $ echo unrelated > unrelated
   $ hg ci -Am addunrelated unrelated
-  $ hg gdown
+  $ 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