Mercurial > hg
annotate tests/test-mq-qnew.t @ 16445:453c8670566c
revset: speedup matching() by stopping the match early if a field does not match
Rather than getting all the fields that are being matches from every revision
and then comparing them to those of the target revision, compare each field one
by one and stop the match as soon as there is a match failure.
This can greatly reduce the match time when matching multiple fields.
The impact on match time when matching a single field seems negligible
(according to my measurements).
author | Angel Ezquerra <angel.ezquerra@gmail.com> |
---|---|
date | Fri, 13 Apr 2012 13:46:49 +0200 |
parents | e7119b091809 |
children | 4fe8eb4a6e2c |
rev | line source |
---|---|
7296
695383442347
mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
1 |
12466 | 2 $ catpatch() { |
3 > cat $1 | sed -e "s/^\(# Parent \).*/\1/" | |
4 > } | |
5 $ echo "[extensions]" >> $HGRCPATH | |
6 $ echo "mq=" >> $HGRCPATH | |
7 $ runtest() { | |
8 > hg init mq | |
9 > cd mq | |
10 > | |
11 > echo a > a | |
12 > hg ci -Ama | |
13 > | |
14 > echo '% qnew should refuse bad patch names' | |
15 > hg qnew series | |
16 > hg qnew status | |
17 > hg qnew guards | |
14051
2b1226693c70
mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents:
13197
diff
changeset
|
18 > hg qnew . |
2b1226693c70
mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents:
13197
diff
changeset
|
19 > hg qnew .. |
12466 | 20 > hg qnew .hgignore |
21 > hg qnew .mqfoo | |
22 > hg qnew 'foo#bar' | |
23 > hg qnew 'foo:bar' | |
24 > | |
25 > hg qinit -c | |
26 > | |
27 > echo '% qnew with name containing slash' | |
12878
1634287b6ab1
qnew: give better feedback when doing 'hg qnew foo/' (issue2464)
Martin Geisler <mg@aragost.com>
parents:
12466
diff
changeset
|
28 > hg qnew foo/ |
12466 | 29 > hg qnew foo/bar.patch |
12879
da4a9ed369c8
qnew: distinguish between existing file and directory (issue2464)
Martin Geisler <mg@aragost.com>
parents:
12878
diff
changeset
|
30 > hg qnew foo |
12466 | 31 > hg qseries |
32 > hg qpop | |
33 > hg qdelete foo/bar.patch | |
34 > | |
35 > echo '% qnew with uncommitted changes' | |
36 > echo a > somefile | |
37 > hg add somefile | |
38 > hg qnew uncommitted.patch | |
39 > hg st | |
40 > hg qseries | |
41 > | |
42 > echo '% qnew implies add' | |
43 > hg -R .hg/patches st | |
44 > | |
45 > echo '% qnew missing' | |
46 > hg qnew missing.patch missing | |
47 > | |
48 > echo '% qnew -m' | |
49 > hg qnew -m 'foo bar' mtest.patch | |
50 > catpatch .hg/patches/mtest.patch | |
51 > | |
52 > echo '% qnew twice' | |
53 > hg qnew first.patch | |
54 > hg qnew first.patch | |
55 > | |
56 > touch ../first.patch | |
57 > hg qimport ../first.patch | |
58 > | |
59 > echo '% qnew -f from a subdirectory' | |
60 > hg qpop -a | |
61 > mkdir d | |
62 > cd d | |
63 > echo b > b | |
64 > hg ci -Am t | |
65 > echo b >> b | |
66 > hg st | |
67 > hg qnew -g -f p | |
68 > catpatch ../.hg/patches/p | |
69 > | |
70 > echo '% qnew -u with no username configured' | |
71 > HGUSER= hg qnew -u blue red | |
72 > catpatch ../.hg/patches/red | |
73 > | |
74 > echo '% qnew -e -u with no username configured' | |
75 > HGUSER= hg qnew -e -u chartreuse fucsia | |
76 > catpatch ../.hg/patches/fucsia | |
77 > | |
78 > echo '% fail when trying to import a merge' | |
79 > hg init merge | |
80 > cd merge | |
81 > touch a | |
82 > hg ci -Am null | |
83 > echo a >> a | |
84 > hg ci -m a | |
85 > hg up -r 0 | |
86 > echo b >> a | |
87 > hg ci -m b | |
88 > hg merge -f 1 | |
89 > hg resolve --mark a | |
90 > hg qnew -f merge | |
91 > | |
92 > cd ../../.. | |
93 > rm -r mq | |
94 > } | |
10397
8cb81d75730c
mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents:
10372
diff
changeset
|
95 |
12466 | 96 plain headers |
7296
695383442347
mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
97 |
12466 | 98 $ echo "[mq]" >> $HGRCPATH |
99 $ echo "plain=true" >> $HGRCPATH | |
100 $ mkdir sandbox | |
101 $ (cd sandbox ; runtest) | |
102 adding a | |
103 % qnew should refuse bad patch names | |
104 abort: "series" cannot be used as the name of a patch | |
105 abort: "status" cannot be used as the name of a patch | |
106 abort: "guards" cannot be used as the name of a patch | |
14051
2b1226693c70
mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents:
13197
diff
changeset
|
107 abort: "." cannot be used as the name of a patch |
2b1226693c70
mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents:
13197
diff
changeset
|
108 abort: ".." cannot be used as the name of a patch |
14054
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
109 abort: patch name cannot begin with ".hg" |
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
110 abort: patch name cannot begin with ".mq" |
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
111 abort: "#" cannot be used in the name of a patch |
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
112 abort: ":" cannot be used in the name of a patch |
12466 | 113 % qnew with name containing slash |
13197
684a977c2ae0
opener: forbid paths ending with directory separator (issue2507)
Jim Hague <jim.hague@acm.org>
parents:
12960
diff
changeset
|
114 abort: path ends in directory separator: foo/ |
12879
da4a9ed369c8
qnew: distinguish between existing file and directory (issue2464)
Martin Geisler <mg@aragost.com>
parents:
12878
diff
changeset
|
115 abort: "foo" already exists as a directory |
12466 | 116 foo/bar.patch |
117 popping foo/bar.patch | |
118 patch queue now empty | |
119 % qnew with uncommitted changes | |
120 uncommitted.patch | |
121 % qnew implies add | |
122 A .hgignore | |
123 A series | |
124 A uncommitted.patch | |
125 % qnew missing | |
15521
117f9190c1ba
tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents:
14054
diff
changeset
|
126 abort: missing: * (glob) |
12466 | 127 % qnew -m |
128 foo bar | |
129 | |
130 % qnew twice | |
131 abort: patch "first.patch" already exists | |
132 abort: patch "first.patch" already exists | |
133 % qnew -f from a subdirectory | |
134 popping first.patch | |
135 popping mtest.patch | |
136 popping uncommitted.patch | |
137 patch queue now empty | |
138 adding d/b | |
139 M d/b | |
140 diff --git a/d/b b/d/b | |
141 --- a/d/b | |
142 +++ b/d/b | |
143 @@ -1,1 +1,2 @@ | |
144 b | |
145 +b | |
146 % qnew -u with no username configured | |
147 From: blue | |
148 | |
149 % qnew -e -u with no username configured | |
150 From: chartreuse | |
151 | |
152 % fail when trying to import a merge | |
153 adding a | |
154 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
155 created new head | |
156 merging a | |
157 warning: conflicts during merge. | |
15501
2371f4aea665
merge: give a special message for internal:merge failure (issue3105)
Matt Mackall <mpm@selenic.com>
parents:
14054
diff
changeset
|
158 merging a incomplete! (edit conflicts, then use 'hg resolve --mark') |
12466 | 159 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
160 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
161 abort: cannot manage merge changesets | |
162 $ rm -r sandbox | |
2714
85070b784896
Fix test-mq-qnew-twice exit code and output.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2711
diff
changeset
|
163 |
12466 | 164 hg headers |
11575
a5903e612f07
mq: evaluate --user before invoking editor with -e (issue2289)
Brendan Cully <brendan@kublai.com>
parents:
11513
diff
changeset
|
165 |
12466 | 166 $ echo "plain=false" >> $HGRCPATH |
167 $ mkdir sandbox | |
168 $ (cd sandbox ; runtest) | |
169 adding a | |
170 % qnew should refuse bad patch names | |
171 abort: "series" cannot be used as the name of a patch | |
172 abort: "status" cannot be used as the name of a patch | |
173 abort: "guards" cannot be used as the name of a patch | |
14051
2b1226693c70
mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents:
13197
diff
changeset
|
174 abort: "." cannot be used as the name of a patch |
2b1226693c70
mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents:
13197
diff
changeset
|
175 abort: ".." cannot be used as the name of a patch |
14054
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
176 abort: patch name cannot begin with ".hg" |
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
177 abort: patch name cannot begin with ".mq" |
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
178 abort: "#" cannot be used in the name of a patch |
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
179 abort: ":" cannot be used in the name of a patch |
12466 | 180 % qnew with name containing slash |
13197
684a977c2ae0
opener: forbid paths ending with directory separator (issue2507)
Jim Hague <jim.hague@acm.org>
parents:
12960
diff
changeset
|
181 abort: path ends in directory separator: foo/ |
12879
da4a9ed369c8
qnew: distinguish between existing file and directory (issue2464)
Martin Geisler <mg@aragost.com>
parents:
12878
diff
changeset
|
182 abort: "foo" already exists as a directory |
12466 | 183 foo/bar.patch |
184 popping foo/bar.patch | |
185 patch queue now empty | |
186 % qnew with uncommitted changes | |
187 uncommitted.patch | |
188 % qnew implies add | |
189 A .hgignore | |
190 A series | |
191 A uncommitted.patch | |
192 % qnew missing | |
15521
117f9190c1ba
tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents:
14054
diff
changeset
|
193 abort: missing: * (glob) |
12466 | 194 % qnew -m |
195 # HG changeset patch | |
196 # Parent | |
197 foo bar | |
198 | |
199 % qnew twice | |
200 abort: patch "first.patch" already exists | |
201 abort: patch "first.patch" already exists | |
202 % qnew -f from a subdirectory | |
203 popping first.patch | |
204 popping mtest.patch | |
205 popping uncommitted.patch | |
206 patch queue now empty | |
207 adding d/b | |
208 M d/b | |
209 # HG changeset patch | |
210 # Parent | |
211 diff --git a/d/b b/d/b | |
212 --- a/d/b | |
213 +++ b/d/b | |
214 @@ -1,1 +1,2 @@ | |
215 b | |
216 +b | |
217 % qnew -u with no username configured | |
218 # HG changeset patch | |
219 # Parent | |
220 # User blue | |
221 % qnew -e -u with no username configured | |
222 # HG changeset patch | |
223 # Parent | |
224 # User chartreuse | |
225 % fail when trying to import a merge | |
226 adding a | |
227 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
228 created new head | |
229 merging a | |
230 warning: conflicts during merge. | |
15501
2371f4aea665
merge: give a special message for internal:merge failure (issue3105)
Matt Mackall <mpm@selenic.com>
parents:
14054
diff
changeset
|
231 merging a incomplete! (edit conflicts, then use 'hg resolve --mark') |
12466 | 232 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
233 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
234 abort: cannot manage merge changesets | |
235 $ rm -r sandbox |