commands: adjust metavariables as appropriate
authorAnton Shestakov <av6@dwimlabs.net>
Wed, 17 Oct 2018 23:10:30 +0800
changeset 4183 536c67823962
parent 4182 4d30cb45b57f
child 4184 b9e0cc531b2b
commands: adjust metavariables as appropriate Apart from looking better in hg help command, these strings are also helpful when generating shell completions programmatically.
hgext3rd/evolve/cmdrewrite.py
hgext3rd/evolve/evolvecmd.py
hgext3rd/evolve/rewind.py
tests/test-amend.t
tests/test-grab.t
tests/test-tutorial.t
--- a/hgext3rd/evolve/cmdrewrite.py	Wed Oct 17 14:02:18 2018 +0200
+++ b/hgext3rd/evolve/cmdrewrite.py	Wed Oct 17 23:10:30 2018 +0800
@@ -105,7 +105,7 @@
      ('', 'close-branch', None,
       _('mark a branch as closed, hiding it from the branch list')),
      ('s', 'secret', None, _('use the secret phase for committing')),
-     ('n', 'note', '', _('store a note on amend')),
+     ('n', 'note', '', _('store a note on amend'), _('TEXT')),
     ] + walkopts + commitopts + commitopts2 + commitopts3 + interactiveopt,
     _('[OPTION]... [FILE]...'))
 def amend(ui, repo, *pats, **opts):
@@ -461,9 +461,9 @@
     'uncommit',
     [('a', 'all', None, _('uncommit all changes when no arguments given')),
      ('i', 'interactive', False, _('interactive mode to uncommit (EXPERIMENTAL)')),
-     ('r', 'rev', '', _('revert commit content to REV instead')),
+     ('r', 'rev', '', _('revert commit content to REV instead'), _('REV')),
      ('', 'revert', False, _('discard working directory changes after uncommit')),
-     ('n', 'note', '', _('store a note on uncommit')),
+     ('n', 'note', '', _('store a note on uncommit'), _('TEXT')),
      ] + commands.walkopts + commitopts + commitopts2 + commitopts3,
     _('[OPTION]... [NAME]'))
 def uncommit(ui, repo, *pats, **opts):
@@ -661,10 +661,10 @@
 
 @eh.command(
     '^fold|squash',
-    [('r', 'rev', [], _("revision to fold")),
+    [('r', 'rev', [], _("revision to fold"), _('REV')),
      ('', 'exact', None, _("only fold specified revisions")),
      ('', 'from', None, _("fold revisions linearly to working copy parent")),
-     ('n', 'note', '', _('store a note on fold')),
+     ('n', 'note', '', _('store a note on fold'), _('TEXT')),
     ] + commitopts + commitopts2 + commitopts3,
     _('hg fold [OPTION]... [-r] REV'))
 def fold(ui, repo, *revs, **opts):
@@ -789,9 +789,9 @@
 
 @eh.command(
     'metaedit',
-    [('r', 'rev', [], _("revision to edit")),
+    [('r', 'rev', [], _("revision to edit"), _('REV')),
      ('', 'fold', None, _("also fold specified revisions into one")),
-     ('n', 'note', '', _('store a note on metaedit')),
+     ('n', 'note', '', _('store a note on metaedit'), _('TEXT')),
     ] + commitopts + commitopts2 + commitopts3,
     _('hg metaedit [OPTION]... [-r] [REV]'))
 def metaedit(ui, repo, *revs, **opts):
@@ -939,10 +939,10 @@
 @eh.command(
     '^prune|obsolete',
     [('n', 'new', [], _("successor changeset (DEPRECATED)")),
-     ('s', 'succ', [], _("successor changeset")),
-     ('r', 'rev', [], _("revisions to prune")),
+     ('s', 'succ', [], _("successor changeset"), _('REV')),
+     ('r', 'rev', [], _("revisions to prune"), _('REV')),
      ('k', 'keep', None, _("does not modify working copy during prune")),
-     ('n', 'note', '', _('store a note on prune')),
+     ('n', 'note', '', _('store a note on prune'), _('TEXT')),
      ('', 'pair', False, _("record a pairing, such as a rebase or divergence resolution "
                            "(pairing multiple precursors to multiple successors)")),
      ('', 'biject', False, _("alias to --pair (DEPRECATED)")),
@@ -951,7 +951,7 @@
      ('', 'split', False,
       _("record a split (on precursor, multiple successors)")),
      ('B', 'bookmark', [], _("remove revs only reachable from given"
-                             " bookmark"))] + metadataopts,
+                             " bookmark"), _('BOOKMARK'))] + metadataopts,
     _('[OPTION] [-r] REV...'))
 # XXX -U  --noupdate option to prevent wc update and or bookmarks update ?
 def cmdprune(ui, repo, *revs, **opts):
