scmutil: use util.shellquote instead of %r
authorAugie Fackler <augie@google.com>
Wed, 26 Jul 2017 23:47:54 -0400
changeset 33819 2cd5aba5e1d2
parent 33818 4abf34f47526
child 33820 05264fc9d8d6
scmutil: use util.shellquote instead of %r Changes some output, but also resolves differences with Python 3. Differential Revision: https://phab.mercurial-scm.org/D301
mercurial/scmutil.py
tests/test-add.t
tests/test-copy.t
tests/test-rename.t
--- a/mercurial/scmutil.py	Mon Aug 14 11:20:06 2017 +0200
+++ b/mercurial/scmutil.py	Wed Jul 26 23:47:54 2017 -0400
@@ -273,7 +273,7 @@
     if abort or warn:
         msg = util.checkwinfilename(f)
         if msg:
-            msg = "%s: %r" % (msg, f)
+            msg = "%s: %s" % (msg, util.shellquote(f))
             if abort:
                 raise error.Abort(msg)
             ui.warn(_("warning: %s\n") % msg)
--- a/tests/test-add.t	Mon Aug 14 11:20:06 2017 +0200
+++ b/tests/test-add.t	Wed Jul 26 23:47:54 2017 -0400
@@ -44,14 +44,14 @@
   abort: ui.portablefilenames value is invalid ('jump')
   [255]
   $ hg --config ui.portablefilenames=abort add con.xml
-  abort: filename contains 'con', which is reserved on Windows: 'con.xml'
+  abort: filename contains 'con', which is reserved on Windows: con.xml
   [255]
   $ hg st
   A a
   A b
   ? con.xml
   $ hg add con.xml
-  warning: filename contains 'con', which is reserved on Windows: 'con.xml'
+  warning: filename contains 'con', which is reserved on Windows: con.xml
   $ hg st
   A a
   A b
--- a/tests/test-copy.t	Mon Aug 14 11:20:06 2017 +0200
+++ b/tests/test-copy.t	Wed Jul 26 23:47:54 2017 -0400
@@ -15,7 +15,7 @@
   $ hg status
   $ hg copy a b
   $ hg --config ui.portablefilenames=abort copy a con.xml
-  abort: filename contains 'con', which is reserved on Windows: 'con.xml'
+  abort: filename contains 'con', which is reserved on Windows: con.xml
   [255]
   $ hg status
   A b
--- a/tests/test-rename.t	Mon Aug 14 11:20:06 2017 +0200
+++ b/tests/test-rename.t	Wed Jul 26 23:47:54 2017 -0400
@@ -12,7 +12,7 @@
 
   $ hg rename d1/d11/a1 d2/c
   $ hg --config ui.portablefilenames=abort rename d1/a d1/con.xml
-  abort: filename contains 'con', which is reserved on Windows: 'd1/con.xml'
+  abort: filename contains 'con', which is reserved on Windows: d1/con.xml
   [255]
   $ hg sum
   parent: 0:9b4b6e7b2c26 tip