diff -r aa55c5354b8f -r 1d56c539794e 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):