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) 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/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-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