@@ -1129,8 +1129,8 @@
 
 @eh.command(
     '^split',
-    [('r', 'rev', [], _("revision to split")),
-     ('n', 'note', '', _("store a note on split")),
+    [('r', 'rev', [], _("revision to split"), _('REV')),
+     ('n', 'note', '', _("store a note on split"), _('TEXT')),
     ] + commitopts + commitopts2 + commitopts3,
     _('hg split [OPTION]... [-r] REV'))
 def cmdsplit(ui, repo, *revs, **opts):
@@ -1225,8 +1225,8 @@
 
 @eh.command(
     'touch',
-    [('r', 'rev', [], 'revision to update'),
-     ('n', 'note', '', _('store a note on touch')),
+    [('r', 'rev', [], _('revision to update'), _('REV')),
+     ('n', 'note', '', _('store a note on touch'), _('TEXT')),
      ('D', 'duplicate', False,
       'do not mark the new revision as successor of the old one'),
      ('A', 'allowdivergence', False,
@@ -1318,7 +1318,7 @@
 
 @eh.command(
     'pick|grab',
-    [('r', 'rev', '', 'revision to pick'),
+    [('r', 'rev', '', _('revision to pick'), _('REV')),
      ('c', 'continue', False, 'continue interrupted pick'),
      ('a', 'abort', False, 'abort interrupted pick'),
     ],
--- a/hgext3rd/evolve/evolvecmd.py	Wed Oct 17 14:02:18 2018 +0200
+++ b/hgext3rd/evolve/evolvecmd.py	Wed Oct 17 23:10:30 2018 +0800
@@ -1340,7 +1340,7 @@
      ('A', 'any', False,
       _('also consider troubled changesets unrelated to current working '
         'directory')),
-     ('r', 'rev', [], _('solves troubles of these revisions')),
+     ('r', 'rev', [], _('solves troubles of these revisions'), _('REV')),
      ('', 'bumped', False, _('solves only bumped changesets (DEPRECATED)')),
      ('', 'phase-divergent', False, _('solves only phase-divergent changesets')),
      ('', 'divergent', False, _('solves only divergent changesets (DEPRECATED)')),
--- a/hgext3rd/evolve/rewind.py	Wed Oct 17 14:02:18 2018 +0200
+++ b/hgext3rd/evolve/rewind.py	Wed Oct 17 23:10:30 2018 +0800
@@ -27,10 +27,11 @@
 
 @eh.command(
     '^rewind|undo',
-    [('', 'to', [], _("rewind to these revisions")),
+    [('', 'to', [], _("rewind to these revisions"), _('REV')),
      ('', 'as-divergence', None, _("preserve current latest successors")),
      ('', 'exact', None, _("only rewind explicitly selected revisions")),
-     ('', 'from', [], _("rewind these revisions to their predecessors")),
+     ('', 'from', [],
+      _("rewind these revisions to their predecessors"), _('REV')),
     ],
     _(''))
 def rewind(ui, repo, **opts):
--- a/tests/test-amend.t	Wed Oct 17 14:02:18 2018 +0200
+++ b/tests/test-amend.t	Wed Oct 17 23:10:30 2018 +0800
@@ -153,7 +153,7 @@
       --close-branch        mark a branch as closed, hiding it from the branch
                             list
    -s --secret              use the secret phase for committing
-   -n --note VALUE          store a note on amend
+   -n --note TEXT           store a note on amend
    -I --include PATTERN [+] include names matching the given patterns
    -X --exclude PATTERN [+] exclude names matching the given patterns
    -m --message TEXT        use text as commit message
--- a/tests/test-grab.t	Wed Oct 17 14:02:18 2018 +0200
+++ b/tests/test-grab.t	Wed Oct 17 23:10:30 2018 +0800
@@ -25,9 +25,9 @@
   
   options:
   
-   -r --rev VALUE revision to pick
-   -c --continue  continue interrupted pick
-   -a --abort     abort interrupted pick
+   -r --rev REV  revision to pick
+   -c --continue continue interrupted pick
+   -a --abort    abort interrupted pick
   
   (some details hidden, use --verbose to show complete help)
 
--- a/tests/test-tutorial.t	Wed Oct 17 14:02:18 2018 +0200
+++ b/tests/test-tutorial.t	Wed Oct 17 23:10:30 2018 +0800
@@ -934,9 +934,9 @@
   options ([+] can be repeated):
   
    -a --all                 uncommit all changes when no arguments given
-   -r --rev VALUE           revert commit content to REV instead
+   -r --rev REV             revert commit content to REV instead
       --revert              discard working directory changes after uncommit
-   -n --note VALUE          store a note on uncommit
+   -n --note TEXT           store a note on uncommit
    -I --include PATTERN [+] include names matching the given patterns
    -X --exclude PATTERN [+] exclude names matching the given patterns
    -m --message TEXT        use text as commit message
@@ -973,16 +973,16 @@
   
   options ([+] can be repeated):
   
-   -r --rev VALUE [+] revision to fold
-      --exact         only fold specified revisions
-      --from          fold revisions linearly to working copy parent
-   -n --note VALUE    store a note on fold
-   -m --message TEXT  use text as commit message
-   -l --logfile FILE  read commit message from file
-   -d --date DATE     record the specified date as commit date
-   -u --user USER     record the specified user as committer
-   -D --current-date  record the current date as commit date
-   -U --current-user  record the current user as committer
+   -r --rev REV [+]  revision to fold
+      --exact        only fold specified revisions
+      --from         fold revisions linearly to working copy parent
+   -n --note TEXT    store a note on fold
+   -m --message TEXT use text as commit message
+   -l --logfile FILE read commit message from file
+   -d --date DATE    record the specified date as commit date
+   -u --user USER    record the specified user as committer
+   -D --current-date record the current date as commit date
+   -U --current-user record the current user as committer
   
   (some details hidden, use --verbose to show complete help)