# HG changeset patch # User Augie Fackler # Date 1433529112 14400 # Node ID d3a00fc3680fbca6280712bc8b6dafb3c0be3bfd # Parent 43906060a3f4f880c06f91d723fac20f959c2bbb mq: use %r to format illegal characters instead of manually quoting This will make it easier to ban \r and \n in the next patch and still have a sensible error message. diff -r 43906060a3f4 -r d3a00fc3680f hgext/mq.py --- a/hgext/mq.py Fri Jun 05 15:20:33 2015 -0400 +++ b/hgext/mq.py Fri Jun 05 14:31:52 2015 -0400 @@ -1104,7 +1104,7 @@ % prefix) for c in ('#', ':'): if c in name: - raise util.Abort(_('"%s" cannot be used in the name of a patch') + raise util.Abort(_('%r cannot be used in the name of a patch') % c) def checkpatchname(self, name, force=False): diff -r 43906060a3f4 -r d3a00fc3680f tests/test-mq-qnew.t --- a/tests/test-mq-qnew.t Fri Jun 05 15:20:33 2015 -0400 +++ b/tests/test-mq-qnew.t Fri Jun 05 14:31:52 2015 -0400 @@ -108,8 +108,8 @@ abort: ".." cannot be used as the name of a patch abort: patch name cannot begin with ".hg" abort: patch name cannot begin with ".mq" - abort: "#" cannot be used in the name of a patch - abort: ":" cannot be used in the name of a patch + abort: '#' cannot be used in the name of a patch + abort: ':' cannot be used in the name of a patch % qnew with name containing slash abort: path ends in directory separator: foo/ (glob) abort: "foo" already exists as a directory @@ -176,8 +176,8 @@ abort: ".." cannot be used as the name of a patch abort: patch name cannot begin with ".hg" abort: patch name cannot begin with ".mq" - abort: "#" cannot be used in the name of a patch - abort: ":" cannot be used in the name of a patch + abort: '#' cannot be used in the name of a patch + abort: ':' cannot be used in the name of a patch % qnew with name containing slash abort: path ends in directory separator: foo/ (glob) abort: "foo" already exists as a directory