mercurial/help.py
changeset 26414 c44b507e7c78
parent 26413 e0c572d4d112
child 26415 46af0adb5c37
--- a/mercurial/help.py	Sat Sep 26 12:06:30 2015 +0900
+++ b/mercurial/help.py	Sat Sep 26 12:11:46 2015 +0900
@@ -144,7 +144,7 @@
         path = os.path.join(docdir, topic + ".txt")
         doc = gettext(util.readfile(path))
         for rewriter in helphooks.get(topic, []):
-            doc = rewriter(topic, doc)
+            doc = rewriter(ui, topic, doc)
         return doc
 
     return loader
@@ -184,7 +184,7 @@
 def addtopichook(topic, rewriter):
     helphooks.setdefault(topic, []).append(rewriter)
 
-def makeitemsdoc(topic, doc, marker, items, dedent=False):
+def makeitemsdoc(ui, topic, doc, marker, items, dedent=False):
     """Extract docstring from the items key to function mapping, build a
     single documentation block and use it to overwrite the marker in doc.
     """
@@ -211,8 +211,8 @@
     return doc.replace(marker, entries)
 
 def addtopicsymbols(topic, marker, symbols, dedent=False):
-    def add(topic, doc):
-        return makeitemsdoc(topic, doc, marker, symbols, dedent=dedent)
+    def add(ui, topic, doc):
+        return makeitemsdoc(ui, topic, doc, marker, symbols, dedent=dedent)
     addtopichook(topic, add)
 
 addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)