Show More
@@ -1,382 +1,382 b'' | |||||
1 | $ "$TESTDIR/hghave" unix-permissions || exit 80 |
|
|||
2 |
|
||||
3 | Helper functions: |
|
1 | Helper functions: | |
4 |
|
2 | |||
5 | $ cacheexists() { |
|
3 | $ cacheexists() { | |
6 | > [ -f .hg/cache/tags ] && echo "tag cache exists" || echo "no tag cache" |
|
4 | > [ -f .hg/cache/tags ] && echo "tag cache exists" || echo "no tag cache" | |
7 | > } |
|
5 | > } | |
8 |
|
6 | |||
9 | $ dumptags() { |
|
7 | $ dumptags() { | |
10 | > rev=$1 |
|
8 | > rev=$1 | |
11 | > echo "rev $rev: .hgtags:" |
|
9 | > echo "rev $rev: .hgtags:" | |
12 | > hg cat -r$rev .hgtags |
|
10 | > hg cat -r$rev .hgtags | |
13 | > } |
|
11 | > } | |
14 |
|
12 | |||
15 | # XXX need to test that the tag cache works when we strip an old head |
|
13 | # XXX need to test that the tag cache works when we strip an old head | |
16 | # and add a new one rooted off non-tip: i.e. node and rev of tip are the |
|
14 | # and add a new one rooted off non-tip: i.e. node and rev of tip are the | |
17 | # same, but stuff has changed behind tip. |
|
15 | # same, but stuff has changed behind tip. | |
18 |
|
16 | |||
19 | Setup: |
|
17 | Setup: | |
20 |
|
18 | |||
21 | $ hg init t |
|
19 | $ hg init t | |
22 | $ cd t |
|
20 | $ cd t | |
23 | $ cacheexists |
|
21 | $ cacheexists | |
24 | no tag cache |
|
22 | no tag cache | |
25 | $ hg id |
|
23 | $ hg id | |
26 | 000000000000 tip |
|
24 | 000000000000 tip | |
27 | $ cacheexists |
|
25 | $ cacheexists | |
28 | no tag cache |
|
26 | no tag cache | |
29 | $ echo a > a |
|
27 | $ echo a > a | |
30 | $ hg add a |
|
28 | $ hg add a | |
31 | $ hg commit -m "test" |
|
29 | $ hg commit -m "test" | |
32 | $ hg co |
|
30 | $ hg co | |
33 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
31 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
34 | $ hg identify |
|
32 | $ hg identify | |
35 | acb14030fe0a tip |
|
33 | acb14030fe0a tip | |
36 | $ cacheexists |
|
34 | $ cacheexists | |
37 | tag cache exists |
|
35 | tag cache exists | |
38 |
|
36 | |||
39 | Try corrupting the cache |
|
37 | Try corrupting the cache | |
40 |
|
38 | |||
41 | $ printf 'a b' > .hg/cache/tags |
|
39 | $ printf 'a b' > .hg/cache/tags | |
42 | $ hg identify |
|
40 | $ hg identify | |
43 | .hg/cache/tags is corrupt, rebuilding it |
|
41 | .hg/cache/tags is corrupt, rebuilding it | |
44 | acb14030fe0a tip |
|
42 | acb14030fe0a tip | |
45 | $ cacheexists |
|
43 | $ cacheexists | |
46 | tag cache exists |
|
44 | tag cache exists | |
47 | $ hg identify |
|
45 | $ hg identify | |
48 | acb14030fe0a tip |
|
46 | acb14030fe0a tip | |
49 |
|
47 | |||
50 | Create local tag with long name: |
|
48 | Create local tag with long name: | |
51 |
|
49 | |||
52 | $ T=`hg identify --debug --id` |
|
50 | $ T=`hg identify --debug --id` | |
53 | $ hg tag -l "This is a local tag with a really long name!" |
|
51 | $ hg tag -l "This is a local tag with a really long name!" | |
54 | $ hg tags |
|
52 | $ hg tags | |
55 | tip 0:acb14030fe0a |
|
53 | tip 0:acb14030fe0a | |
56 | This is a local tag with a really long name! 0:acb14030fe0a |
|
54 | This is a local tag with a really long name! 0:acb14030fe0a | |
57 | $ rm .hg/localtags |
|
55 | $ rm .hg/localtags | |
58 |
|
56 | |||
59 | Create a tag behind hg's back: |
|
57 | Create a tag behind hg's back: | |
60 |
|
58 | |||
61 | $ echo "$T first" > .hgtags |
|
59 | $ echo "$T first" > .hgtags | |
62 | $ cat .hgtags |
|
60 | $ cat .hgtags | |
63 | acb14030fe0a21b60322c440ad2d20cf7685a376 first |
|
61 | acb14030fe0a21b60322c440ad2d20cf7685a376 first | |
64 | $ hg add .hgtags |
|
62 | $ hg add .hgtags | |
65 | $ hg commit -m "add tags" |
|
63 | $ hg commit -m "add tags" | |
66 | $ hg tags |
|
64 | $ hg tags | |
67 | tip 1:b9154636be93 |
|
65 | tip 1:b9154636be93 | |
68 | first 0:acb14030fe0a |
|
66 | first 0:acb14030fe0a | |
69 | $ hg identify |
|
67 | $ hg identify | |
70 | b9154636be93 tip |
|
68 | b9154636be93 tip | |
71 |
|
69 | |||
72 | Repeat with cold tag cache: |
|
70 | Repeat with cold tag cache: | |
73 |
|
71 | |||
74 | $ rm -f .hg/cache/tags |
|
72 | $ rm -f .hg/cache/tags | |
75 | $ hg identify |
|
73 | $ hg identify | |
76 | b9154636be93 tip |
|
74 | b9154636be93 tip | |
77 |
|
75 | |||
78 | And again, but now unable to write tag cache: |
|
76 | And again, but now unable to write tag cache: | |
79 |
|
77 | |||
|
78 | #if unix-permissions | |||
80 | $ rm -f .hg/cache/tags |
|
79 | $ rm -f .hg/cache/tags | |
81 | $ chmod 555 .hg |
|
80 | $ chmod 555 .hg | |
82 | $ hg identify |
|
81 | $ hg identify | |
83 | b9154636be93 tip |
|
82 | b9154636be93 tip | |
84 | $ chmod 755 .hg |
|
83 | $ chmod 755 .hg | |
|
84 | #endif | |||
85 |
|
85 | |||
86 | Create a branch: |
|
86 | Create a branch: | |
87 |
|
87 | |||
88 | $ echo bb > a |
|
88 | $ echo bb > a | |
89 | $ hg status |
|
89 | $ hg status | |
90 | M a |
|
90 | M a | |
91 | $ hg identify |
|
91 | $ hg identify | |
92 | b9154636be93+ tip |
|
92 | b9154636be93+ tip | |
93 | $ hg co first |
|
93 | $ hg co first | |
94 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
94 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
95 | $ hg id |
|
95 | $ hg id | |
96 | acb14030fe0a+ first |
|
96 | acb14030fe0a+ first | |
97 | $ hg -v id |
|
97 | $ hg -v id | |
98 | acb14030fe0a+ first |
|
98 | acb14030fe0a+ first | |
99 | $ hg status |
|
99 | $ hg status | |
100 | M a |
|
100 | M a | |
101 | $ echo 1 > b |
|
101 | $ echo 1 > b | |
102 | $ hg add b |
|
102 | $ hg add b | |
103 | $ hg commit -m "branch" |
|
103 | $ hg commit -m "branch" | |
104 | created new head |
|
104 | created new head | |
105 | $ hg id |
|
105 | $ hg id | |
106 | c8edf04160c7 tip |
|
106 | c8edf04160c7 tip | |
107 |
|
107 | |||
108 | Merge the two heads: |
|
108 | Merge the two heads: | |
109 |
|
109 | |||
110 | $ hg merge 1 |
|
110 | $ hg merge 1 | |
111 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
111 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
112 | (branch merge, don't forget to commit) |
|
112 | (branch merge, don't forget to commit) | |
113 | $ hg id |
|
113 | $ hg id | |
114 | c8edf04160c7+b9154636be93+ tip |
|
114 | c8edf04160c7+b9154636be93+ tip | |
115 | $ hg status |
|
115 | $ hg status | |
116 | M .hgtags |
|
116 | M .hgtags | |
117 | $ hg commit -m "merge" |
|
117 | $ hg commit -m "merge" | |
118 |
|
118 | |||
119 | Create a fake head, make sure tag not visible afterwards: |
|
119 | Create a fake head, make sure tag not visible afterwards: | |
120 |
|
120 | |||
121 | $ cp .hgtags tags |
|
121 | $ cp .hgtags tags | |
122 | $ hg tag last |
|
122 | $ hg tag last | |
123 | $ hg rm .hgtags |
|
123 | $ hg rm .hgtags | |
124 | $ hg commit -m "remove" |
|
124 | $ hg commit -m "remove" | |
125 |
|
125 | |||
126 | $ mv tags .hgtags |
|
126 | $ mv tags .hgtags | |
127 | $ hg add .hgtags |
|
127 | $ hg add .hgtags | |
128 | $ hg commit -m "readd" |
|
128 | $ hg commit -m "readd" | |
129 | $ |
|
129 | $ | |
130 | $ hg tags |
|
130 | $ hg tags | |
131 | tip 6:35ff301afafe |
|
131 | tip 6:35ff301afafe | |
132 | first 0:acb14030fe0a |
|
132 | first 0:acb14030fe0a | |
133 |
|
133 | |||
134 | Add invalid tags: |
|
134 | Add invalid tags: | |
135 |
|
135 | |||
136 | $ echo "spam" >> .hgtags |
|
136 | $ echo "spam" >> .hgtags | |
137 | $ echo >> .hgtags |
|
137 | $ echo >> .hgtags | |
138 | $ echo "foo bar" >> .hgtags |
|
138 | $ echo "foo bar" >> .hgtags | |
139 | $ echo "a5a5 invalid" >> .hg/localtags |
|
139 | $ echo "a5a5 invalid" >> .hg/localtags | |
140 | $ cat .hgtags |
|
140 | $ cat .hgtags | |
141 | acb14030fe0a21b60322c440ad2d20cf7685a376 first |
|
141 | acb14030fe0a21b60322c440ad2d20cf7685a376 first | |
142 | spam |
|
142 | spam | |
143 |
|
143 | |||
144 | foo bar |
|
144 | foo bar | |
145 | $ hg commit -m "tags" |
|
145 | $ hg commit -m "tags" | |
146 |
|
146 | |||
147 | Report tag parse error on other head: |
|
147 | Report tag parse error on other head: | |
148 |
|
148 | |||
149 | $ hg up 3 |
|
149 | $ hg up 3 | |
150 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
150 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
151 | $ echo 'x y' >> .hgtags |
|
151 | $ echo 'x y' >> .hgtags | |
152 | $ hg commit -m "head" |
|
152 | $ hg commit -m "head" | |
153 | created new head |
|
153 | created new head | |
154 |
|
154 | |||
155 | $ hg tags |
|
155 | $ hg tags | |
156 | .hgtags@75d9f02dfe28, line 2: cannot parse entry |
|
156 | .hgtags@75d9f02dfe28, line 2: cannot parse entry | |
157 | .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed |
|
157 | .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed | |
158 | .hgtags@c4be69a18c11, line 2: node 'x' is not well formed |
|
158 | .hgtags@c4be69a18c11, line 2: node 'x' is not well formed | |
159 | tip 8:c4be69a18c11 |
|
159 | tip 8:c4be69a18c11 | |
160 | first 0:acb14030fe0a |
|
160 | first 0:acb14030fe0a | |
161 | $ hg tip |
|
161 | $ hg tip | |
162 | changeset: 8:c4be69a18c11 |
|
162 | changeset: 8:c4be69a18c11 | |
163 | tag: tip |
|
163 | tag: tip | |
164 | parent: 3:ac5e980c4dc0 |
|
164 | parent: 3:ac5e980c4dc0 | |
165 | user: test |
|
165 | user: test | |
166 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
166 | date: Thu Jan 01 00:00:00 1970 +0000 | |
167 | summary: head |
|
167 | summary: head | |
168 |
|
168 | |||
169 |
|
169 | |||
170 | Test tag precedence rules: |
|
170 | Test tag precedence rules: | |
171 |
|
171 | |||
172 | $ cd .. |
|
172 | $ cd .. | |
173 | $ hg init t2 |
|
173 | $ hg init t2 | |
174 | $ cd t2 |
|
174 | $ cd t2 | |
175 | $ echo foo > foo |
|
175 | $ echo foo > foo | |
176 | $ hg add foo |
|
176 | $ hg add foo | |
177 | $ hg ci -m 'add foo' # rev 0 |
|
177 | $ hg ci -m 'add foo' # rev 0 | |
178 | $ hg tag bar # rev 1 |
|
178 | $ hg tag bar # rev 1 | |
179 | $ echo >> foo |
|
179 | $ echo >> foo | |
180 | $ hg ci -m 'change foo 1' # rev 2 |
|
180 | $ hg ci -m 'change foo 1' # rev 2 | |
181 | $ hg up -C 1 |
|
181 | $ hg up -C 1 | |
182 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
182 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
183 | $ hg tag -r 1 -f bar # rev 3 |
|
183 | $ hg tag -r 1 -f bar # rev 3 | |
184 | $ hg up -C 1 |
|
184 | $ hg up -C 1 | |
185 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
185 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
186 | $ echo >> foo |
|
186 | $ echo >> foo | |
187 | $ hg ci -m 'change foo 2' # rev 4 |
|
187 | $ hg ci -m 'change foo 2' # rev 4 | |
188 | created new head |
|
188 | created new head | |
189 | $ hg tags |
|
189 | $ hg tags | |
190 | tip 4:0c192d7d5e6b |
|
190 | tip 4:0c192d7d5e6b | |
191 | bar 1:78391a272241 |
|
191 | bar 1:78391a272241 | |
192 |
|
192 | |||
193 | Repeat in case of cache effects: |
|
193 | Repeat in case of cache effects: | |
194 |
|
194 | |||
195 | $ hg tags |
|
195 | $ hg tags | |
196 | tip 4:0c192d7d5e6b |
|
196 | tip 4:0c192d7d5e6b | |
197 | bar 1:78391a272241 |
|
197 | bar 1:78391a272241 | |
198 |
|
198 | |||
199 | Detailed dump of tag info: |
|
199 | Detailed dump of tag info: | |
200 |
|
200 | |||
201 | $ hg heads -q # expect 4, 3, 2 |
|
201 | $ hg heads -q # expect 4, 3, 2 | |
202 | 4:0c192d7d5e6b |
|
202 | 4:0c192d7d5e6b | |
203 | 3:6fa450212aeb |
|
203 | 3:6fa450212aeb | |
204 | 2:7a94127795a3 |
|
204 | 2:7a94127795a3 | |
205 | $ dumptags 2 |
|
205 | $ dumptags 2 | |
206 | rev 2: .hgtags: |
|
206 | rev 2: .hgtags: | |
207 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
|
207 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
208 | $ dumptags 3 |
|
208 | $ dumptags 3 | |
209 | rev 3: .hgtags: |
|
209 | rev 3: .hgtags: | |
210 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
|
210 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
211 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
|
211 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
212 | 78391a272241d70354aa14c874552cad6b51bb42 bar |
|
212 | 78391a272241d70354aa14c874552cad6b51bb42 bar | |
213 | $ dumptags 4 |
|
213 | $ dumptags 4 | |
214 | rev 4: .hgtags: |
|
214 | rev 4: .hgtags: | |
215 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
|
215 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
216 |
|
216 | |||
217 | Dump cache: |
|
217 | Dump cache: | |
218 |
|
218 | |||
219 | $ cat .hg/cache/tags |
|
219 | $ cat .hg/cache/tags | |
220 | 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d |
|
220 | 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d | |
221 | 3 6fa450212aeb2a21ed616a54aea39a4a27894cd7 7d3b718c964ef37b89e550ebdafd5789e76ce1b0 |
|
221 | 3 6fa450212aeb2a21ed616a54aea39a4a27894cd7 7d3b718c964ef37b89e550ebdafd5789e76ce1b0 | |
222 | 2 7a94127795a33c10a370c93f731fd9fea0b79af6 0c04f2a8af31de17fab7422878ee5a2dadbc943d |
|
222 | 2 7a94127795a33c10a370c93f731fd9fea0b79af6 0c04f2a8af31de17fab7422878ee5a2dadbc943d | |
223 |
|
223 | |||
224 | 78391a272241d70354aa14c874552cad6b51bb42 bar |
|
224 | 78391a272241d70354aa14c874552cad6b51bb42 bar | |
225 |
|
225 | |||
226 | Test tag removal: |
|
226 | Test tag removal: | |
227 |
|
227 | |||
228 | $ hg tag --remove bar # rev 5 |
|
228 | $ hg tag --remove bar # rev 5 | |
229 | $ hg tip -vp |
|
229 | $ hg tip -vp | |
230 | changeset: 5:5f6e8655b1c7 |
|
230 | changeset: 5:5f6e8655b1c7 | |
231 | tag: tip |
|
231 | tag: tip | |
232 | user: test |
|
232 | user: test | |
233 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
233 | date: Thu Jan 01 00:00:00 1970 +0000 | |
234 | files: .hgtags |
|
234 | files: .hgtags | |
235 | description: |
|
235 | description: | |
236 | Removed tag bar |
|
236 | Removed tag bar | |
237 |
|
237 | |||
238 |
|
238 | |||
239 | diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags |
|
239 | diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags | |
240 | --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000 |
|
240 | --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000 | |
241 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 |
|
241 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 | |
242 | @@ -1,1 +1,3 @@ |
|
242 | @@ -1,1 +1,3 @@ | |
243 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
|
243 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
244 | +78391a272241d70354aa14c874552cad6b51bb42 bar |
|
244 | +78391a272241d70354aa14c874552cad6b51bb42 bar | |
245 | +0000000000000000000000000000000000000000 bar |
|
245 | +0000000000000000000000000000000000000000 bar | |
246 |
|
246 | |||
247 | $ hg tags |
|
247 | $ hg tags | |
248 | tip 5:5f6e8655b1c7 |
|
248 | tip 5:5f6e8655b1c7 | |
249 | $ hg tags # again, try to expose cache bugs |
|
249 | $ hg tags # again, try to expose cache bugs | |
250 | tip 5:5f6e8655b1c7 |
|
250 | tip 5:5f6e8655b1c7 | |
251 |
|
251 | |||
252 | Remove nonexistent tag: |
|
252 | Remove nonexistent tag: | |
253 |
|
253 | |||
254 | $ hg tag --remove foobar |
|
254 | $ hg tag --remove foobar | |
255 | abort: tag 'foobar' does not exist |
|
255 | abort: tag 'foobar' does not exist | |
256 | [255] |
|
256 | [255] | |
257 | $ hg tip |
|
257 | $ hg tip | |
258 | changeset: 5:5f6e8655b1c7 |
|
258 | changeset: 5:5f6e8655b1c7 | |
259 | tag: tip |
|
259 | tag: tip | |
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: Removed tag bar |
|
262 | summary: Removed tag bar | |
263 |
|
263 | |||
264 |
|
264 | |||
265 | Undo a tag with rollback: |
|
265 | Undo a tag with rollback: | |
266 |
|
266 | |||
267 | $ hg rollback # destroy rev 5 (restore bar) |
|
267 | $ hg rollback # destroy rev 5 (restore bar) | |
268 | repository tip rolled back to revision 4 (undo commit) |
|
268 | repository tip rolled back to revision 4 (undo commit) | |
269 | working directory now based on revision 4 |
|
269 | working directory now based on revision 4 | |
270 | $ hg tags |
|
270 | $ hg tags | |
271 | tip 4:0c192d7d5e6b |
|
271 | tip 4:0c192d7d5e6b | |
272 | bar 1:78391a272241 |
|
272 | bar 1:78391a272241 | |
273 | $ hg tags |
|
273 | $ hg tags | |
274 | tip 4:0c192d7d5e6b |
|
274 | tip 4:0c192d7d5e6b | |
275 | bar 1:78391a272241 |
|
275 | bar 1:78391a272241 | |
276 |
|
276 | |||
277 | Test tag rank: |
|
277 | Test tag rank: | |
278 |
|
278 | |||
279 | $ cd .. |
|
279 | $ cd .. | |
280 | $ hg init t3 |
|
280 | $ hg init t3 | |
281 | $ cd t3 |
|
281 | $ cd t3 | |
282 | $ echo foo > foo |
|
282 | $ echo foo > foo | |
283 | $ hg add foo |
|
283 | $ hg add foo | |
284 | $ hg ci -m 'add foo' # rev 0 |
|
284 | $ hg ci -m 'add foo' # rev 0 | |
285 | $ hg tag -f bar # rev 1 bar -> 0 |
|
285 | $ hg tag -f bar # rev 1 bar -> 0 | |
286 | $ hg tag -f bar # rev 2 bar -> 1 |
|
286 | $ hg tag -f bar # rev 2 bar -> 1 | |
287 | $ hg tag -fr 0 bar # rev 3 bar -> 0 |
|
287 | $ hg tag -fr 0 bar # rev 3 bar -> 0 | |
288 | $ hg tag -fr 1 bar # rev 4 bar -> 1 |
|
288 | $ hg tag -fr 1 bar # rev 4 bar -> 1 | |
289 | $ hg tag -fr 0 bar # rev 5 bar -> 0 |
|
289 | $ hg tag -fr 0 bar # rev 5 bar -> 0 | |
290 | $ hg tags |
|
290 | $ hg tags | |
291 | tip 5:85f05169d91d |
|
291 | tip 5:85f05169d91d | |
292 | bar 0:bbd179dfa0a7 |
|
292 | bar 0:bbd179dfa0a7 | |
293 | $ hg co 3 |
|
293 | $ hg co 3 | |
294 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
294 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
295 | $ echo barbar > foo |
|
295 | $ echo barbar > foo | |
296 | $ hg ci -m 'change foo' # rev 6 |
|
296 | $ hg ci -m 'change foo' # rev 6 | |
297 | created new head |
|
297 | created new head | |
298 | $ hg tags |
|
298 | $ hg tags | |
299 | tip 6:735c3ca72986 |
|
299 | tip 6:735c3ca72986 | |
300 | bar 0:bbd179dfa0a7 |
|
300 | bar 0:bbd179dfa0a7 | |
301 |
|
301 | |||
302 | Don't allow moving tag without -f: |
|
302 | Don't allow moving tag without -f: | |
303 |
|
303 | |||
304 | $ hg tag -r 3 bar |
|
304 | $ hg tag -r 3 bar | |
305 | abort: tag 'bar' already exists (use -f to force) |
|
305 | abort: tag 'bar' already exists (use -f to force) | |
306 | [255] |
|
306 | [255] | |
307 | $ hg tags |
|
307 | $ hg tags | |
308 | tip 6:735c3ca72986 |
|
308 | tip 6:735c3ca72986 | |
309 | bar 0:bbd179dfa0a7 |
|
309 | bar 0:bbd179dfa0a7 | |
310 |
|
310 | |||
311 | Strip 1: expose an old head: |
|
311 | Strip 1: expose an old head: | |
312 |
|
312 | |||
313 | $ hg --config extensions.mq= strip 5 |
|
313 | $ hg --config extensions.mq= strip 5 | |
314 | saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob) |
|
314 | saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob) | |
315 | $ hg tags # partly stale cache |
|
315 | $ hg tags # partly stale cache | |
316 | tip 5:735c3ca72986 |
|
316 | tip 5:735c3ca72986 | |
317 | bar 1:78391a272241 |
|
317 | bar 1:78391a272241 | |
318 | $ hg tags # up-to-date cache |
|
318 | $ hg tags # up-to-date cache | |
319 | tip 5:735c3ca72986 |
|
319 | tip 5:735c3ca72986 | |
320 | bar 1:78391a272241 |
|
320 | bar 1:78391a272241 | |
321 |
|
321 | |||
322 | Strip 2: destroy whole branch, no old head exposed |
|
322 | Strip 2: destroy whole branch, no old head exposed | |
323 |
|
323 | |||
324 | $ hg --config extensions.mq= strip 4 |
|
324 | $ hg --config extensions.mq= strip 4 | |
325 | saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob) |
|
325 | saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob) | |
326 | $ hg tags # partly stale |
|
326 | $ hg tags # partly stale | |
327 | tip 4:735c3ca72986 |
|
327 | tip 4:735c3ca72986 | |
328 | bar 0:bbd179dfa0a7 |
|
328 | bar 0:bbd179dfa0a7 | |
329 | $ rm -f .hg/cache/tags |
|
329 | $ rm -f .hg/cache/tags | |
330 | $ hg tags # cold cache |
|
330 | $ hg tags # cold cache | |
331 | tip 4:735c3ca72986 |
|
331 | tip 4:735c3ca72986 | |
332 | bar 0:bbd179dfa0a7 |
|
332 | bar 0:bbd179dfa0a7 | |
333 |
|
333 | |||
334 | Test tag rank with 3 heads: |
|
334 | Test tag rank with 3 heads: | |
335 |
|
335 | |||
336 | $ cd .. |
|
336 | $ cd .. | |
337 | $ hg init t4 |
|
337 | $ hg init t4 | |
338 | $ cd t4 |
|
338 | $ cd t4 | |
339 | $ echo foo > foo |
|
339 | $ echo foo > foo | |
340 | $ hg add |
|
340 | $ hg add | |
341 | adding foo |
|
341 | adding foo | |
342 | $ hg ci -m 'add foo' # rev 0 |
|
342 | $ hg ci -m 'add foo' # rev 0 | |
343 | $ hg tag bar # rev 1 bar -> 0 |
|
343 | $ hg tag bar # rev 1 bar -> 0 | |
344 | $ hg tag -f bar # rev 2 bar -> 1 |
|
344 | $ hg tag -f bar # rev 2 bar -> 1 | |
345 | $ hg up -qC 0 |
|
345 | $ hg up -qC 0 | |
346 | $ hg tag -fr 2 bar # rev 3 bar -> 2 |
|
346 | $ hg tag -fr 2 bar # rev 3 bar -> 2 | |
347 | $ hg tags |
|
347 | $ hg tags | |
348 | tip 3:197c21bbbf2c |
|
348 | tip 3:197c21bbbf2c | |
349 | bar 2:6fa450212aeb |
|
349 | bar 2:6fa450212aeb | |
350 | $ hg up -qC 0 |
|
350 | $ hg up -qC 0 | |
351 | $ hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2 |
|
351 | $ hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2 | |
352 |
|
352 | |||
353 | Bar should still point to rev 2: |
|
353 | Bar should still point to rev 2: | |
354 |
|
354 | |||
355 | $ hg tags |
|
355 | $ hg tags | |
356 | tip 4:3b4b14ed0202 |
|
356 | tip 4:3b4b14ed0202 | |
357 | bar 2:6fa450212aeb |
|
357 | bar 2:6fa450212aeb | |
358 |
|
358 | |||
359 | Test that removing global/local tags does not get confused when trying |
|
359 | Test that removing global/local tags does not get confused when trying | |
360 | to remove a tag of type X which actually only exists as a type Y: |
|
360 | to remove a tag of type X which actually only exists as a type Y: | |
361 |
|
361 | |||
362 | $ cd .. |
|
362 | $ cd .. | |
363 | $ hg init t5 |
|
363 | $ hg init t5 | |
364 | $ cd t5 |
|
364 | $ cd t5 | |
365 | $ echo foo > foo |
|
365 | $ echo foo > foo | |
366 | $ hg add |
|
366 | $ hg add | |
367 | adding foo |
|
367 | adding foo | |
368 | $ hg ci -m 'add foo' # rev 0 |
|
368 | $ hg ci -m 'add foo' # rev 0 | |
369 |
|
369 | |||
370 | $ hg tag -r 0 -l localtag |
|
370 | $ hg tag -r 0 -l localtag | |
371 | $ hg tag --remove localtag |
|
371 | $ hg tag --remove localtag | |
372 | abort: tag 'localtag' is not a global tag |
|
372 | abort: tag 'localtag' is not a global tag | |
373 | [255] |
|
373 | [255] | |
374 | $ |
|
374 | $ | |
375 | $ hg tag -r 0 globaltag |
|
375 | $ hg tag -r 0 globaltag | |
376 | $ hg tag --remove -l globaltag |
|
376 | $ hg tag --remove -l globaltag | |
377 | abort: tag 'globaltag' is not a local tag |
|
377 | abort: tag 'globaltag' is not a local tag | |
378 | [255] |
|
378 | [255] | |
379 | $ hg tags -v |
|
379 | $ hg tags -v | |
380 | tip 1:a0b6fe111088 |
|
380 | tip 1:a0b6fe111088 | |
381 | localtag 0:bbd179dfa0a7 local |
|
381 | localtag 0:bbd179dfa0a7 local | |
382 | globaltag 0:bbd179dfa0a7 |
|
382 | globaltag 0:bbd179dfa0a7 |
General Comments 0
You need to be logged in to leave comments.
Login now