##// END OF EJS Templates
tests: rework revision branch cache tests...
Mads Kiilerich -
r23861:01426cad default
parent child Browse files
Show More
@@ -1,598 +1,623
1 $ hg init a
1 $ hg init a
2 $ cd a
2 $ cd a
3 $ echo 'root' >root
3 $ echo 'root' >root
4 $ hg add root
4 $ hg add root
5 $ hg commit -d '0 0' -m "Adding root node"
5 $ hg commit -d '0 0' -m "Adding root node"
6
6
7 $ echo 'a' >a
7 $ echo 'a' >a
8 $ hg add a
8 $ hg add a
9 $ hg branch a
9 $ hg branch a
10 marked working directory as branch a
10 marked working directory as branch a
11 (branches are permanent and global, did you want a bookmark?)
11 (branches are permanent and global, did you want a bookmark?)
12 $ hg commit -d '1 0' -m "Adding a branch"
12 $ hg commit -d '1 0' -m "Adding a branch"
13
13
14 $ hg branch q
14 $ hg branch q
15 marked working directory as branch q
15 marked working directory as branch q
16 (branches are permanent and global, did you want a bookmark?)
16 (branches are permanent and global, did you want a bookmark?)
17 $ echo 'aa' >a
17 $ echo 'aa' >a
18 $ hg branch -C
18 $ hg branch -C
19 reset working directory to branch a
19 reset working directory to branch a
20 $ hg commit -d '2 0' -m "Adding to a branch"
20 $ hg commit -d '2 0' -m "Adding to a branch"
21
21
22 $ hg update -C 0
22 $ hg update -C 0
23 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
23 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
24 $ echo 'b' >b
24 $ echo 'b' >b
25 $ hg add b
25 $ hg add b
26 $ hg branch b
26 $ hg branch b
27 marked working directory as branch b
27 marked working directory as branch b
28 (branches are permanent and global, did you want a bookmark?)
28 (branches are permanent and global, did you want a bookmark?)
29 $ hg commit -d '2 0' -m "Adding b branch"
29 $ hg commit -d '2 0' -m "Adding b branch"
30
30
31 $ echo 'bh1' >bh1
31 $ echo 'bh1' >bh1
32 $ hg add bh1
32 $ hg add bh1
33 $ hg commit -d '3 0' -m "Adding b branch head 1"
33 $ hg commit -d '3 0' -m "Adding b branch head 1"
34
34
35 $ hg update -C 2
35 $ hg update -C 2
36 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
36 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
37 $ echo 'bh2' >bh2
37 $ echo 'bh2' >bh2
38 $ hg add bh2
38 $ hg add bh2
39 $ hg commit -d '4 0' -m "Adding b branch head 2"
39 $ hg commit -d '4 0' -m "Adding b branch head 2"
40
40
41 $ echo 'c' >c
41 $ echo 'c' >c
42 $ hg add c
42 $ hg add c
43 $ hg branch c
43 $ hg branch c
44 marked working directory as branch c
44 marked working directory as branch c
45 (branches are permanent and global, did you want a bookmark?)
45 (branches are permanent and global, did you want a bookmark?)
46 $ hg commit -d '5 0' -m "Adding c branch"
46 $ hg commit -d '5 0' -m "Adding c branch"
47
47
48 reserved names
48 reserved names
49
49
50 $ hg branch tip
50 $ hg branch tip
51 abort: the name 'tip' is reserved
51 abort: the name 'tip' is reserved
52 [255]
52 [255]
53 $ hg branch null
53 $ hg branch null
54 abort: the name 'null' is reserved
54 abort: the name 'null' is reserved
55 [255]
55 [255]
56 $ hg branch .
56 $ hg branch .
57 abort: the name '.' is reserved
57 abort: the name '.' is reserved
58 [255]
58 [255]
59
59
60 invalid characters
60 invalid characters
61
61
62 $ hg branch 'foo:bar'
62 $ hg branch 'foo:bar'
63 abort: ':' cannot be used in a name
63 abort: ':' cannot be used in a name
64 [255]
64 [255]
65
65
66 $ hg branch 'foo
66 $ hg branch 'foo
67 > bar'
67 > bar'
68 abort: '\n' cannot be used in a name
68 abort: '\n' cannot be used in a name
69 [255]
69 [255]
70
70
71 trailing or leading spaces should be stripped before testing duplicates
71 trailing or leading spaces should be stripped before testing duplicates
72
72
73 $ hg branch 'b '
73 $ hg branch 'b '
74 abort: a branch of the same name already exists
74 abort: a branch of the same name already exists
75 (use 'hg update' to switch to it)
75 (use 'hg update' to switch to it)
76 [255]
76 [255]
77
77
78 $ hg branch ' b'
78 $ hg branch ' b'
79 abort: a branch of the same name already exists
79 abort: a branch of the same name already exists
80 (use 'hg update' to switch to it)
80 (use 'hg update' to switch to it)
81 [255]
81 [255]
82
82
83 verify update will accept invalid legacy branch names
83 verify update will accept invalid legacy branch names
84
84
85 $ hg init test-invalid-branch-name
85 $ hg init test-invalid-branch-name
86 $ cd test-invalid-branch-name
86 $ cd test-invalid-branch-name
87 $ hg pull -u "$TESTDIR"/bundles/test-invalid-branch-name.hg
87 $ hg pull -u "$TESTDIR"/bundles/test-invalid-branch-name.hg
88 pulling from *test-invalid-branch-name.hg (glob)
88 pulling from *test-invalid-branch-name.hg (glob)
89 requesting all changes
89 requesting all changes
90 adding changesets
90 adding changesets
91 adding manifests
91 adding manifests
92 adding file changes
92 adding file changes
93 added 3 changesets with 3 changes to 2 files
93 added 3 changesets with 3 changes to 2 files
94 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
95
95
96 $ hg update '"colon:test"'
96 $ hg update '"colon:test"'
97 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 $ cd ..
98 $ cd ..
99
99
100 $ echo 'd' >d
100 $ echo 'd' >d
101 $ hg add d
101 $ hg add d
102 $ hg branch 'a branch name much longer than the default justification used by branches'
102 $ hg branch 'a branch name much longer than the default justification used by branches'
103 marked working directory as branch a branch name much longer than the default justification used by branches
103 marked working directory as branch a branch name much longer than the default justification used by branches
104 (branches are permanent and global, did you want a bookmark?)
104 (branches are permanent and global, did you want a bookmark?)
105 $ hg commit -d '6 0' -m "Adding d branch"
105 $ hg commit -d '6 0' -m "Adding d branch"
106
106
107 $ hg branches
107 $ hg branches
108 a branch name much longer than the default justification used by branches 7:10ff5895aa57
108 a branch name much longer than the default justification used by branches 7:10ff5895aa57
109 b 4:aee39cd168d0
109 b 4:aee39cd168d0
110 c 6:589736a22561 (inactive)
110 c 6:589736a22561 (inactive)
111 a 5:d8cbc61dbaa6 (inactive)
111 a 5:d8cbc61dbaa6 (inactive)
112 default 0:19709c5a4e75 (inactive)
112 default 0:19709c5a4e75 (inactive)
113
113
114 -------
114 -------
115
115
116 $ hg branches -a
116 $ hg branches -a
117 a branch name much longer than the default justification used by branches 7:10ff5895aa57
117 a branch name much longer than the default justification used by branches 7:10ff5895aa57
118 b 4:aee39cd168d0
118 b 4:aee39cd168d0
119
119
120 --- Branch a
120 --- Branch a
121
121
122 $ hg log -b a
122 $ hg log -b a
123 changeset: 5:d8cbc61dbaa6
123 changeset: 5:d8cbc61dbaa6
124 branch: a
124 branch: a
125 parent: 2:881fe2b92ad0
125 parent: 2:881fe2b92ad0
126 user: test
126 user: test
127 date: Thu Jan 01 00:00:04 1970 +0000
127 date: Thu Jan 01 00:00:04 1970 +0000
128 summary: Adding b branch head 2
128 summary: Adding b branch head 2
129
129
130 changeset: 2:881fe2b92ad0
130 changeset: 2:881fe2b92ad0
131 branch: a
131 branch: a
132 user: test
132 user: test
133 date: Thu Jan 01 00:00:02 1970 +0000
133 date: Thu Jan 01 00:00:02 1970 +0000
134 summary: Adding to a branch
134 summary: Adding to a branch
135
135
136 changeset: 1:dd6b440dd85a
136 changeset: 1:dd6b440dd85a
137 branch: a
137 branch: a
138 user: test
138 user: test
139 date: Thu Jan 01 00:00:01 1970 +0000
139 date: Thu Jan 01 00:00:01 1970 +0000
140 summary: Adding a branch
140 summary: Adding a branch
141
141
142
142
143 ---- Branch b
143 ---- Branch b
144
144
145 $ hg log -b b
145 $ hg log -b b
146 changeset: 4:aee39cd168d0
146 changeset: 4:aee39cd168d0
147 branch: b
147 branch: b
148 user: test
148 user: test
149 date: Thu Jan 01 00:00:03 1970 +0000
149 date: Thu Jan 01 00:00:03 1970 +0000
150 summary: Adding b branch head 1
150 summary: Adding b branch head 1
151
151
152 changeset: 3:ac22033332d1
152 changeset: 3:ac22033332d1
153 branch: b
153 branch: b
154 parent: 0:19709c5a4e75
154 parent: 0:19709c5a4e75
155 user: test
155 user: test
156 date: Thu Jan 01 00:00:02 1970 +0000
156 date: Thu Jan 01 00:00:02 1970 +0000
157 summary: Adding b branch
157 summary: Adding b branch
158
158
159
159
160 ---- going to test branch closing
160 ---- going to test branch closing
161
161
162 $ hg branches
162 $ hg branches
163 a branch name much longer than the default justification used by branches 7:10ff5895aa57
163 a branch name much longer than the default justification used by branches 7:10ff5895aa57
164 b 4:aee39cd168d0
164 b 4:aee39cd168d0
165 c 6:589736a22561 (inactive)
165 c 6:589736a22561 (inactive)
166 a 5:d8cbc61dbaa6 (inactive)
166 a 5:d8cbc61dbaa6 (inactive)
167 default 0:19709c5a4e75 (inactive)
167 default 0:19709c5a4e75 (inactive)
168 $ hg up -C b
168 $ hg up -C b
169 2 files updated, 0 files merged, 4 files removed, 0 files unresolved
169 2 files updated, 0 files merged, 4 files removed, 0 files unresolved
170 $ echo 'xxx1' >> b
170 $ echo 'xxx1' >> b
171 $ hg commit -d '7 0' -m 'adding cset to branch b'
171 $ hg commit -d '7 0' -m 'adding cset to branch b'
172 $ hg up -C aee39cd168d0
172 $ hg up -C aee39cd168d0
173 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 $ echo 'xxx2' >> b
174 $ echo 'xxx2' >> b
175 $ hg commit -d '8 0' -m 'adding head to branch b'
175 $ hg commit -d '8 0' -m 'adding head to branch b'
176 created new head
176 created new head
177 $ echo 'xxx3' >> b
177 $ echo 'xxx3' >> b
178 $ hg commit -d '9 0' -m 'adding another cset to branch b'
178 $ hg commit -d '9 0' -m 'adding another cset to branch b'
179 $ hg branches
179 $ hg branches
180 b 10:bfbe841b666e
180 b 10:bfbe841b666e
181 a branch name much longer than the default justification used by branches 7:10ff5895aa57
181 a branch name much longer than the default justification used by branches 7:10ff5895aa57
182 c 6:589736a22561 (inactive)
182 c 6:589736a22561 (inactive)
183 a 5:d8cbc61dbaa6 (inactive)
183 a 5:d8cbc61dbaa6 (inactive)
184 default 0:19709c5a4e75 (inactive)
184 default 0:19709c5a4e75 (inactive)
185 $ hg heads --closed
185 $ hg heads --closed
186 changeset: 10:bfbe841b666e
186 changeset: 10:bfbe841b666e
187 branch: b
187 branch: b
188 tag: tip
188 tag: tip
189 user: test
189 user: test
190 date: Thu Jan 01 00:00:09 1970 +0000
190 date: Thu Jan 01 00:00:09 1970 +0000
191 summary: adding another cset to branch b
191 summary: adding another cset to branch b
192
192
193 changeset: 8:eebb944467c9
193 changeset: 8:eebb944467c9
194 branch: b
194 branch: b
195 parent: 4:aee39cd168d0
195 parent: 4:aee39cd168d0
196 user: test
196 user: test
197 date: Thu Jan 01 00:00:07 1970 +0000
197 date: Thu Jan 01 00:00:07 1970 +0000
198 summary: adding cset to branch b
198 summary: adding cset to branch b
199
199
200 changeset: 7:10ff5895aa57
200 changeset: 7:10ff5895aa57
201 branch: a branch name much longer than the default justification used by branches
201 branch: a branch name much longer than the default justification used by branches
202 user: test
202 user: test
203 date: Thu Jan 01 00:00:06 1970 +0000
203 date: Thu Jan 01 00:00:06 1970 +0000
204 summary: Adding d branch
204 summary: Adding d branch
205
205
206 changeset: 6:589736a22561
206 changeset: 6:589736a22561
207 branch: c
207 branch: c
208 user: test
208 user: test
209 date: Thu Jan 01 00:00:05 1970 +0000
209 date: Thu Jan 01 00:00:05 1970 +0000
210 summary: Adding c branch
210 summary: Adding c branch
211
211
212 changeset: 5:d8cbc61dbaa6
212 changeset: 5:d8cbc61dbaa6
213 branch: a
213 branch: a
214 parent: 2:881fe2b92ad0
214 parent: 2:881fe2b92ad0
215 user: test
215 user: test
216 date: Thu Jan 01 00:00:04 1970 +0000
216 date: Thu Jan 01 00:00:04 1970 +0000
217 summary: Adding b branch head 2
217 summary: Adding b branch head 2
218
218
219 changeset: 0:19709c5a4e75
219 changeset: 0:19709c5a4e75
220 user: test
220 user: test
221 date: Thu Jan 01 00:00:00 1970 +0000
221 date: Thu Jan 01 00:00:00 1970 +0000
222 summary: Adding root node
222 summary: Adding root node
223
223
224 $ hg heads
224 $ hg heads
225 changeset: 10:bfbe841b666e
225 changeset: 10:bfbe841b666e
226 branch: b
226 branch: b
227 tag: tip
227 tag: tip
228 user: test
228 user: test
229 date: Thu Jan 01 00:00:09 1970 +0000
229 date: Thu Jan 01 00:00:09 1970 +0000
230 summary: adding another cset to branch b
230 summary: adding another cset to branch b
231
231
232 changeset: 8:eebb944467c9
232 changeset: 8:eebb944467c9
233 branch: b
233 branch: b
234 parent: 4:aee39cd168d0
234 parent: 4:aee39cd168d0
235 user: test
235 user: test
236 date: Thu Jan 01 00:00:07 1970 +0000
236 date: Thu Jan 01 00:00:07 1970 +0000
237 summary: adding cset to branch b
237 summary: adding cset to branch b
238
238
239 changeset: 7:10ff5895aa57
239 changeset: 7:10ff5895aa57
240 branch: a branch name much longer than the default justification used by branches
240 branch: a branch name much longer than the default justification used by branches
241 user: test
241 user: test
242 date: Thu Jan 01 00:00:06 1970 +0000
242 date: Thu Jan 01 00:00:06 1970 +0000
243 summary: Adding d branch
243 summary: Adding d branch
244
244
245 changeset: 6:589736a22561
245 changeset: 6:589736a22561
246 branch: c
246 branch: c
247 user: test
247 user: test
248 date: Thu Jan 01 00:00:05 1970 +0000
248 date: Thu Jan 01 00:00:05 1970 +0000
249 summary: Adding c branch
249 summary: Adding c branch
250
250
251 changeset: 5:d8cbc61dbaa6
251 changeset: 5:d8cbc61dbaa6
252 branch: a
252 branch: a
253 parent: 2:881fe2b92ad0
253 parent: 2:881fe2b92ad0
254 user: test
254 user: test
255 date: Thu Jan 01 00:00:04 1970 +0000
255 date: Thu Jan 01 00:00:04 1970 +0000
256 summary: Adding b branch head 2
256 summary: Adding b branch head 2
257
257
258 changeset: 0:19709c5a4e75
258 changeset: 0:19709c5a4e75
259 user: test
259 user: test
260 date: Thu Jan 01 00:00:00 1970 +0000
260 date: Thu Jan 01 00:00:00 1970 +0000
261 summary: Adding root node
261 summary: Adding root node
262
262
263 $ hg commit -d '9 0' --close-branch -m 'prune bad branch'
263 $ hg commit -d '9 0' --close-branch -m 'prune bad branch'
264 $ hg branches -a
264 $ hg branches -a
265 b 8:eebb944467c9
265 b 8:eebb944467c9
266 a branch name much longer than the default justification used by branches 7:10ff5895aa57
266 a branch name much longer than the default justification used by branches 7:10ff5895aa57
267 $ hg up -C b
267 $ hg up -C b
268 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
269 $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
270 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
270 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
271 abort: can only close branch heads
271 abort: can only close branch heads
272 [255]
272 [255]
273
273
274 $ hg log -r tip --debug
274 $ hg log -r tip --debug
275 changeset: 12:e3d49c0575d8fc2cb1cd6859c747c14f5f6d499f
275 changeset: 12:e3d49c0575d8fc2cb1cd6859c747c14f5f6d499f
276 branch: b
276 branch: b
277 tag: tip
277 tag: tip
278 phase: draft
278 phase: draft
279 parent: 8:eebb944467c9fb9651ed232aeaf31b3c0a7fc6c1
279 parent: 8:eebb944467c9fb9651ed232aeaf31b3c0a7fc6c1
280 parent: -1:0000000000000000000000000000000000000000
280 parent: -1:0000000000000000000000000000000000000000
281 manifest: 8:6f9ed32d2b310e391a4f107d5f0f071df785bfee
281 manifest: 8:6f9ed32d2b310e391a4f107d5f0f071df785bfee
282 user: test
282 user: test
283 date: Thu Jan 01 00:00:09 1970 +0000
283 date: Thu Jan 01 00:00:09 1970 +0000
284 extra: branch=b
284 extra: branch=b
285 extra: close=1
285 extra: close=1
286 description:
286 description:
287 close this part branch too
287 close this part branch too
288
288
289
289
290 --- b branch should be inactive
290 --- b branch should be inactive
291
291
292 $ hg branches
292 $ hg branches
293 a branch name much longer than the default justification used by branches 7:10ff5895aa57
293 a branch name much longer than the default justification used by branches 7:10ff5895aa57
294 c 6:589736a22561 (inactive)
294 c 6:589736a22561 (inactive)
295 a 5:d8cbc61dbaa6 (inactive)
295 a 5:d8cbc61dbaa6 (inactive)
296 default 0:19709c5a4e75 (inactive)
296 default 0:19709c5a4e75 (inactive)
297 $ hg branches -c
297 $ hg branches -c
298 a branch name much longer than the default justification used by branches 7:10ff5895aa57
298 a branch name much longer than the default justification used by branches 7:10ff5895aa57
299 b 12:e3d49c0575d8 (closed)
299 b 12:e3d49c0575d8 (closed)
300 c 6:589736a22561 (inactive)
300 c 6:589736a22561 (inactive)
301 a 5:d8cbc61dbaa6 (inactive)
301 a 5:d8cbc61dbaa6 (inactive)
302 default 0:19709c5a4e75 (inactive)
302 default 0:19709c5a4e75 (inactive)
303 $ hg branches -a
303 $ hg branches -a
304 a branch name much longer than the default justification used by branches 7:10ff5895aa57
304 a branch name much longer than the default justification used by branches 7:10ff5895aa57
305 $ hg branches -q
305 $ hg branches -q
306 a branch name much longer than the default justification used by branches
306 a branch name much longer than the default justification used by branches
307 c
307 c
308 a
308 a
309 default
309 default
310 $ hg heads b
310 $ hg heads b
311 no open branch heads found on branches b
311 no open branch heads found on branches b
312 [1]
312 [1]
313 $ hg heads --closed b
313 $ hg heads --closed b
314 changeset: 12:e3d49c0575d8
314 changeset: 12:e3d49c0575d8
315 branch: b
315 branch: b
316 tag: tip
316 tag: tip
317 parent: 8:eebb944467c9
317 parent: 8:eebb944467c9
318 user: test
318 user: test
319 date: Thu Jan 01 00:00:09 1970 +0000
319 date: Thu Jan 01 00:00:09 1970 +0000
320 summary: close this part branch too
320 summary: close this part branch too
321
321
322 changeset: 11:d3f163457ebf
322 changeset: 11:d3f163457ebf
323 branch: b
323 branch: b
324 user: test
324 user: test
325 date: Thu Jan 01 00:00:09 1970 +0000
325 date: Thu Jan 01 00:00:09 1970 +0000
326 summary: prune bad branch
326 summary: prune bad branch
327
327
328 $ echo 'xxx4' >> b
328 $ echo 'xxx4' >> b
329 $ hg commit -d '9 0' -m 'reopen branch with a change'
329 $ hg commit -d '9 0' -m 'reopen branch with a change'
330 reopening closed branch head 12
330 reopening closed branch head 12
331
331
332 --- branch b is back in action
332 --- branch b is back in action
333
333
334 $ hg branches -a
334 $ hg branches -a
335 b 13:e23b5505d1ad
335 b 13:e23b5505d1ad
336 a branch name much longer than the default justification used by branches 7:10ff5895aa57
336 a branch name much longer than the default justification used by branches 7:10ff5895aa57
337
337
338 ---- test heads listings
338 ---- test heads listings
339
339
340 $ hg heads
340 $ hg heads
341 changeset: 13:e23b5505d1ad
341 changeset: 13:e23b5505d1ad
342 branch: b
342 branch: b
343 tag: tip
343 tag: tip
344 user: test
344 user: test
345 date: Thu Jan 01 00:00:09 1970 +0000
345 date: Thu Jan 01 00:00:09 1970 +0000
346 summary: reopen branch with a change
346 summary: reopen branch with a change
347
347
348 changeset: 7:10ff5895aa57
348 changeset: 7:10ff5895aa57
349 branch: a branch name much longer than the default justification used by branches
349 branch: a branch name much longer than the default justification used by branches
350 user: test
350 user: test
351 date: Thu Jan 01 00:00:06 1970 +0000
351 date: Thu Jan 01 00:00:06 1970 +0000
352 summary: Adding d branch
352 summary: Adding d branch
353
353
354 changeset: 6:589736a22561
354 changeset: 6:589736a22561
355 branch: c
355 branch: c
356 user: test
356 user: test
357 date: Thu Jan 01 00:00:05 1970 +0000
357 date: Thu Jan 01 00:00:05 1970 +0000
358 summary: Adding c branch
358 summary: Adding c branch
359
359
360 changeset: 5:d8cbc61dbaa6
360 changeset: 5:d8cbc61dbaa6
361 branch: a
361 branch: a
362 parent: 2:881fe2b92ad0
362 parent: 2:881fe2b92ad0
363 user: test
363 user: test
364 date: Thu Jan 01 00:00:04 1970 +0000
364 date: Thu Jan 01 00:00:04 1970 +0000
365 summary: Adding b branch head 2
365 summary: Adding b branch head 2
366
366
367 changeset: 0:19709c5a4e75
367 changeset: 0:19709c5a4e75
368 user: test
368 user: test
369 date: Thu Jan 01 00:00:00 1970 +0000
369 date: Thu Jan 01 00:00:00 1970 +0000
370 summary: Adding root node
370 summary: Adding root node
371
371
372
372
373 branch default
373 branch default
374
374
375 $ hg heads default
375 $ hg heads default
376 changeset: 0:19709c5a4e75
376 changeset: 0:19709c5a4e75
377 user: test
377 user: test
378 date: Thu Jan 01 00:00:00 1970 +0000
378 date: Thu Jan 01 00:00:00 1970 +0000
379 summary: Adding root node
379 summary: Adding root node
380
380
381
381
382 branch a
382 branch a
383
383
384 $ hg heads a
384 $ hg heads a
385 changeset: 5:d8cbc61dbaa6
385 changeset: 5:d8cbc61dbaa6
386 branch: a
386 branch: a
387 parent: 2:881fe2b92ad0
387 parent: 2:881fe2b92ad0
388 user: test
388 user: test
389 date: Thu Jan 01 00:00:04 1970 +0000
389 date: Thu Jan 01 00:00:04 1970 +0000
390 summary: Adding b branch head 2
390 summary: Adding b branch head 2
391
391
392 $ hg heads --active a
392 $ hg heads --active a
393 no open branch heads found on branches a
393 no open branch heads found on branches a
394 [1]
394 [1]
395
395
396 branch b
396 branch b
397
397
398 $ hg heads b
398 $ hg heads b
399 changeset: 13:e23b5505d1ad
399 changeset: 13:e23b5505d1ad
400 branch: b
400 branch: b
401 tag: tip
401 tag: tip
402 user: test
402 user: test
403 date: Thu Jan 01 00:00:09 1970 +0000
403 date: Thu Jan 01 00:00:09 1970 +0000
404 summary: reopen branch with a change
404 summary: reopen branch with a change
405
405
406 $ hg heads --closed b
406 $ hg heads --closed b
407 changeset: 13:e23b5505d1ad
407 changeset: 13:e23b5505d1ad
408 branch: b
408 branch: b
409 tag: tip
409 tag: tip
410 user: test
410 user: test
411 date: Thu Jan 01 00:00:09 1970 +0000
411 date: Thu Jan 01 00:00:09 1970 +0000
412 summary: reopen branch with a change
412 summary: reopen branch with a change
413
413
414 changeset: 11:d3f163457ebf
414 changeset: 11:d3f163457ebf
415 branch: b
415 branch: b
416 user: test
416 user: test
417 date: Thu Jan 01 00:00:09 1970 +0000
417 date: Thu Jan 01 00:00:09 1970 +0000
418 summary: prune bad branch
418 summary: prune bad branch
419
419
420 default branch colors:
420 default branch colors:
421
421
422 $ cat <<EOF >> $HGRCPATH
422 $ cat <<EOF >> $HGRCPATH
423 > [extensions]
423 > [extensions]
424 > color =
424 > color =
425 > [color]
425 > [color]
426 > mode = ansi
426 > mode = ansi
427 > EOF
427 > EOF
428
428
429 $ hg up -C c
429 $ hg up -C c
430 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
430 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
431 $ hg commit -d '9 0' --close-branch -m 'reclosing this branch'
431 $ hg commit -d '9 0' --close-branch -m 'reclosing this branch'
432 $ hg up -C b
432 $ hg up -C b
433 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
433 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
434 $ hg branches --color=always
434 $ hg branches --color=always
435 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
435 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
436 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
436 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
437 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
437 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
438 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
438 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
439
439
440 default closed branch color:
440 default closed branch color:
441
441
442 $ hg branches --color=always --closed
442 $ hg branches --color=always --closed
443 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
443 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
444 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
444 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
445 \x1b[0;30;1mc\x1b[0m\x1b[0;33m 14:f894c25619d3\x1b[0m (closed) (esc)
445 \x1b[0;30;1mc\x1b[0m\x1b[0;33m 14:f894c25619d3\x1b[0m (closed) (esc)
446 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
446 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
447 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
447 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
448
448
449 $ cat <<EOF >> $HGRCPATH
449 $ cat <<EOF >> $HGRCPATH
450 > [extensions]
450 > [extensions]
451 > color =
451 > color =
452 > [color]
452 > [color]
453 > branches.active = green
453 > branches.active = green
454 > branches.closed = blue
454 > branches.closed = blue
455 > branches.current = red
455 > branches.current = red
456 > branches.inactive = magenta
456 > branches.inactive = magenta
457 > log.changeset = cyan
457 > log.changeset = cyan
458 > EOF
458 > EOF
459
459
460 custom branch colors:
460 custom branch colors:
461
461
462 $ hg branches --color=always
462 $ hg branches --color=always
463 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
463 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
464 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
464 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
465 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
465 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
466 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
466 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
467
467
468 custom closed branch color:
468 custom closed branch color:
469
469
470 $ hg branches --color=always --closed
470 $ hg branches --color=always --closed
471 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
471 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
472 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
472 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
473 \x1b[0;34mc\x1b[0m\x1b[0;36m 14:f894c25619d3\x1b[0m (closed) (esc)
473 \x1b[0;34mc\x1b[0m\x1b[0;36m 14:f894c25619d3\x1b[0m (closed) (esc)
474 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
474 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
475 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
475 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
476
476
477 template output:
477 template output:
478
478
479 $ hg branches -Tjson --closed
479 $ hg branches -Tjson --closed
480 [
480 [
481 {
481 {
482 "active": true,
482 "active": true,
483 "branch": "b",
483 "branch": "b",
484 "closed": false,
484 "closed": false,
485 "current": true,
485 "current": true,
486 "node": "e23b5505d1ad24aab6f84fd8c7cb8cd8e5e93be0",
486 "node": "e23b5505d1ad24aab6f84fd8c7cb8cd8e5e93be0",
487 "rev": 13
487 "rev": 13
488 },
488 },
489 {
489 {
490 "active": true,
490 "active": true,
491 "branch": "a branch name much longer than the default justification used by branches",
491 "branch": "a branch name much longer than the default justification used by branches",
492 "closed": false,
492 "closed": false,
493 "current": false,
493 "current": false,
494 "node": "10ff5895aa5793bd378da574af8cec8ea408d831",
494 "node": "10ff5895aa5793bd378da574af8cec8ea408d831",
495 "rev": 7
495 "rev": 7
496 },
496 },
497 {
497 {
498 "active": false,
498 "active": false,
499 "branch": "c",
499 "branch": "c",
500 "closed": true,
500 "closed": true,
501 "current": false,
501 "current": false,
502 "node": "f894c25619d3f1484639d81be950e0a07bc6f1f6",
502 "node": "f894c25619d3f1484639d81be950e0a07bc6f1f6",
503 "rev": 14
503 "rev": 14
504 },
504 },
505 {
505 {
506 "active": false,
506 "active": false,
507 "branch": "a",
507 "branch": "a",
508 "closed": false,
508 "closed": false,
509 "current": false,
509 "current": false,
510 "node": "d8cbc61dbaa6dc817175d1e301eecb863f280832",
510 "node": "d8cbc61dbaa6dc817175d1e301eecb863f280832",
511 "rev": 5
511 "rev": 5
512 },
512 },
513 {
513 {
514 "active": false,
514 "active": false,
515 "branch": "default",
515 "branch": "default",
516 "closed": false,
516 "closed": false,
517 "current": false,
517 "current": false,
518 "node": "19709c5a4e75bf938f8e349aff97438539bb729e",
518 "node": "19709c5a4e75bf938f8e349aff97438539bb729e",
519 "rev": 0
519 "rev": 0
520 }
520 }
521 ]
521 ]
522
522
523 revision branch name caching implementation
523
524 Tests of revision branch name caching
525
526 We rev branch cache is updated automatically. In these tests we use a trick to
527 trigger rebuilds. We remove the branch head cache and run 'hg head' to cause a
528 rebuild that also will populate the rev branch cache.
524
529
525 cache creation
530 revision branch cache is created when building the branch head cache
526 $ rm .hg/cache/rbc-revs-v1
531 $ rm -rf .hg/cache; hg head a -T '{rev}\n'
527 $ hg debugrevspec 'branch("re:a ")'
532 5
528 7
533 $ f --hexdump --size .hg/cache/rbc-*
529 $ [ -f .hg/cache/rbc-revs-v1 ] || echo no file
534 .hg/cache/rbc-names-v1: size=87
530 no file
535 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a |
531 recovery from invalid cache file
536 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much|
532 $ echo > .hg/cache/rbc-revs-v1
537 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the|
533 $ hg debugrevspec 'branch("re:a ")'
538 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi|
534 7
539 0040: 63 61 74 69 6f 6e 20 75 73 65 64 20 62 79 20 62 |cation used by b|
535 cache update NOT fully written from revset
540 0050: 72 61 6e 63 68 65 73 |ranches|
536 $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
541 .hg/cache/rbc-revs-v1: size=120
537 68b329da9893e34099c7d8ad5cb9c940 .hg/cache/rbc-revs-v1
542 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
538 recovery from other corruption - extra trailing data
543 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....|
544 0020: ae e3 9c d1 00 00 00 02 d8 cb c6 1d 00 00 00 01 |................|
545 0030: 58 97 36 a2 00 00 00 03 10 ff 58 95 00 00 00 04 |X.6.......X.....|
546 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....|
547 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....|
548 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....|
549 0070: f8 94 c2 56 80 00 00 03 |...V....|
550 recovery from invalid cache revs file with trailing data
539 $ echo >> .hg/cache/rbc-revs-v1
551 $ echo >> .hg/cache/rbc-revs-v1
540 $ hg debugrevspec 'branch("re:a ")'
552 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
541 7
553 5
542 cache update NOT fully written from revset
554 $ f --size .hg/cache/rbc-revs*
543 $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
555 .hg/cache/rbc-revs-v1: size=120
544 e1c06d85ae7b8b032bef47e42e4c08f9 .hg/cache/rbc-revs-v1
556 recovery from invalid cache file with partial last record
545 lazy update after commit
557 $ mv .hg/cache/rbc-revs-v1 .
546 $ hg tag tag
558 $ f -qDB 119 rbc-revs-v1 > .hg/cache/rbc-revs-v1
547 $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
559 $ f --size .hg/cache/rbc-revs*
548 d0c0166808ee0a1f0e8894915ad363b6 .hg/cache/rbc-revs-v1
560 .hg/cache/rbc-revs-v1: size=119
549 $ hg debugrevspec 'branch("re:a ")'
561 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
550 7
562 5
551 $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
563 $ f --size .hg/cache/rbc-revs*
552 d0c0166808ee0a1f0e8894915ad363b6 .hg/cache/rbc-revs-v1
564 .hg/cache/rbc-revs-v1: size=120
553 update after rollback - cache keeps stripped revs until written for other reasons
565 recovery from invalid cache file with missing record - no truncation
566 $ mv .hg/cache/rbc-revs-v1 .
567 $ f -qDB 112 rbc-revs-v1 > .hg/cache/rbc-revs-v1
568 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
569 5
570 $ f --size .hg/cache/rbc-revs*
571 .hg/cache/rbc-revs-v1: size=120
572 recovery from invalid cache file with some bad records
573 $ mv .hg/cache/rbc-revs-v1 .
574 $ f -qDB 8 rbc-revs-v1 > .hg/cache/rbc-revs-v1
575 $ f --size .hg/cache/rbc-revs*
576 .hg/cache/rbc-revs-v1: size=8
577 $ f -qDB 112 rbc-revs-v1 >> .hg/cache/rbc-revs-v1
578 $ f --size .hg/cache/rbc-revs*
579 .hg/cache/rbc-revs-v1: size=120
580 $ hg log -r 'branch(.)' -T '{rev} '
581 3 4 8 9 10 11 12 13 (no-eol)
582 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
583 5
584 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs*
585 .hg/cache/rbc-revs-v1: size=120
586 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
587 cache is updated when committing
588 $ hg branch i-will-regret-this
589 marked working directory as branch i-will-regret-this
590 (branches are permanent and global, did you want a bookmark?)
591 $ hg ci -m regrets
592 $ f --size .hg/cache/rbc-*
593 .hg/cache/rbc-names-v1: size=106
594 .hg/cache/rbc-revs-v1: size=128
595 update after rollback - the cache will be correct but rbc-names will will still
596 contain the branch name even though it no longer is used
554 $ hg up -qr '.^'
597 $ hg up -qr '.^'
555 $ hg rollback -qf
598 $ hg rollback -qf
556 $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
599 $ f --size --hexdump .hg/cache/rbc-*
557 d8c2acdc229bf942fde1dfdbe8f9d933 .hg/cache/rbc-revs-v1
600 .hg/cache/rbc-names-v1: size=106
558 $ hg debugrevspec 'branch("re:a ")'
601 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a |
559 7
602 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much|
560 $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
603 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the|
561 d8c2acdc229bf942fde1dfdbe8f9d933 .hg/cache/rbc-revs-v1
604 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi|
562 handle history mutations that doesn't change the tip node - this is a problem
605 0040: 63 61 74 69 6f 6e 20 75 73 65 64 20 62 79 20 62 |cation used by b|
563 with the cache invalidation scheme used by branchmap
606 0050: 72 61 6e 63 68 65 73 00 69 2d 77 69 6c 6c 2d 72 |ranches.i-will-r|
564 $ hg log -r tip+b -T'{rev}:{node|short} {branch}\n'
607 0060: 65 67 72 65 74 2d 74 68 69 73 |egret-this|
565 14:f894c25619d3 c
608 .hg/cache/rbc-revs-v1: size=120
566 13:e23b5505d1ad b
609 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
567 $ hg bundle -q --all bu.hg
610 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....|
568 $ hg --config extensions.strip= strip --no-b -qr -1:
611 0020: ae e3 9c d1 00 00 00 02 d8 cb c6 1d 00 00 00 01 |................|
569 $ hg up -q tip
612 0030: 58 97 36 a2 00 00 00 03 10 ff 58 95 00 00 00 04 |X.6.......X.....|
570 $ hg branch
613 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....|
571 b
614 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....|
572 $ hg branch -q hacked
615 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....|
573 $ hg ci --amend -qm 'hacked'
616 0070: f8 94 c2 56 80 00 00 03 |...V....|
574 $ hg pull -q bu.hg -r f894c25619d3
617 cache is updated/truncated when stripping - it is thus very hard to get in a
575 $ hg log -r tip+b -T'{rev}:{node|short} {branch}\n'
618 situation where the cache is out of sync and the hash check detects it
576 14:f894c25619d3 c
619 $ hg --config extensions.strip= strip -r tip --nob
577 12:e3d49c0575d8 b
620 $ f --size .hg/cache/rbc-revs*
578 $ hg debugrevspec 'branch("hacked")'
621 .hg/cache/rbc-revs-v1: size=112
579 13
580 $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
581 22424d7e106c894336d9d705b0241bc5 .hg/cache/rbc-revs-v1
582 cleanup, restore old state
583 $ hg --config extensions.strip= strip --no-b -qr -2:
584 $ hg pull -q bu.hg
585 $ rm bu.hg
586 $ hg up -qr tip
587 $ hg log -r tip -T'{rev}:{node|short}\n'
588 14:f894c25619d3
589 the cache file do not go back to the old state - it still contains the
590 now unused 'hacked' branch name)
591 $ hg debugrevspec 'branch("re:a ")'
592 7
593 $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
594 d8c2acdc229bf942fde1dfdbe8f9d933 .hg/cache/rbc-revs-v1
595 $ cat .hg/cache/rbc-names-v1
596 default\x00a\x00b\x00c\x00a branch name much longer than the default justification used by branches\x00hacked (no-eol) (esc)
597
622
598 $ cd ..
623 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now