hgext3rd/topic/compat.py
changeset 4894 f9743b13de6d
parent 4810 03690f8d2b0a
child 4929 bb2b4f6c99dc
--- 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}