diff hgext3rd/topic/compat.py @ 4894:f9743b13de6d

help: categorizing evolve and topic commands This makes them show up under the right categories in 'hg help'. Differential Revision: https://phab.mercurial-scm.org/D6999
author Rodrigo Damazio <rdamazio@google.com>
date Sun, 06 Oct 2019 02:30:12 -0400
parents 03690f8d2b0a
children bb2b4f6c99dc
line wrap: on
line diff
--- a/hgext3rd/topic/compat.py	Thu Oct 10 08:22:41 2019 +0700
+++ b/hgext3rd/topic/compat.py	Sun Oct 06 02:30:12 2019 -0400
@@ -10,6 +10,7 @@
 from mercurial import (
     obsolete,
     pycompat,
+    registrar,
 )
 
 getmarkers = None
@@ -34,3 +35,12 @@
     def branchmapitems(branchmap):
         return branchmap.iteritems()
     # py3-transform: on
+
+# help category compatibility
+# hg <= 4.7 (c303d65d2e34)
+def helpcategorykwargs(categoryname):
+    """Backwards-compatible specification of the helpategory argument."""
+    category = getattr(registrar.command, categoryname, None)
+    if not category:
+        return {}
+    return {'helpcategory': category}