Patchwork D301: scmutil: use util.shellquote instead of %r

login
register
mail settings
Submitter phabricator
Date Aug. 15, 2017, 7:42 a.m.
Message ID <8e4c1a013ce45ac6b40e1a28c6b4a505@localhost.localdomain>
Download mbox | patch
Permalink /patch/23016/
State Not Applicable
Headers show

Comments

phabricator - Aug. 15, 2017, 7:42 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2cd5aba5e1d2: scmutil: use util.shellquote instead of %r (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D301?vs=684&id=923

REVISION DETAIL
  https://phab.mercurial-scm.org/D301

AFFECTED FILES
  mercurial/scmutil.py
  tests/test-add.t
  tests/test-copy.t
  tests/test-rename.t

CHANGE DETAILS




To: durin42, #hg-reviewers, quark, indygreg
Cc: mercurial-devel

Patch

diff --git a/tests/test-rename.t b/tests/test-rename.t
--- a/tests/test-rename.t
+++ b/tests/test-rename.t
@@ -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
diff --git a/tests/test-copy.t b/tests/test-copy.t
--- a/tests/test-copy.t
+++ b/tests/test-copy.t
@@ -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
diff --git a/tests/test-add.t b/tests/test-add.t
--- a/tests/test-add.t
+++ b/tests/test-add.t
@@ -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
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -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)