# HG changeset patch # User Martin von Zweigbergk # Date 1562655790 25200 # Node ID 83666f011679237ea39473788409e42ccdce8e3e # Parent 819712deac699a76c9100498cc98beb44ab2bd2c py3: store _origdoc as str Since __doc__ is str, it seems natural that _origdoc also is. Differential Revision: https://phab.mercurial-scm.org/D6623 diff -r 819712deac69 -r 83666f011679 hgext/show.py --- a/hgext/show.py Fri Jun 28 12:59:21 2019 -0700 +++ b/hgext/show.py Tue Jul 09 00:03:10 2019 -0700 @@ -460,8 +460,8 @@ longest = max(map(len, showview._table.keys())) entries = [] for key in sorted(showview._table.keys()): - entries.append(pycompat.sysstr(' %s %s' % ( - key.ljust(longest), showview._table[key]._origdoc))) + entries.append(r' %s %s' % ( + pycompat.sysstr(key.ljust(longest)), showview._table[key]._origdoc)) cmdtable['show'][0].__doc__ = pycompat.sysstr('%s\n\n%s\n ') % ( cmdtable['show'][0].__doc__.rstrip(), diff -r 819712deac69 -r 83666f011679 mercurial/registrar.py --- a/mercurial/registrar.py Fri Jun 28 12:59:21 2019 -0700 +++ b/mercurial/registrar.py Tue Jul 09 00:03:10 2019 -0700 @@ -64,8 +64,8 @@ raise error.ProgrammingError(msg) if func.__doc__ and not util.safehasattr(func, '_origdoc'): - doc = pycompat.sysbytes(func.__doc__).strip() - func._origdoc = doc + func._origdoc = func.__doc__.strip() + doc = pycompat.sysbytes(func._origdoc) func.__doc__ = pycompat.sysstr(self._formatdoc(decl, doc)) self._table[name] = func