changeset 37140:1d56c539794e

py3: bytes/unicode dance on __doc__ of cmdalias
author Yuya Nishihara <yuya@tcha.org>
date Wed, 28 Mar 2018 22:06:47 +0900
parents aa55c5354b8f
children eb4a23382e18
files mercurial/dispatch.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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):