##// END OF EJS Templates
mq: be more explicit on invalid patch name message
Idan Kamara -
r14054:3c616f51 default
parent child Browse files
Show More
@@ -854,10 +854,18 b' class queue(object):'
854
854
855 _reserved = ('series', 'status', 'guards', '.', '..')
855 _reserved = ('series', 'status', 'guards', '.', '..')
856 def check_reserved_name(self, name):
856 def check_reserved_name(self, name):
857 if (name in self._reserved or name.startswith('.hg')
857 if name in self._reserved:
858 or name.startswith('.mq') or '#' in name or ':' in name):
859 raise util.Abort(_('"%s" cannot be used as the name of a patch')
858 raise util.Abort(_('"%s" cannot be used as the name of a patch')
860 % name)
859 % name)
860 for prefix in ('.hg', '.mq'):
861 if name.startswith(prefix):
862 raise util.Abort(_('patch name cannot begin with "%s"')
863 % prefix)
864 for c in ('#', ':'):
865 if c in name:
866 raise util.Abort(_('"%s" cannot be used in the name of a patch')
867 % c)
868
861
869
862 def new(self, repo, patchfn, *pats, **opts):
870 def new(self, repo, patchfn, *pats, **opts):
863 """options:
871 """options:
@@ -106,10 +106,10 b' plain headers'
106 abort: "guards" cannot be used as the name of a patch
106 abort: "guards" cannot be used as the name of a patch
107 abort: "." cannot be used as the name of a patch
107 abort: "." cannot be used as the name of a patch
108 abort: ".." cannot be used as the name of a patch
108 abort: ".." cannot be used as the name of a patch
109 abort: ".hgignore" cannot be used as the name of a patch
109 abort: patch name cannot begin with ".hg"
110 abort: ".mqfoo" cannot be used as the name of a patch
110 abort: patch name cannot begin with ".mq"
111 abort: "foo#bar" cannot be used as the name of a patch
111 abort: "#" cannot be used in the name of a patch
112 abort: "foo:bar" cannot be used as the name of a patch
112 abort: ":" cannot be used in the name of a patch
113 % qnew with name containing slash
113 % qnew with name containing slash
114 abort: path ends in directory separator: foo/
114 abort: path ends in directory separator: foo/
115 abort: "foo" already exists as a directory
115 abort: "foo" already exists as a directory
@@ -173,10 +173,10 b' hg headers'
173 abort: "guards" cannot be used as the name of a patch
173 abort: "guards" cannot be used as the name of a patch
174 abort: "." cannot be used as the name of a patch
174 abort: "." cannot be used as the name of a patch
175 abort: ".." cannot be used as the name of a patch
175 abort: ".." cannot be used as the name of a patch
176 abort: ".hgignore" cannot be used as the name of a patch
176 abort: patch name cannot begin with ".hg"
177 abort: ".mqfoo" cannot be used as the name of a patch
177 abort: patch name cannot begin with ".mq"
178 abort: "foo#bar" cannot be used as the name of a patch
178 abort: "#" cannot be used in the name of a patch
179 abort: "foo:bar" cannot be used as the name of a patch
179 abort: ":" cannot be used in the name of a patch
180 % qnew with name containing slash
180 % qnew with name containing slash
181 abort: path ends in directory separator: foo/
181 abort: path ends in directory separator: foo/
182 abort: "foo" already exists as a directory
182 abort: "foo" already exists as a directory
General Comments 0
You need to be logged in to leave comments. Login now