Patchwork [1,of,3] phabricator: assign commands to help categories

login
register
mail settings
Submitter Matt Harbison
Date Dec. 29, 2018, 1:29 a.m.
Message ID <a0ebb47df5ecc5d51e08.1546046944@Envy>
Download mbox | patch
Permalink /patch/37388/
State Accepted
Headers show

Comments

Matt Harbison - Dec. 29, 2018, 1:29 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1546036393 18000
#      Fri Dec 28 17:33:13 2018 -0500
# Node ID a0ebb47df5ecc5d51e08b05287ce590f8fe47851
# Parent  f91292b9e400a63b462aa736448cecc07480a65a
phabricator: assign commands to help categories

`phabsend` and `phabupdate` seem pretty close to `email`.  `phabread` is a
little less close, but can be trivially used to actually import patches.
Yuya Nishihara - Dec. 30, 2018, 7:56 a.m.
On Fri, 28 Dec 2018 20:29:04 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1546036393 18000
> #      Fri Dec 28 17:33:13 2018 -0500
> # Node ID a0ebb47df5ecc5d51e08b05287ce590f8fe47851
> # Parent  f91292b9e400a63b462aa736448cecc07480a65a
> phabricator: assign commands to help categories

Queued, thanks.

Patch

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -121,7 +121,7 @@  colortable = {
      )),
 ]
 
-def vcrcommand(name, flags, spec):
+def vcrcommand(name, flags, spec, helpcategory=None):
     fullflags = flags + _VCR_FLAGS
     def decorate(fn):
         def inner(*args, **kwargs):
@@ -143,7 +143,7 @@  def vcrcommand(name, flags, spec):
             return fn(*args, **kwargs)
         inner.__name__ = fn.__name__
         inner.__doc__ = fn.__doc__
-        return command(name, fullflags, spec)(inner)
+        return command(name, fullflags, spec, helpcategory=helpcategory)(inner)
     return decorate
 
 def urlencodenested(params):
@@ -463,7 +463,8 @@  def userphids(repo, names):
           (b'', b'amend', True, _(b'update commit messages')),
           (b'', b'reviewer', [], _(b'specify reviewers')),
           (b'', b'confirm', None, _(b'ask for confirmation before sending'))],
-         _(b'REV [OPTIONS]'))
+         _(b'REV [OPTIONS]'),
+         helpcategory=command.CATEGORY_IMPORT_EXPORT)
 def phabsend(ui, repo, *revs, **opts):
     """upload changesets to Phabricator
 
@@ -917,7 +918,8 @@  def readpatch(repo, drevs, write):
 
 @vcrcommand(b'phabread',
          [(b'', b'stack', False, _(b'read dependencies'))],
-         _(b'DREVSPEC [OPTIONS]'))
+         _(b'DREVSPEC [OPTIONS]'),
+         helpcategory=command.CATEGORY_IMPORT_EXPORT)
 def phabread(ui, repo, spec, **opts):
     """print patches from Phabricator suitable for importing
 
@@ -948,7 +950,8 @@  def phabread(ui, repo, spec, **opts):
           (b'', b'abandon', False, _(b'abandon revisions')),
           (b'', b'reclaim', False, _(b'reclaim revisions')),
           (b'm', b'comment', b'', _(b'comment on the last revision')),
-          ], _(b'DREVSPEC [OPTIONS]'))
+          ], _(b'DREVSPEC [OPTIONS]'),
+          helpcategory=command.CATEGORY_IMPORT_EXPORT)
 def phabupdate(ui, repo, spec, **opts):
     """update Differential Revision in batch