Mercurial > hg
annotate tests/test-tags.t @ 24714:84859415a4c9
json: implement {comparison} template
Similar to {filediff}, we abbreviate some property names to cut down on
string bloat.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 10 Apr 2015 22:26:53 -0400 |
parents | 5150b2b5b345 |
children | 07200e3332a1 |
rev | line source |
---|---|
24706
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
1 setup |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
2 |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
3 $ cat >> $HGRCPATH << EOF |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
4 > [extensions] |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
5 > blackbox= |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
6 > mock=$TESTDIR/mockblackbox.py |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
7 > EOF |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
8 |
11744 | 9 Helper functions: |
10 | |
11 $ cacheexists() { | |
13272
5ccdca7df211
move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
jfh <jason@jasonfharris.com>
parents:
12763
diff
changeset
|
12 > [ -f .hg/cache/tags ] && echo "tag cache exists" || echo "no tag cache" |
11744 | 13 > } |
345 | 14 |
11744 | 15 $ dumptags() { |
16 > rev=$1 | |
17 > echo "rev $rev: .hgtags:" | |
18 > hg cat -r$rev .hgtags | |
19 > } | |
9151
f528d1a93491
tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents:
9144
diff
changeset
|
20 |
9152
4017291c4c48
tags: support 'instant' tag retrieval (issue548)
Greg Ward <greg-hg@gerg.ca>
parents:
9151
diff
changeset
|
21 # XXX need to test that the tag cache works when we strip an old head |
4017291c4c48
tags: support 'instant' tag retrieval (issue548)
Greg Ward <greg-hg@gerg.ca>
parents:
9151
diff
changeset
|
22 # and add a new one rooted off non-tip: i.e. node and rev of tip are the |
4017291c4c48
tags: support 'instant' tag retrieval (issue548)
Greg Ward <greg-hg@gerg.ca>
parents:
9151
diff
changeset
|
23 # same, but stuff has changed behind tip. |
4017291c4c48
tags: support 'instant' tag retrieval (issue548)
Greg Ward <greg-hg@gerg.ca>
parents:
9151
diff
changeset
|
24 |
11744 | 25 Setup: |
9143
a604c98dbf62
test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents:
5658
diff
changeset
|
26 |
11744 | 27 $ hg init t |
28 $ cd t | |
29 $ cacheexists | |
30 no tag cache | |
31 $ hg id | |
32 000000000000 tip | |
33 $ cacheexists | |
34 no tag cache | |
35 $ echo a > a | |
36 $ hg add a | |
37 $ hg commit -m "test" | |
38 $ hg co | |
39 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
40 $ hg identify | |
41 acb14030fe0a tip | |
42 $ cacheexists | |
43 tag cache exists | |
44 | |
12758
2d754eae430c
tags: do not fail if tags.cache is corrupted (issue2444)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12640
diff
changeset
|
45 Try corrupting the cache |
2d754eae430c
tags: do not fail if tags.cache is corrupted (issue2444)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12640
diff
changeset
|
46 |
13272
5ccdca7df211
move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
jfh <jason@jasonfharris.com>
parents:
12763
diff
changeset
|
47 $ printf 'a b' > .hg/cache/tags |
12758
2d754eae430c
tags: do not fail if tags.cache is corrupted (issue2444)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12640
diff
changeset
|
48 $ hg identify |
2d754eae430c
tags: do not fail if tags.cache is corrupted (issue2444)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12640
diff
changeset
|
49 acb14030fe0a tip |
2d754eae430c
tags: do not fail if tags.cache is corrupted (issue2444)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12640
diff
changeset
|
50 $ cacheexists |
2d754eae430c
tags: do not fail if tags.cache is corrupted (issue2444)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12640
diff
changeset
|
51 tag cache exists |
2d754eae430c
tags: do not fail if tags.cache is corrupted (issue2444)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12640
diff
changeset
|
52 $ hg identify |
2d754eae430c
tags: do not fail if tags.cache is corrupted (issue2444)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12640
diff
changeset
|
53 acb14030fe0a tip |
2d754eae430c
tags: do not fail if tags.cache is corrupted (issue2444)
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12640
diff
changeset
|
54 |
11744 | 55 Create local tag with long name: |
56 | |
57 $ T=`hg identify --debug --id` | |
58 $ hg tag -l "This is a local tag with a really long name!" | |
59 $ hg tags | |
60 tip 0:acb14030fe0a | |
61 This is a local tag with a really long name! 0:acb14030fe0a | |
62 $ rm .hg/localtags | |
63 | |
64 Create a tag behind hg's back: | |
9143
a604c98dbf62
test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents:
5658
diff
changeset
|
65 |
11744 | 66 $ echo "$T first" > .hgtags |
67 $ cat .hgtags | |
68 acb14030fe0a21b60322c440ad2d20cf7685a376 first | |
69 $ hg add .hgtags | |
70 $ hg commit -m "add tags" | |
71 $ hg tags | |
72 tip 1:b9154636be93 | |
73 first 0:acb14030fe0a | |
74 $ hg identify | |
75 b9154636be93 tip | |
76 | |
77 Repeat with cold tag cache: | |
78 | |
13272
5ccdca7df211
move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
jfh <jason@jasonfharris.com>
parents:
12763
diff
changeset
|
79 $ rm -f .hg/cache/tags |
11744 | 80 $ hg identify |
81 b9154636be93 tip | |
82 | |
83 And again, but now unable to write tag cache: | |
9143
a604c98dbf62
test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents:
5658
diff
changeset
|
84 |
16857
1415edd88c56
test-tags: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
15443
diff
changeset
|
85 #if unix-permissions |
13272
5ccdca7df211
move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
jfh <jason@jasonfharris.com>
parents:
12763
diff
changeset
|
86 $ rm -f .hg/cache/tags |
11744 | 87 $ chmod 555 .hg |
88 $ hg identify | |
89 b9154636be93 tip | |
90 $ chmod 755 .hg | |
16857
1415edd88c56
test-tags: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
15443
diff
changeset
|
91 #endif |
11744 | 92 |
24706
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
93 Tag cache debug info written to blackbox log |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
94 |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
95 $ rm -f .hg/cache/tags |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
96 $ hg identify |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
97 b9154636be93 tip |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
98 $ hg blackbox -l 4 |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
99 1970/01/01 00:00:00 bob> identify |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
100 1970/01/01 00:00:00 bob> resolved 1 tags cache entries from 1 manifests in ?.???? seconds (glob) |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
101 1970/01/01 00:00:00 bob> writing tags cache file with 1 heads and 1 tags |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
102 1970/01/01 00:00:00 bob> identify exited 0 after ?.?? seconds (glob) |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
103 |
5150b2b5b345
tests: move blackbox testing of tags to test-tags.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24532
diff
changeset
|
104 |
11744 | 105 Create a branch: |
9151
f528d1a93491
tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents:
9144
diff
changeset
|
106 |
11744 | 107 $ echo bb > a |
108 $ hg status | |
109 M a | |
110 $ hg identify | |
111 b9154636be93+ tip | |
112 $ hg co first | |
113 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
114 $ hg id | |
115 acb14030fe0a+ first | |
116 $ hg -v id | |
117 acb14030fe0a+ first | |
118 $ hg status | |
119 M a | |
120 $ echo 1 > b | |
121 $ hg add b | |
122 $ hg commit -m "branch" | |
123 created new head | |
124 $ hg id | |
125 c8edf04160c7 tip | |
126 | |
127 Merge the two heads: | |
9366
9ff178e7b627
tags: don't crash if unable to write tag cache
Greg Ward <greg-hg@gerg.ca>
parents:
9152
diff
changeset
|
128 |
11744 | 129 $ hg merge 1 |
130 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
131 (branch merge, don't forget to commit) | |
132 $ hg id | |
133 c8edf04160c7+b9154636be93+ tip | |
134 $ hg status | |
135 M .hgtags | |
136 $ hg commit -m "merge" | |
137 | |
138 Create a fake head, make sure tag not visible afterwards: | |
139 | |
140 $ cp .hgtags tags | |
141 $ hg tag last | |
142 $ hg rm .hgtags | |
143 $ hg commit -m "remove" | |
9143
a604c98dbf62
test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents:
5658
diff
changeset
|
144 |
11744 | 145 $ mv tags .hgtags |
146 $ hg add .hgtags | |
147 $ hg commit -m "readd" | |
148 $ | |
149 $ hg tags | |
150 tip 6:35ff301afafe | |
151 first 0:acb14030fe0a | |
152 | |
153 Add invalid tags: | |
345 | 154 |
11744 | 155 $ echo "spam" >> .hgtags |
156 $ echo >> .hgtags | |
157 $ echo "foo bar" >> .hgtags | |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
158 $ echo "a5a5 invalid" >> .hg/localtags |
17345
4f8054d3171b
check-code: fix check for trailing whitespace on sh command lines
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
159 $ cat .hgtags |
11744 | 160 acb14030fe0a21b60322c440ad2d20cf7685a376 first |
161 spam | |
162 | |
163 foo bar | |
164 $ hg commit -m "tags" | |
165 | |
166 Report tag parse error on other head: | |
2320
dbdce3b99988
fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2283
diff
changeset
|
167 |
11744 | 168 $ hg up 3 |
169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
170 $ echo 'x y' >> .hgtags | |
171 $ hg commit -m "head" | |
172 created new head | |
2320
dbdce3b99988
fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2283
diff
changeset
|
173 |
11744 | 174 $ hg tags |
175 .hgtags@75d9f02dfe28, line 2: cannot parse entry | |
176 .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed | |
177 .hgtags@c4be69a18c11, line 2: node 'x' is not well formed | |
178 tip 8:c4be69a18c11 | |
179 first 0:acb14030fe0a | |
180 $ hg tip | |
181 changeset: 8:c4be69a18c11 | |
182 tag: tip | |
183 parent: 3:ac5e980c4dc0 | |
184 user: test | |
185 date: Thu Jan 01 00:00:00 1970 +0000 | |
186 summary: head | |
187 | |
2320
dbdce3b99988
fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2283
diff
changeset
|
188 |
11744 | 189 Test tag precedence rules: |
2320
dbdce3b99988
fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2283
diff
changeset
|
190 |
11744 | 191 $ cd .. |
192 $ hg init t2 | |
193 $ cd t2 | |
194 $ echo foo > foo | |
195 $ hg add foo | |
196 $ hg ci -m 'add foo' # rev 0 | |
197 $ hg tag bar # rev 1 | |
198 $ echo >> foo | |
199 $ hg ci -m 'change foo 1' # rev 2 | |
200 $ hg up -C 1 | |
201 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
202 $ hg tag -r 1 -f bar # rev 3 | |
203 $ hg up -C 1 | |
204 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
205 $ echo >> foo | |
206 $ hg ci -m 'change foo 2' # rev 4 | |
207 created new head | |
208 $ hg tags | |
209 tip 4:0c192d7d5e6b | |
210 bar 1:78391a272241 | |
2320
dbdce3b99988
fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2283
diff
changeset
|
211 |
11744 | 212 Repeat in case of cache effects: |
2320
dbdce3b99988
fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2283
diff
changeset
|
213 |
11744 | 214 $ hg tags |
215 tip 4:0c192d7d5e6b | |
216 bar 1:78391a272241 | |
217 | |
218 Detailed dump of tag info: | |
1986
719cf07b076d
add checking for invalid entries in tag files
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1933
diff
changeset
|
219 |
11744 | 220 $ hg heads -q # expect 4, 3, 2 |
221 4:0c192d7d5e6b | |
222 3:6fa450212aeb | |
223 2:7a94127795a3 | |
224 $ dumptags 2 | |
225 rev 2: .hgtags: | |
226 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
227 $ dumptags 3 | |
228 rev 3: .hgtags: | |
229 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
230 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
231 78391a272241d70354aa14c874552cad6b51bb42 bar | |
232 $ dumptags 4 | |
233 rev 4: .hgtags: | |
234 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
9144
ad72e3b08bc0
test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents:
9143
diff
changeset
|
235 |
11744 | 236 Dump cache: |
237 | |
13272
5ccdca7df211
move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
jfh <jason@jasonfharris.com>
parents:
12763
diff
changeset
|
238 $ cat .hg/cache/tags |
11744 | 239 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d |
240 3 6fa450212aeb2a21ed616a54aea39a4a27894cd7 7d3b718c964ef37b89e550ebdafd5789e76ce1b0 | |
241 2 7a94127795a33c10a370c93f731fd9fea0b79af6 0c04f2a8af31de17fab7422878ee5a2dadbc943d | |
242 | |
19646
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
243 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
244 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
11744 | 245 78391a272241d70354aa14c874552cad6b51bb42 bar |
246 | |
247 Test tag removal: | |
9144
ad72e3b08bc0
test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents:
9143
diff
changeset
|
248 |
11744 | 249 $ hg tag --remove bar # rev 5 |
250 $ hg tip -vp | |
251 changeset: 5:5f6e8655b1c7 | |
252 tag: tip | |
253 user: test | |
254 date: Thu Jan 01 00:00:00 1970 +0000 | |
255 files: .hgtags | |
256 description: | |
257 Removed tag bar | |
258 | |
259 | |
260 diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags | |
261 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000 | |
262 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 | |
263 @@ -1,1 +1,3 @@ | |
264 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
265 +78391a272241d70354aa14c874552cad6b51bb42 bar | |
266 +0000000000000000000000000000000000000000 bar | |
267 | |
268 $ hg tags | |
269 tip 5:5f6e8655b1c7 | |
270 $ hg tags # again, try to expose cache bugs | |
271 tip 5:5f6e8655b1c7 | |
4213 | 272 |
11744 | 273 Remove nonexistent tag: |
274 | |
275 $ hg tag --remove foobar | |
276 abort: tag 'foobar' does not exist | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11744
diff
changeset
|
277 [255] |
11744 | 278 $ hg tip |
279 changeset: 5:5f6e8655b1c7 | |
280 tag: tip | |
281 user: test | |
282 date: Thu Jan 01 00:00:00 1970 +0000 | |
283 summary: Removed tag bar | |
284 | |
4266
fe7f38dda34b
tags: fix abababa case, with test case
Matt Mackall <mpm@selenic.com>
parents:
4213
diff
changeset
|
285 |
11744 | 286 Undo a tag with rollback: |
4651
7176f278d6f9
Test attempt to remove nonexistent tag
Brendan Cully <brendan@kublai.com>
parents:
4482
diff
changeset
|
287 |
11744 | 288 $ hg rollback # destroy rev 5 (restore bar) |
13446
1e497df514e2
rollback: clarifies the message about the reverted state (issue2628)
Gilles Moris <gilles.moris@free.fr>
parents:
13272
diff
changeset
|
289 repository tip rolled back to revision 4 (undo commit) |
1e497df514e2
rollback: clarifies the message about the reverted state (issue2628)
Gilles Moris <gilles.moris@free.fr>
parents:
13272
diff
changeset
|
290 working directory now based on revision 4 |
11744 | 291 $ hg tags |
292 tip 4:0c192d7d5e6b | |
293 bar 1:78391a272241 | |
294 $ hg tags | |
295 tip 4:0c192d7d5e6b | |
296 bar 1:78391a272241 | |
297 | |
298 Test tag rank: | |
9144
ad72e3b08bc0
test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents:
9143
diff
changeset
|
299 |
11744 | 300 $ cd .. |
301 $ hg init t3 | |
302 $ cd t3 | |
303 $ echo foo > foo | |
304 $ hg add foo | |
305 $ hg ci -m 'add foo' # rev 0 | |
306 $ hg tag -f bar # rev 1 bar -> 0 | |
307 $ hg tag -f bar # rev 2 bar -> 1 | |
308 $ hg tag -fr 0 bar # rev 3 bar -> 0 | |
309 $ hg tag -fr 1 bar # rev 4 bar -> 1 | |
310 $ hg tag -fr 0 bar # rev 5 bar -> 0 | |
311 $ hg tags | |
312 tip 5:85f05169d91d | |
313 bar 0:bbd179dfa0a7 | |
314 $ hg co 3 | |
315 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
316 $ echo barbar > foo | |
317 $ hg ci -m 'change foo' # rev 6 | |
318 created new head | |
319 $ hg tags | |
320 tip 6:735c3ca72986 | |
321 bar 0:bbd179dfa0a7 | |
4267
8185a1ca8628
tags: require -f to replace an existing tag
Matt Mackall <mpm@selenic.com>
parents:
4266
diff
changeset
|
322 |
11744 | 323 Don't allow moving tag without -f: |
324 | |
325 $ hg tag -r 3 bar | |
326 abort: tag 'bar' already exists (use -f to force) | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11744
diff
changeset
|
327 [255] |
11744 | 328 $ hg tags |
329 tip 6:735c3ca72986 | |
330 bar 0:bbd179dfa0a7 | |
331 | |
332 Strip 1: expose an old head: | |
4482
99f411ba0380
use .extend instead of .append in readtags
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4267
diff
changeset
|
333 |
11744 | 334 $ hg --config extensions.mq= strip 5 |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12376
diff
changeset
|
335 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob) |
11744 | 336 $ hg tags # partly stale cache |
337 tip 5:735c3ca72986 | |
338 bar 1:78391a272241 | |
339 $ hg tags # up-to-date cache | |
340 tip 5:735c3ca72986 | |
341 bar 1:78391a272241 | |
342 | |
343 Strip 2: destroy whole branch, no old head exposed | |
9144
ad72e3b08bc0
test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents:
9143
diff
changeset
|
344 |
11744 | 345 $ hg --config extensions.mq= strip 4 |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12376
diff
changeset
|
346 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob) |
11744 | 347 $ hg tags # partly stale |
348 tip 4:735c3ca72986 | |
349 bar 0:bbd179dfa0a7 | |
13272
5ccdca7df211
move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
jfh <jason@jasonfharris.com>
parents:
12763
diff
changeset
|
350 $ rm -f .hg/cache/tags |
11744 | 351 $ hg tags # cold cache |
352 tip 4:735c3ca72986 | |
353 bar 0:bbd179dfa0a7 | |
354 | |
355 Test tag rank with 3 heads: | |
5657
47915bf68c44
Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents:
5524
diff
changeset
|
356 |
11744 | 357 $ cd .. |
358 $ hg init t4 | |
359 $ cd t4 | |
360 $ echo foo > foo | |
361 $ hg add | |
362 adding foo | |
363 $ hg ci -m 'add foo' # rev 0 | |
364 $ hg tag bar # rev 1 bar -> 0 | |
365 $ hg tag -f bar # rev 2 bar -> 1 | |
366 $ hg up -qC 0 | |
367 $ hg tag -fr 2 bar # rev 3 bar -> 2 | |
368 $ hg tags | |
369 tip 3:197c21bbbf2c | |
370 bar 2:6fa450212aeb | |
371 $ hg up -qC 0 | |
372 $ hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2 | |
5657
47915bf68c44
Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents:
5524
diff
changeset
|
373 |
11744 | 374 Bar should still point to rev 2: |
375 | |
376 $ hg tags | |
377 tip 4:3b4b14ed0202 | |
378 bar 2:6fa450212aeb | |
379 | |
380 Test that removing global/local tags does not get confused when trying | |
381 to remove a tag of type X which actually only exists as a type Y: | |
5657
47915bf68c44
Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents:
5524
diff
changeset
|
382 |
11744 | 383 $ cd .. |
384 $ hg init t5 | |
385 $ cd t5 | |
386 $ echo foo > foo | |
387 $ hg add | |
388 adding foo | |
389 $ hg ci -m 'add foo' # rev 0 | |
5657
47915bf68c44
Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents:
5524
diff
changeset
|
390 |
11744 | 391 $ hg tag -r 0 -l localtag |
392 $ hg tag --remove localtag | |
393 abort: tag 'localtag' is not a global tag | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11744
diff
changeset
|
394 [255] |
11744 | 395 $ |
396 $ hg tag -r 0 globaltag | |
397 $ hg tag --remove -l globaltag | |
398 abort: tag 'globaltag' is not a local tag | |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
11744
diff
changeset
|
399 [255] |
11744 | 400 $ hg tags -v |
401 tip 1:a0b6fe111088 | |
402 localtag 0:bbd179dfa0a7 local | |
403 globaltag 0:bbd179dfa0a7 | |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16857
diff
changeset
|
404 |
19108
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
405 Test for issue3911 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
406 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
407 $ hg tag -r 0 -l localtag2 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
408 $ hg tag -l --remove localtag2 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
409 $ hg tags -v |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
410 tip 1:a0b6fe111088 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
411 localtag 0:bbd179dfa0a7 local |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
412 globaltag 0:bbd179dfa0a7 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
413 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
414 $ hg tag -r 1 -f localtag |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
415 $ hg tags -v |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
416 tip 2:5c70a037bb37 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
417 localtag 1:a0b6fe111088 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
418 globaltag 0:bbd179dfa0a7 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
419 |
19646
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
420 $ hg tags -v |
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
421 tip 2:5c70a037bb37 |
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
422 localtag 1:a0b6fe111088 |
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
423 globaltag 0:bbd179dfa0a7 |
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
424 |
19108
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
425 $ hg tag -r 1 localtag2 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
426 $ hg tags -v |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
427 tip 3:bbfb8cd42be2 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
428 localtag2 1:a0b6fe111088 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
429 localtag 1:a0b6fe111088 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
430 globaltag 0:bbd179dfa0a7 |
cb95716da5fe
tags: update tag type only if tag node is updated (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
17345
diff
changeset
|
431 |
19646
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
432 $ hg tags -v |
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
433 tip 3:bbfb8cd42be2 |
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
434 localtag2 1:a0b6fe111088 |
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
435 localtag 1:a0b6fe111088 |
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
436 globaltag 0:bbd179dfa0a7 |
335a558f81dc
tags: write tag overwriting history also into tag cache file (issue3911)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19108
diff
changeset
|
437 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16857
diff
changeset
|
438 $ cd .. |