py3: bytes/unicode dance on __doc__ of cmdalias
authorYuya Nishihara <yuya@tcha.org>
Wed, 28 Mar 2018 22:06:47 +0900
changeset 37140 1d56c539794e
parent 37139 aa55c5354b8f
child 37141 eb4a23382e18
py3: bytes/unicode dance on __doc__ of cmdalias
mercurial/dispatch.py
--- a/mercurial/dispatch.py	Wed Mar 28 22:04:45 2018 +0900
+++ b/mercurial/dispatch.py	Wed Mar 28 22:06:47 2018 +0900
@@ -551,7 +551,10 @@
             # drop prefix in old-style help lines so hg shows the alias
             self.help = self.help[4 + len(cmd):]
 
-        self.__doc__ = cfg.get('doc', fn.__doc__)
+        doc = cfg.get('doc', pycompat.getdoc(fn))
+        if doc is not None:
+            doc = pycompat.sysstr(doc)
+        self.__doc__ = doc
 
     @property
     def args(self):