##// END OF EJS Templates
tests: fix up whitespace complaint
Matt Mackall -
r24802:2ee10789 default
parent child Browse files
Show More
@@ -1,622 +1,622 b''
1 setup
1 setup
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > blackbox=
5 > blackbox=
6 > mock=$TESTDIR/mockblackbox.py
6 > mock=$TESTDIR/mockblackbox.py
7 > EOF
7 > EOF
8
8
9 Helper functions:
9 Helper functions:
10
10
11 $ cacheexists() {
11 $ cacheexists() {
12 > [ -f .hg/cache/tags2-visible ] && echo "tag cache exists" || echo "no tag cache"
12 > [ -f .hg/cache/tags2-visible ] && echo "tag cache exists" || echo "no tag cache"
13 > }
13 > }
14
14
15 $ fnodescacheexists() {
15 $ fnodescacheexists() {
16 > [ -f .hg/cache/hgtagsfnodes1 ] && echo "fnodes cache exists" || echo "no fnodes cache"
16 > [ -f .hg/cache/hgtagsfnodes1 ] && echo "fnodes cache exists" || echo "no fnodes cache"
17 > }
17 > }
18
18
19 $ dumptags() {
19 $ dumptags() {
20 > rev=$1
20 > rev=$1
21 > echo "rev $rev: .hgtags:"
21 > echo "rev $rev: .hgtags:"
22 > hg cat -r$rev .hgtags
22 > hg cat -r$rev .hgtags
23 > }
23 > }
24
24
25 # XXX need to test that the tag cache works when we strip an old head
25 # XXX need to test that the tag cache works when we strip an old head
26 # and add a new one rooted off non-tip: i.e. node and rev of tip are the
26 # and add a new one rooted off non-tip: i.e. node and rev of tip are the
27 # same, but stuff has changed behind tip.
27 # same, but stuff has changed behind tip.
28
28
29 Setup:
29 Setup:
30
30
31 $ hg init t
31 $ hg init t
32 $ cd t
32 $ cd t
33 $ cacheexists
33 $ cacheexists
34 no tag cache
34 no tag cache
35 $ fnodescacheexists
35 $ fnodescacheexists
36 no fnodes cache
36 no fnodes cache
37 $ hg id
37 $ hg id
38 000000000000 tip
38 000000000000 tip
39 $ cacheexists
39 $ cacheexists
40 no tag cache
40 no tag cache
41 $ fnodescacheexists
41 $ fnodescacheexists
42 no fnodes cache
42 no fnodes cache
43 $ echo a > a
43 $ echo a > a
44 $ hg add a
44 $ hg add a
45 $ hg commit -m "test"
45 $ hg commit -m "test"
46 $ hg co
46 $ hg co
47 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 $ hg identify
48 $ hg identify
49 acb14030fe0a tip
49 acb14030fe0a tip
50 $ cacheexists
50 $ cacheexists
51 tag cache exists
51 tag cache exists
52 No fnodes cache because .hgtags file doesn't exist
52 No fnodes cache because .hgtags file doesn't exist
53 (this is an implementation detail)
53 (this is an implementation detail)
54 $ fnodescacheexists
54 $ fnodescacheexists
55 no fnodes cache
55 no fnodes cache
56
56
57 Try corrupting the cache
57 Try corrupting the cache
58
58
59 $ printf 'a b' > .hg/cache/tags2-visible
59 $ printf 'a b' > .hg/cache/tags2-visible
60 $ hg identify
60 $ hg identify
61 acb14030fe0a tip
61 acb14030fe0a tip
62 $ cacheexists
62 $ cacheexists
63 tag cache exists
63 tag cache exists
64 $ fnodescacheexists
64 $ fnodescacheexists
65 no fnodes cache
65 no fnodes cache
66 $ hg identify
66 $ hg identify
67 acb14030fe0a tip
67 acb14030fe0a tip
68
68
69 Create local tag with long name:
69 Create local tag with long name:
70
70
71 $ T=`hg identify --debug --id`
71 $ T=`hg identify --debug --id`
72 $ hg tag -l "This is a local tag with a really long name!"
72 $ hg tag -l "This is a local tag with a really long name!"
73 $ hg tags
73 $ hg tags
74 tip 0:acb14030fe0a
74 tip 0:acb14030fe0a
75 This is a local tag with a really long name! 0:acb14030fe0a
75 This is a local tag with a really long name! 0:acb14030fe0a
76 $ rm .hg/localtags
76 $ rm .hg/localtags
77
77
78 Create a tag behind hg's back:
78 Create a tag behind hg's back:
79
79
80 $ echo "$T first" > .hgtags
80 $ echo "$T first" > .hgtags
81 $ cat .hgtags
81 $ cat .hgtags
82 acb14030fe0a21b60322c440ad2d20cf7685a376 first
82 acb14030fe0a21b60322c440ad2d20cf7685a376 first
83 $ hg add .hgtags
83 $ hg add .hgtags
84 $ hg commit -m "add tags"
84 $ hg commit -m "add tags"
85 $ hg tags
85 $ hg tags
86 tip 1:b9154636be93
86 tip 1:b9154636be93
87 first 0:acb14030fe0a
87 first 0:acb14030fe0a
88 $ hg identify
88 $ hg identify
89 b9154636be93 tip
89 b9154636be93 tip
90
90
91 We should have a fnodes cache now that we have a real tag
91 We should have a fnodes cache now that we have a real tag
92 The cache should have an empty entry for rev 0 and a valid entry for rev 1.
92 The cache should have an empty entry for rev 0 and a valid entry for rev 1.
93
93
94
94
95 $ fnodescacheexists
95 $ fnodescacheexists
96 fnodes cache exists
96 fnodes cache exists
97 $ f --size --hexdump .hg/cache/hgtagsfnodes1
97 $ f --size --hexdump .hg/cache/hgtagsfnodes1
98 .hg/cache/hgtagsfnodes1: size=48
98 .hg/cache/hgtagsfnodes1: size=48
99 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
99 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
100 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
100 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
101 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
101 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
102
102
103 Repeat with cold tag cache:
103 Repeat with cold tag cache:
104
104
105 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
105 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
106 $ hg identify
106 $ hg identify
107 b9154636be93 tip
107 b9154636be93 tip
108
108
109 $ fnodescacheexists
109 $ fnodescacheexists
110 fnodes cache exists
110 fnodes cache exists
111 $ f --size --hexdump .hg/cache/hgtagsfnodes1
111 $ f --size --hexdump .hg/cache/hgtagsfnodes1
112 .hg/cache/hgtagsfnodes1: size=48
112 .hg/cache/hgtagsfnodes1: size=48
113 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
113 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
114 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
114 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
115 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
115 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
116
116
117 And again, but now unable to write tag cache:
117 And again, but now unable to write tag cache:
118
118
119 #if unix-permissions
119 #if unix-permissions
120 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
120 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
121 $ chmod 555 .hg/cache
121 $ chmod 555 .hg/cache
122 $ hg identify
122 $ hg identify
123 b9154636be93 tip
123 b9154636be93 tip
124 $ chmod 755 .hg/cache
124 $ chmod 755 .hg/cache
125 #endif
125 #endif
126
126
127 Tag cache debug info written to blackbox log
127 Tag cache debug info written to blackbox log
128
128
129 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
129 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
130 $ hg identify
130 $ hg identify
131 b9154636be93 tip
131 b9154636be93 tip
132 $ hg blackbox -l 5
132 $ hg blackbox -l 5
133 1970/01/01 00:00:00 bob> identify
133 1970/01/01 00:00:00 bob> identify
134 1970/01/01 00:00:00 bob> writing 48 bytes to cache/hgtagsfnodes1
134 1970/01/01 00:00:00 bob> writing 48 bytes to cache/hgtagsfnodes1
135 1970/01/01 00:00:00 bob> 0/1 cache hits/lookups in * seconds (glob)
135 1970/01/01 00:00:00 bob> 0/1 cache hits/lookups in * seconds (glob)
136 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
136 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
137 1970/01/01 00:00:00 bob> identify exited 0 after ?.?? seconds (glob)
137 1970/01/01 00:00:00 bob> identify exited 0 after ?.?? seconds (glob)
138
138
139 Failure to acquire lock results in no write
139 Failure to acquire lock results in no write
140
140
141 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
141 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
142 $ echo 'foo:1' > .hg/wlock
142 $ echo 'foo:1' > .hg/wlock
143 $ hg identify
143 $ hg identify
144 b9154636be93 tip
144 b9154636be93 tip
145 $ hg blackbox -l 5
145 $ hg blackbox -l 5
146 1970/01/01 00:00:00 bob> identify
146 1970/01/01 00:00:00 bob> identify
147 1970/01/01 00:00:00 bob> not writing .hg/cache/hgtagsfnodes1 because lock held
147 1970/01/01 00:00:00 bob> not writing .hg/cache/hgtagsfnodes1 because lock held
148 1970/01/01 00:00:00 bob> 0/1 cache hits/lookups in * seconds (glob)
148 1970/01/01 00:00:00 bob> 0/1 cache hits/lookups in * seconds (glob)
149 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
149 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
150 1970/01/01 00:00:00 bob> identify exited 0 after * seconds (glob)
150 1970/01/01 00:00:00 bob> identify exited 0 after * seconds (glob)
151
151
152 $ fnodescacheexists
152 $ fnodescacheexists
153 no fnodes cache
153 no fnodes cache
154
154
155 $ rm .hg/wlock
155 $ rm .hg/wlock
156
156
157 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
157 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
158 $ hg identify
158 $ hg identify
159 b9154636be93 tip
159 b9154636be93 tip
160
160
161 Create a branch:
161 Create a branch:
162
162
163 $ echo bb > a
163 $ echo bb > a
164 $ hg status
164 $ hg status
165 M a
165 M a
166 $ hg identify
166 $ hg identify
167 b9154636be93+ tip
167 b9154636be93+ tip
168 $ hg co first
168 $ hg co first
169 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
169 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
170 $ hg id
170 $ hg id
171 acb14030fe0a+ first
171 acb14030fe0a+ first
172 $ hg -v id
172 $ hg -v id
173 acb14030fe0a+ first
173 acb14030fe0a+ first
174 $ hg status
174 $ hg status
175 M a
175 M a
176 $ echo 1 > b
176 $ echo 1 > b
177 $ hg add b
177 $ hg add b
178 $ hg commit -m "branch"
178 $ hg commit -m "branch"
179 created new head
179 created new head
180
180
181 Creating a new commit shouldn't append the .hgtags fnodes cache until
181 Creating a new commit shouldn't append the .hgtags fnodes cache until
182 tags info is accessed
182 tags info is accessed
183
183
184 $ f --size --hexdump .hg/cache/hgtagsfnodes1
184 $ f --size --hexdump .hg/cache/hgtagsfnodes1
185 .hg/cache/hgtagsfnodes1: size=48
185 .hg/cache/hgtagsfnodes1: size=48
186 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
186 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
187 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
187 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
188 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
188 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
189
189
190 $ hg id
190 $ hg id
191 c8edf04160c7 tip
191 c8edf04160c7 tip
192
192
193 First 4 bytes of record 3 are changeset fragment
193 First 4 bytes of record 3 are changeset fragment
194
194
195 $ f --size --hexdump .hg/cache/hgtagsfnodes1
195 $ f --size --hexdump .hg/cache/hgtagsfnodes1
196 .hg/cache/hgtagsfnodes1: size=72
196 .hg/cache/hgtagsfnodes1: size=72
197 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
197 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
198 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
198 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
199 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
199 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
200 0030: c8 ed f0 41 00 00 00 00 00 00 00 00 00 00 00 00 |...A............|
200 0030: c8 ed f0 41 00 00 00 00 00 00 00 00 00 00 00 00 |...A............|
201 0040: 00 00 00 00 00 00 00 00 |........|
201 0040: 00 00 00 00 00 00 00 00 |........|
202
202
203 Merge the two heads:
203 Merge the two heads:
204
204
205 $ hg merge 1
205 $ hg merge 1
206 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
206 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
207 (branch merge, don't forget to commit)
207 (branch merge, don't forget to commit)
208 $ hg id
208 $ hg id
209 c8edf04160c7+b9154636be93+ tip
209 c8edf04160c7+b9154636be93+ tip
210 $ hg status
210 $ hg status
211 M .hgtags
211 M .hgtags
212 $ hg commit -m "merge"
212 $ hg commit -m "merge"
213
213
214 Create a fake head, make sure tag not visible afterwards:
214 Create a fake head, make sure tag not visible afterwards:
215
215
216 $ cp .hgtags tags
216 $ cp .hgtags tags
217 $ hg tag last
217 $ hg tag last
218 $ hg rm .hgtags
218 $ hg rm .hgtags
219 $ hg commit -m "remove"
219 $ hg commit -m "remove"
220
220
221 $ mv tags .hgtags
221 $ mv tags .hgtags
222 $ hg add .hgtags
222 $ hg add .hgtags
223 $ hg commit -m "readd"
223 $ hg commit -m "readd"
224 $
224 $
225 $ hg tags
225 $ hg tags
226 tip 6:35ff301afafe
226 tip 6:35ff301afafe
227 first 0:acb14030fe0a
227 first 0:acb14030fe0a
228
228
229 Add invalid tags:
229 Add invalid tags:
230
230
231 $ echo "spam" >> .hgtags
231 $ echo "spam" >> .hgtags
232 $ echo >> .hgtags
232 $ echo >> .hgtags
233 $ echo "foo bar" >> .hgtags
233 $ echo "foo bar" >> .hgtags
234 $ echo "a5a5 invalid" >> .hg/localtags
234 $ echo "a5a5 invalid" >> .hg/localtags
235 $ cat .hgtags
235 $ cat .hgtags
236 acb14030fe0a21b60322c440ad2d20cf7685a376 first
236 acb14030fe0a21b60322c440ad2d20cf7685a376 first
237 spam
237 spam
238
238
239 foo bar
239 foo bar
240 $ hg commit -m "tags"
240 $ hg commit -m "tags"
241
241
242 Report tag parse error on other head:
242 Report tag parse error on other head:
243
243
244 $ hg up 3
244 $ hg up 3
245 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
245 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
246 $ echo 'x y' >> .hgtags
246 $ echo 'x y' >> .hgtags
247 $ hg commit -m "head"
247 $ hg commit -m "head"
248 created new head
248 created new head
249
249
250 $ hg tags
250 $ hg tags
251 .hgtags@75d9f02dfe28, line 2: cannot parse entry
251 .hgtags@75d9f02dfe28, line 2: cannot parse entry
252 .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed
252 .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed
253 .hgtags@c4be69a18c11, line 2: node 'x' is not well formed
253 .hgtags@c4be69a18c11, line 2: node 'x' is not well formed
254 tip 8:c4be69a18c11
254 tip 8:c4be69a18c11
255 first 0:acb14030fe0a
255 first 0:acb14030fe0a
256 $ hg tip
256 $ hg tip
257 changeset: 8:c4be69a18c11
257 changeset: 8:c4be69a18c11
258 tag: tip
258 tag: tip
259 parent: 3:ac5e980c4dc0
259 parent: 3:ac5e980c4dc0
260 user: test
260 user: test
261 date: Thu Jan 01 00:00:00 1970 +0000
261 date: Thu Jan 01 00:00:00 1970 +0000
262 summary: head
262 summary: head
263
263
264
264
265 Test tag precedence rules:
265 Test tag precedence rules:
266
266
267 $ cd ..
267 $ cd ..
268 $ hg init t2
268 $ hg init t2
269 $ cd t2
269 $ cd t2
270 $ echo foo > foo
270 $ echo foo > foo
271 $ hg add foo
271 $ hg add foo
272 $ hg ci -m 'add foo' # rev 0
272 $ hg ci -m 'add foo' # rev 0
273 $ hg tag bar # rev 1
273 $ hg tag bar # rev 1
274 $ echo >> foo
274 $ echo >> foo
275 $ hg ci -m 'change foo 1' # rev 2
275 $ hg ci -m 'change foo 1' # rev 2
276 $ hg up -C 1
276 $ hg up -C 1
277 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
278 $ hg tag -r 1 -f bar # rev 3
278 $ hg tag -r 1 -f bar # rev 3
279 $ hg up -C 1
279 $ hg up -C 1
280 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
280 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
281 $ echo >> foo
281 $ echo >> foo
282 $ hg ci -m 'change foo 2' # rev 4
282 $ hg ci -m 'change foo 2' # rev 4
283 created new head
283 created new head
284 $ hg tags
284 $ hg tags
285 tip 4:0c192d7d5e6b
285 tip 4:0c192d7d5e6b
286 bar 1:78391a272241
286 bar 1:78391a272241
287
287
288 Repeat in case of cache effects:
288 Repeat in case of cache effects:
289
289
290 $ hg tags
290 $ hg tags
291 tip 4:0c192d7d5e6b
291 tip 4:0c192d7d5e6b
292 bar 1:78391a272241
292 bar 1:78391a272241
293
293
294 Detailed dump of tag info:
294 Detailed dump of tag info:
295
295
296 $ hg heads -q # expect 4, 3, 2
296 $ hg heads -q # expect 4, 3, 2
297 4:0c192d7d5e6b
297 4:0c192d7d5e6b
298 3:6fa450212aeb
298 3:6fa450212aeb
299 2:7a94127795a3
299 2:7a94127795a3
300 $ dumptags 2
300 $ dumptags 2
301 rev 2: .hgtags:
301 rev 2: .hgtags:
302 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
302 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
303 $ dumptags 3
303 $ dumptags 3
304 rev 3: .hgtags:
304 rev 3: .hgtags:
305 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
305 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
306 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
306 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
307 78391a272241d70354aa14c874552cad6b51bb42 bar
307 78391a272241d70354aa14c874552cad6b51bb42 bar
308 $ dumptags 4
308 $ dumptags 4
309 rev 4: .hgtags:
309 rev 4: .hgtags:
310 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
310 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
311
311
312 Dump cache:
312 Dump cache:
313
313
314 $ cat .hg/cache/tags2-visible
314 $ cat .hg/cache/tags2-visible
315 4 0c192d7d5e6b78a714de54a2e9627952a877e25a
315 4 0c192d7d5e6b78a714de54a2e9627952a877e25a
316 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
316 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
317 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
317 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
318 78391a272241d70354aa14c874552cad6b51bb42 bar
318 78391a272241d70354aa14c874552cad6b51bb42 bar
319
319
320 $ f --size --hexdump .hg/cache/hgtagsfnodes1
320 $ f --size --hexdump .hg/cache/hgtagsfnodes1
321 .hg/cache/hgtagsfnodes1: size=120
321 .hg/cache/hgtagsfnodes1: size=120
322 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
322 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
323 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
323 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
324 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
324 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
325 0030: 7a 94 12 77 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |z..w.....1....B(|
325 0030: 7a 94 12 77 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |z..w.....1....B(|
326 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.|
326 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.|
327 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..|
327 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..|
328 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(|
328 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(|
329 0070: 78 ee 5a 2d ad bc 94 3d |x.Z-...=|
329 0070: 78 ee 5a 2d ad bc 94 3d |x.Z-...=|
330
330
331 Corrupt the .hgtags fnodes cache
331 Corrupt the .hgtags fnodes cache
332 Extra junk data at the end should get overwritten on next cache update
332 Extra junk data at the end should get overwritten on next cache update
333
333
334 $ echo extra >> .hg/cache/hgtagsfnodes1
334 $ echo extra >> .hg/cache/hgtagsfnodes1
335 $ echo dummy1 > foo
335 $ echo dummy1 > foo
336 $ hg commit -m throwaway1
336 $ hg commit -m throwaway1
337
337
338 $ hg tags
338 $ hg tags
339 tip 5:8dbfe60eff30
339 tip 5:8dbfe60eff30
340 bar 1:78391a272241
340 bar 1:78391a272241
341
341
342 $ hg blackbox -l 5
342 $ hg blackbox -l 5
343 1970/01/01 00:00:00 bob> tags
343 1970/01/01 00:00:00 bob> tags
344 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1
344 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1
345 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
345 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
346 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
346 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
347 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
347 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
348
348
349 #if unix-permissions no-root
349 #if unix-permissions no-root
350 Errors writing to .hgtags fnodes cache are silently ignored
350 Errors writing to .hgtags fnodes cache are silently ignored
351
351
352 $ echo dummy2 > foo
352 $ echo dummy2 > foo
353 $ hg commit -m throwaway2
353 $ hg commit -m throwaway2
354
354
355 $ chmod a-w .hg/cache/hgtagsfnodes1
355 $ chmod a-w .hg/cache/hgtagsfnodes1
356 $ rm -f .hg/cache/tags2-visible
356 $ rm -f .hg/cache/tags2-visible
357
357
358 $ hg tags
358 $ hg tags
359 tip 6:b968051b5cf3
359 tip 6:b968051b5cf3
360 bar 1:78391a272241
360 bar 1:78391a272241
361
361
362 $ hg blackbox -l 5
362 $ hg blackbox -l 5
363 1970/01/01 00:00:00 bob> tags
363 1970/01/01 00:00:00 bob> tags
364 1970/01/01 00:00:00 bob> couldn't write cache/hgtagsfnodes1: [Errno 13] Permission denied: '$TESTTMP/t2/.hg/cache/hgtagsfnodes1'
364 1970/01/01 00:00:00 bob> couldn't write cache/hgtagsfnodes1: [Errno 13] Permission denied: '$TESTTMP/t2/.hg/cache/hgtagsfnodes1'
365 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
365 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
366 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
366 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
367 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
367 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
368
368
369 $ chmod a+w .hg/cache/hgtagsfnodes1
369 $ chmod a+w .hg/cache/hgtagsfnodes1
370
370
371 $ rm -f .hg/cache/tags2-visible
371 $ rm -f .hg/cache/tags2-visible
372 $ hg tags
372 $ hg tags
373 tip 6:b968051b5cf3
373 tip 6:b968051b5cf3
374 bar 1:78391a272241
374 bar 1:78391a272241
375
375
376 $ hg blackbox -l 5
376 $ hg blackbox -l 5
377 1970/01/01 00:00:00 bob> tags
377 1970/01/01 00:00:00 bob> tags
378 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1
378 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1
379 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
379 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
380 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
380 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
381 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
381 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
382
382
383 $ f --size .hg/cache/hgtagsfnodes1
383 $ f --size .hg/cache/hgtagsfnodes1
384 .hg/cache/hgtagsfnodes1: size=168
384 .hg/cache/hgtagsfnodes1: size=168
385
385
386 $ hg -q --config extensions.strip= strip -r 6 --no-backup
386 $ hg -q --config extensions.strip= strip -r 6 --no-backup
387 #endif
387 #endif
388
388
389 Stripping doesn't truncate the tags cache until new data is available
389 Stripping doesn't truncate the tags cache until new data is available
390
390
391 $ rm -f .hg/cache/hgtagsfnodes1 .hg/cache/tags2-visible
391 $ rm -f .hg/cache/hgtagsfnodes1 .hg/cache/tags2-visible
392 $ hg tags
392 $ hg tags
393 tip 5:8dbfe60eff30
393 tip 5:8dbfe60eff30
394 bar 1:78391a272241
394 bar 1:78391a272241
395
395
396 $ f --size .hg/cache/hgtagsfnodes1
396 $ f --size .hg/cache/hgtagsfnodes1
397 .hg/cache/hgtagsfnodes1: size=144
397 .hg/cache/hgtagsfnodes1: size=144
398
398
399 $ hg -q --config extensions.strip= strip -r 5 --no-backup
399 $ hg -q --config extensions.strip= strip -r 5 --no-backup
400 $ hg tags
400 $ hg tags
401 tip 4:0c192d7d5e6b
401 tip 4:0c192d7d5e6b
402 bar 1:78391a272241
402 bar 1:78391a272241
403
403
404 $ hg blackbox -l 4
404 $ hg blackbox -l 4
405 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1
405 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1
406 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
406 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
407 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
407 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
408 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
408 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
409
409
410 $ f --size .hg/cache/hgtagsfnodes1
410 $ f --size .hg/cache/hgtagsfnodes1
411 .hg/cache/hgtagsfnodes1: size=120
411 .hg/cache/hgtagsfnodes1: size=120
412
412
413 $ echo dummy > foo
413 $ echo dummy > foo
414 $ hg commit -m throwaway3
414 $ hg commit -m throwaway3
415
415
416 $ hg tags
416 $ hg tags
417 tip 5:035f65efb448
417 tip 5:035f65efb448
418 bar 1:78391a272241
418 bar 1:78391a272241
419
419
420 $ hg blackbox -l 5
420 $ hg blackbox -l 5
421 1970/01/01 00:00:00 bob> tags
421 1970/01/01 00:00:00 bob> tags
422 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1
422 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1
423 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
423 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob)
424 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
424 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
425 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
425 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob)
426 $ f --size .hg/cache/hgtagsfnodes1
426 $ f --size .hg/cache/hgtagsfnodes1
427 .hg/cache/hgtagsfnodes1: size=144
427 .hg/cache/hgtagsfnodes1: size=144
428
428
429 $ hg -q --config extensions.strip= strip -r 5 --no-backup
429 $ hg -q --config extensions.strip= strip -r 5 --no-backup
430
430
431 Test tag removal:
431 Test tag removal:
432
432
433 $ hg tag --remove bar # rev 5
433 $ hg tag --remove bar # rev 5
434 $ hg tip -vp
434 $ hg tip -vp
435 changeset: 5:5f6e8655b1c7
435 changeset: 5:5f6e8655b1c7
436 tag: tip
436 tag: tip
437 user: test
437 user: test
438 date: Thu Jan 01 00:00:00 1970 +0000
438 date: Thu Jan 01 00:00:00 1970 +0000
439 files: .hgtags
439 files: .hgtags
440 description:
440 description:
441 Removed tag bar
441 Removed tag bar
442
442
443
443
444 diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags
444 diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags
445 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000
445 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000
446 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
446 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
447 @@ -1,1 +1,3 @@
447 @@ -1,1 +1,3 @@
448 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
448 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
449 +78391a272241d70354aa14c874552cad6b51bb42 bar
449 +78391a272241d70354aa14c874552cad6b51bb42 bar
450 +0000000000000000000000000000000000000000 bar
450 +0000000000000000000000000000000000000000 bar
451
451
452 $ hg tags
452 $ hg tags
453 tip 5:5f6e8655b1c7
453 tip 5:5f6e8655b1c7
454 $ hg tags # again, try to expose cache bugs
454 $ hg tags # again, try to expose cache bugs
455 tip 5:5f6e8655b1c7
455 tip 5:5f6e8655b1c7
456
456
457 Remove nonexistent tag:
457 Remove nonexistent tag:
458
458
459 $ hg tag --remove foobar
459 $ hg tag --remove foobar
460 abort: tag 'foobar' does not exist
460 abort: tag 'foobar' does not exist
461 [255]
461 [255]
462 $ hg tip
462 $ hg tip
463 changeset: 5:5f6e8655b1c7
463 changeset: 5:5f6e8655b1c7
464 tag: tip
464 tag: tip
465 user: test
465 user: test
466 date: Thu Jan 01 00:00:00 1970 +0000
466 date: Thu Jan 01 00:00:00 1970 +0000
467 summary: Removed tag bar
467 summary: Removed tag bar
468
468
469
469
470 Undo a tag with rollback:
470 Undo a tag with rollback:
471
471
472 $ hg rollback # destroy rev 5 (restore bar)
472 $ hg rollback # destroy rev 5 (restore bar)
473 repository tip rolled back to revision 4 (undo commit)
473 repository tip rolled back to revision 4 (undo commit)
474 working directory now based on revision 4
474 working directory now based on revision 4
475 $ hg tags
475 $ hg tags
476 tip 4:0c192d7d5e6b
476 tip 4:0c192d7d5e6b
477 bar 1:78391a272241
477 bar 1:78391a272241
478 $ hg tags
478 $ hg tags
479 tip 4:0c192d7d5e6b
479 tip 4:0c192d7d5e6b
480 bar 1:78391a272241
480 bar 1:78391a272241
481
481
482 Test tag rank:
482 Test tag rank:
483
483
484 $ cd ..
484 $ cd ..
485 $ hg init t3
485 $ hg init t3
486 $ cd t3
486 $ cd t3
487 $ echo foo > foo
487 $ echo foo > foo
488 $ hg add foo
488 $ hg add foo
489 $ hg ci -m 'add foo' # rev 0
489 $ hg ci -m 'add foo' # rev 0
490 $ hg tag -f bar # rev 1 bar -> 0
490 $ hg tag -f bar # rev 1 bar -> 0
491 $ hg tag -f bar # rev 2 bar -> 1
491 $ hg tag -f bar # rev 2 bar -> 1
492 $ hg tag -fr 0 bar # rev 3 bar -> 0
492 $ hg tag -fr 0 bar # rev 3 bar -> 0
493 $ hg tag -fr 1 bar # rev 4 bar -> 1
493 $ hg tag -fr 1 bar # rev 4 bar -> 1
494 $ hg tag -fr 0 bar # rev 5 bar -> 0
494 $ hg tag -fr 0 bar # rev 5 bar -> 0
495 $ hg tags
495 $ hg tags
496 tip 5:85f05169d91d
496 tip 5:85f05169d91d
497 bar 0:bbd179dfa0a7
497 bar 0:bbd179dfa0a7
498 $ hg co 3
498 $ hg co 3
499 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
499 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
500 $ echo barbar > foo
500 $ echo barbar > foo
501 $ hg ci -m 'change foo' # rev 6
501 $ hg ci -m 'change foo' # rev 6
502 created new head
502 created new head
503 $ hg tags
503 $ hg tags
504 tip 6:735c3ca72986
504 tip 6:735c3ca72986
505 bar 0:bbd179dfa0a7
505 bar 0:bbd179dfa0a7
506
506
507 Don't allow moving tag without -f:
507 Don't allow moving tag without -f:
508
508
509 $ hg tag -r 3 bar
509 $ hg tag -r 3 bar
510 abort: tag 'bar' already exists (use -f to force)
510 abort: tag 'bar' already exists (use -f to force)
511 [255]
511 [255]
512 $ hg tags
512 $ hg tags
513 tip 6:735c3ca72986
513 tip 6:735c3ca72986
514 bar 0:bbd179dfa0a7
514 bar 0:bbd179dfa0a7
515
515
516 Strip 1: expose an old head:
516 Strip 1: expose an old head:
517
517
518 $ hg --config extensions.mq= strip 5
518 $ hg --config extensions.mq= strip 5
519 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
519 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
520 $ hg tags # partly stale cache
520 $ hg tags # partly stale cache
521 tip 5:735c3ca72986
521 tip 5:735c3ca72986
522 bar 1:78391a272241
522 bar 1:78391a272241
523 $ hg tags # up-to-date cache
523 $ hg tags # up-to-date cache
524 tip 5:735c3ca72986
524 tip 5:735c3ca72986
525 bar 1:78391a272241
525 bar 1:78391a272241
526
526
527 Strip 2: destroy whole branch, no old head exposed
527 Strip 2: destroy whole branch, no old head exposed
528
528
529 $ hg --config extensions.mq= strip 4
529 $ hg --config extensions.mq= strip 4
530 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
530 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
531 $ hg tags # partly stale
531 $ hg tags # partly stale
532 tip 4:735c3ca72986
532 tip 4:735c3ca72986
533 bar 0:bbd179dfa0a7
533 bar 0:bbd179dfa0a7
534 $ rm -f .hg/cache/tags2-visible
534 $ rm -f .hg/cache/tags2-visible
535 $ hg tags # cold cache
535 $ hg tags # cold cache
536 tip 4:735c3ca72986
536 tip 4:735c3ca72986
537 bar 0:bbd179dfa0a7
537 bar 0:bbd179dfa0a7
538
538
539 Test tag rank with 3 heads:
539 Test tag rank with 3 heads:
540
540
541 $ cd ..
541 $ cd ..
542 $ hg init t4
542 $ hg init t4
543 $ cd t4
543 $ cd t4
544 $ echo foo > foo
544 $ echo foo > foo
545 $ hg add
545 $ hg add
546 adding foo
546 adding foo
547 $ hg ci -m 'add foo' # rev 0
547 $ hg ci -m 'add foo' # rev 0
548 $ hg tag bar # rev 1 bar -> 0
548 $ hg tag bar # rev 1 bar -> 0
549 $ hg tag -f bar # rev 2 bar -> 1
549 $ hg tag -f bar # rev 2 bar -> 1
550 $ hg up -qC 0
550 $ hg up -qC 0
551 $ hg tag -fr 2 bar # rev 3 bar -> 2
551 $ hg tag -fr 2 bar # rev 3 bar -> 2
552 $ hg tags
552 $ hg tags
553 tip 3:197c21bbbf2c
553 tip 3:197c21bbbf2c
554 bar 2:6fa450212aeb
554 bar 2:6fa450212aeb
555 $ hg up -qC 0
555 $ hg up -qC 0
556 $ hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2
556 $ hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2
557
557
558 Bar should still point to rev 2:
558 Bar should still point to rev 2:
559
559
560 $ hg tags
560 $ hg tags
561 tip 4:3b4b14ed0202
561 tip 4:3b4b14ed0202
562 bar 2:6fa450212aeb
562 bar 2:6fa450212aeb
563
563
564 Test that removing global/local tags does not get confused when trying
564 Test that removing global/local tags does not get confused when trying
565 to remove a tag of type X which actually only exists as a type Y:
565 to remove a tag of type X which actually only exists as a type Y:
566
566
567 $ cd ..
567 $ cd ..
568 $ hg init t5
568 $ hg init t5
569 $ cd t5
569 $ cd t5
570 $ echo foo > foo
570 $ echo foo > foo
571 $ hg add
571 $ hg add
572 adding foo
572 adding foo
573 $ hg ci -m 'add foo' # rev 0
573 $ hg ci -m 'add foo' # rev 0
574
574
575 $ hg tag -r 0 -l localtag
575 $ hg tag -r 0 -l localtag
576 $ hg tag --remove localtag
576 $ hg tag --remove localtag
577 abort: tag 'localtag' is not a global tag
577 abort: tag 'localtag' is not a global tag
578 [255]
578 [255]
579 $
579 $
580 $ hg tag -r 0 globaltag
580 $ hg tag -r 0 globaltag
581 $ hg tag --remove -l globaltag
581 $ hg tag --remove -l globaltag
582 abort: tag 'globaltag' is not a local tag
582 abort: tag 'globaltag' is not a local tag
583 [255]
583 [255]
584 $ hg tags -v
584 $ hg tags -v
585 tip 1:a0b6fe111088
585 tip 1:a0b6fe111088
586 localtag 0:bbd179dfa0a7 local
586 localtag 0:bbd179dfa0a7 local
587 globaltag 0:bbd179dfa0a7
587 globaltag 0:bbd179dfa0a7
588
588
589 Test for issue3911
589 Test for issue3911
590
590
591 $ hg tag -r 0 -l localtag2
591 $ hg tag -r 0 -l localtag2
592 $ hg tag -l --remove localtag2
592 $ hg tag -l --remove localtag2
593 $ hg tags -v
593 $ hg tags -v
594 tip 1:a0b6fe111088
594 tip 1:a0b6fe111088
595 localtag 0:bbd179dfa0a7 local
595 localtag 0:bbd179dfa0a7 local
596 globaltag 0:bbd179dfa0a7
596 globaltag 0:bbd179dfa0a7
597
597
598 $ hg tag -r 1 -f localtag
598 $ hg tag -r 1 -f localtag
599 $ hg tags -v
599 $ hg tags -v
600 tip 2:5c70a037bb37
600 tip 2:5c70a037bb37
601 localtag 1:a0b6fe111088
601 localtag 1:a0b6fe111088
602 globaltag 0:bbd179dfa0a7
602 globaltag 0:bbd179dfa0a7
603
603
604 $ hg tags -v
604 $ hg tags -v
605 tip 2:5c70a037bb37
605 tip 2:5c70a037bb37
606 localtag 1:a0b6fe111088
606 localtag 1:a0b6fe111088
607 globaltag 0:bbd179dfa0a7
607 globaltag 0:bbd179dfa0a7
608
608
609 $ hg tag -r 1 localtag2
609 $ hg tag -r 1 localtag2
610 $ hg tags -v
610 $ hg tags -v
611 tip 3:bbfb8cd42be2
611 tip 3:bbfb8cd42be2
612 localtag2 1:a0b6fe111088
612 localtag2 1:a0b6fe111088
613 localtag 1:a0b6fe111088
613 localtag 1:a0b6fe111088
614 globaltag 0:bbd179dfa0a7
614 globaltag 0:bbd179dfa0a7
615
615
616 $ hg tags -v
616 $ hg tags -v
617 tip 3:bbfb8cd42be2
617 tip 3:bbfb8cd42be2
618 localtag2 1:a0b6fe111088
618 localtag2 1:a0b6fe111088
619 localtag 1:a0b6fe111088
619 localtag 1:a0b6fe111088
620 globaltag 0:bbd179dfa0a7
620 globaltag 0:bbd179dfa0a7
621
621
622 $ cd ..
622 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now