##// END OF EJS Templates
mq: disallow # (and : on Windows) in patch names (issue2065)
Sune Foldager -
r10588:b0b19d61 stable
parent child Browse files
Show More
@@ -813,7 +813,8 b' class queue(object):'
813 _reserved = ('series', 'status', 'guards')
813 _reserved = ('series', 'status', 'guards')
814 def check_reserved_name(self, name):
814 def check_reserved_name(self, name):
815 if (name in self._reserved or name.startswith('.hg')
815 if (name in self._reserved or name.startswith('.hg')
816 or name.startswith('.mq')):
816 or name.startswith('.mq') or '#' in name
817 or (os.name == 'nt' and ':' in name)):
817 raise util.Abort(_('"%s" cannot be used as the name of a patch')
818 raise util.Abort(_('"%s" cannot be used as the name of a patch')
818 % name)
819 % name)
819
820
@@ -19,6 +19,8 b' runtest() {'
19 hg qnew status
19 hg qnew status
20 hg qnew guards
20 hg qnew guards
21 hg qnew .hgignore
21 hg qnew .hgignore
22 hg qnew .mqfoo
23 hg qnew 'foo#bar'
22
24
23 hg qinit -c
25 hg qinit -c
24
26
@@ -5,6 +5,8 b' abort: "series" cannot be used as the na'
5 abort: "status" cannot be used as the name of a patch
5 abort: "status" cannot be used as the name of a patch
6 abort: "guards" cannot be used as the name of a patch
6 abort: "guards" cannot be used as the name of a patch
7 abort: ".hgignore" cannot be used as the name of a patch
7 abort: ".hgignore" cannot be used as the name of a patch
8 abort: ".mqfoo" cannot be used as the name of a patch
9 abort: "foo#bar" cannot be used as the name of a patch
8 % qnew with uncommitted changes
10 % qnew with uncommitted changes
9 uncommitted.patch
11 uncommitted.patch
10 % qnew implies add
12 % qnew implies add
@@ -52,6 +54,8 b' abort: "series" cannot be used as the na'
52 abort: "status" cannot be used as the name of a patch
54 abort: "status" cannot be used as the name of a patch
53 abort: "guards" cannot be used as the name of a patch
55 abort: "guards" cannot be used as the name of a patch
54 abort: ".hgignore" cannot be used as the name of a patch
56 abort: ".hgignore" cannot be used as the name of a patch
57 abort: ".mqfoo" cannot be used as the name of a patch
58 abort: "foo#bar" cannot be used as the name of a patch
55 % qnew with uncommitted changes
59 % qnew with uncommitted changes
56 uncommitted.patch
60 uncommitted.patch
57 % qnew implies add
61 % qnew implies add
General Comments 0
You need to be logged in to leave comments. Login now