changeset 26412:7e8e3c0920a6

gendoc: use real ui in place of stdout ui attributes will be required by a help function, so a file object can't be used as a fake ui.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 27 Sep 2015 23:34:37 +0900
parents dd62eaa82cbe
children e0c572d4d112
files doc/gendoc.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/doc/gendoc.py	Sun Sep 27 22:29:07 2015 +0900
+++ b/doc/gendoc.py	Sun Sep 27 23:34:37 2015 +0900
@@ -14,6 +14,7 @@
 from mercurial.i18n import gettext, _
 from mercurial.help import helptable, loaddoc
 from mercurial import extensions
+from mercurial import ui as uimod
 
 def get_desc(docstr):
     if not docstr:
@@ -198,7 +199,8 @@
     if len(sys.argv) > 1:
         doc = sys.argv[1]
 
+    ui = uimod.ui()
     if doc == 'hg.1.gendoc':
-        showdoc(sys.stdout)
+        showdoc(ui)
     else:
-        showtopic(sys.stdout, sys.argv[1])
+        showtopic(ui, sys.argv[1])