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.
--- 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):
--- 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