changeset 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 01c335afc997
children f6d37e84d8f9
files hgext/extdiff.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/extdiff.py	Wed Nov 28 05:06:58 2018 +0100
+++ b/hgext/extdiff.py	Mon Dec 03 12:48:42 2018 -0500
@@ -383,8 +383,9 @@
 
     def __init__(self, path, cmdline):
         # We can't pass non-ASCII through docstrings (and path is
-        # in an unknown encoding anyway)
-        docpath = stringutil.escapestr(path)
+        # in an unknown encoding anyway), but avoid double separators on
+        # Windows
+        docpath = stringutil.escapestr(path).replace(b'\\\\', b'\\')
         self.__doc__ %= {r'path': pycompat.sysstr(stringutil.uirepr(docpath))}
         self._cmdline = cmdline