Mercurial > hg
comparison hgext/mq.py @ 25453:d3a00fc3680f
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.
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 05 Jun 2015 14:31:52 -0400 |
parents | d298805fb639 |
children | b5a8bc09b0db |
comparison
equal
deleted
inserted
replaced
25452:43906060a3f4 | 25453:d3a00fc3680f |
---|---|
1102 if name.startswith(prefix): | 1102 if name.startswith(prefix): |
1103 raise util.Abort(_('patch name cannot begin with "%s"') | 1103 raise util.Abort(_('patch name cannot begin with "%s"') |
1104 % prefix) | 1104 % prefix) |
1105 for c in ('#', ':'): | 1105 for c in ('#', ':'): |
1106 if c in name: | 1106 if c in name: |
1107 raise util.Abort(_('"%s" cannot be used in the name of a patch') | 1107 raise util.Abort(_('%r cannot be used in the name of a patch') |
1108 % c) | 1108 % c) |
1109 | 1109 |
1110 def checkpatchname(self, name, force=False): | 1110 def checkpatchname(self, name, force=False): |
1111 self.checkreservedname(name) | 1111 self.checkreservedname(name) |
1112 if not force and os.path.exists(self.join(name)): | 1112 if not force and os.path.exists(self.join(name)): |