1. Dan Villiom Podlaski Christiansen
  2. mutable-history

Commits

Dan Villiom Podlaski Christiansen  committed b079b82

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.

  • Participants
  • Parent commits fc15a4f
  • Branches default

Comments (0)

Files changed (5)

File hgext/evolve.py

View file
 
 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:

File tests/test-stabilize-conflict.t

View file
 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

File tests/test-stabilize-order.t

View file
   |
   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

File tests/test-stabilize-result.t

View file
   +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'

File tests/test-uncommit.t

View file
   $ 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