comparison hgext/extdiff.py @ 40806:151aec6494a8

extdiff: avoid double backslashes in the displayed tool path on Windows This shows the tool path in the help, and changed in 67b180c0e263. uirepr() already does the same thing, but that undoes the mangling in its call to repr().
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 03 Dec 2018 12:48:42 -0500
parents 3d76a8e627a6
children cb372d09d30a
comparison
equal deleted inserted replaced
40805:01c335afc997 40806:151aec6494a8
381 to its parent. 381 to its parent.
382 """ 382 """
383 383
384 def __init__(self, path, cmdline): 384 def __init__(self, path, cmdline):
385 # We can't pass non-ASCII through docstrings (and path is 385 # We can't pass non-ASCII through docstrings (and path is
386 # in an unknown encoding anyway) 386 # in an unknown encoding anyway), but avoid double separators on
387 docpath = stringutil.escapestr(path) 387 # Windows
388 docpath = stringutil.escapestr(path).replace(b'\\\\', b'\\')
388 self.__doc__ %= {r'path': pycompat.sysstr(stringutil.uirepr(docpath))} 389 self.__doc__ %= {r'path': pycompat.sysstr(stringutil.uirepr(docpath))}
389 self._cmdline = cmdline 390 self._cmdline = cmdline
390 391
391 def __call__(self, ui, repo, *pats, **opts): 392 def __call__(self, ui, repo, *pats, **opts):
392 opts = pycompat.byteskwargs(opts) 393 opts = pycompat.byteskwargs(opts)