help: register the 'gpg' command category and give it a description
authorSietse Brouwer <sbbrouwer@gmail.com>
Fri, 26 Apr 2019 17:39:07 +0200
changeset 42264 ade02721d3fa
parent 42263 c4a50e863ee2
child 42265 2930b31383af
help: register the 'gpg' command category and give it a description help.py expects extensions to register their command category in the CATEGORY_ORDER and CATEGORY_NAMES variables. Once gendoc.py orders commands by category, in the next patch, it'll assume this registration (and raise an exception on encountering any unregistered categories). Luckily, gpg is the only bundled extension with an unregistered custom category, so let's fix it. Differential Revision: https://phab.mercurial-scm.org/D6324
hgext/gpg.py
--- a/hgext/gpg.py	Thu Apr 25 15:30:40 2019 -0700
+++ b/hgext/gpg.py	Fri Apr 26 17:39:07 2019 +0200
@@ -49,6 +49,11 @@
 
 # Custom help category
 _HELP_CATEGORY = 'gpg'
+help.CATEGORY_ORDER.insert(
+    help.CATEGORY_ORDER.index(registrar.command.CATEGORY_HELP),
+    _HELP_CATEGORY
+)
+help.CATEGORY_NAMES[_HELP_CATEGORY] = 'Signing changes (GPG)'
 
 class gpg(object):
     def __init__(self, path, key=None):