##// END OF EJS Templates
branchcache: simplify the branch rev cache test...
marmoute -
r52423:fc710c99 default
parent child Browse files
Show More
@@ -1,1409 +1,1375
1 #testcases mmap nommap
1 #testcases mmap nommap
2 #testcases v2 v3
2 #testcases v2 v3
3
3
4 #if mmap
4 #if mmap
5 $ cat <<EOF >> $HGRCPATH
5 $ cat <<EOF >> $HGRCPATH
6 > [storage]
6 > [storage]
7 > revbranchcache.mmap=true
7 > revbranchcache.mmap=true
8 > EOF
8 > EOF
9 #endif
9 #endif
10
10
11 #if v3
11 #if v3
12 $ cat <<EOF >> $HGRCPATH
12 $ cat <<EOF >> $HGRCPATH
13 > [experimental]
13 > [experimental]
14 > branch-cache-v3=yes
14 > branch-cache-v3=yes
15 > EOF
15 > EOF
16 #else
16 #else
17 $ cat <<EOF >> $HGRCPATH
17 $ cat <<EOF >> $HGRCPATH
18 > [experimental]
18 > [experimental]
19 > branch-cache-v3=no
19 > branch-cache-v3=no
20 > EOF
20 > EOF
21 #endif
21 #endif
22
22
23 $ hg init a
23 $ hg init a
24 $ cd a
24 $ cd a
25
25
26 Verify checking branch of nullrev before the cache is created doesnt crash
26 Verify checking branch of nullrev before the cache is created doesnt crash
27 $ hg log -r 'branch(.)' -T '{branch}\n'
27 $ hg log -r 'branch(.)' -T '{branch}\n'
28
28
29 Basic test
29 Basic test
30 $ echo 'root' >root
30 $ echo 'root' >root
31 $ hg add root
31 $ hg add root
32 $ hg commit -d '0 0' -m "Adding root node"
32 $ hg commit -d '0 0' -m "Adding root node"
33
33
34 $ echo 'a' >a
34 $ echo 'a' >a
35 $ hg add a
35 $ hg add a
36 $ hg branch a
36 $ hg branch a
37 marked working directory as branch a
37 marked working directory as branch a
38 (branches are permanent and global, did you want a bookmark?)
38 (branches are permanent and global, did you want a bookmark?)
39 $ hg commit -d '1 0' -m "Adding a branch"
39 $ hg commit -d '1 0' -m "Adding a branch"
40
40
41 $ hg branch q
41 $ hg branch q
42 marked working directory as branch q
42 marked working directory as branch q
43 $ echo 'aa' >a
43 $ echo 'aa' >a
44 $ hg branch -C
44 $ hg branch -C
45 reset working directory to branch a
45 reset working directory to branch a
46 $ hg commit -d '2 0' -m "Adding to a branch"
46 $ hg commit -d '2 0' -m "Adding to a branch"
47
47
48 $ hg update -C 0
48 $ hg update -C 0
49 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
49 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
50 $ echo 'b' >b
50 $ echo 'b' >b
51 $ hg add b
51 $ hg add b
52 $ hg branch b
52 $ hg branch b
53 marked working directory as branch b
53 marked working directory as branch b
54 $ hg commit -d '2 0' -m "Adding b branch"
54 $ hg commit -d '2 0' -m "Adding b branch"
55
55
56 $ echo 'bh1' >bh1
56 $ echo 'bh1' >bh1
57 $ hg add bh1
57 $ hg add bh1
58 $ hg commit -d '3 0' -m "Adding b branch head 1"
58 $ hg commit -d '3 0' -m "Adding b branch head 1"
59
59
60 $ hg update -C 2
60 $ hg update -C 2
61 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
61 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
62 $ echo 'bh2' >bh2
62 $ echo 'bh2' >bh2
63 $ hg add bh2
63 $ hg add bh2
64 $ hg commit -d '4 0' -m "Adding b branch head 2"
64 $ hg commit -d '4 0' -m "Adding b branch head 2"
65
65
66 $ echo 'c' >c
66 $ echo 'c' >c
67 $ hg add c
67 $ hg add c
68 $ hg branch c
68 $ hg branch c
69 marked working directory as branch c
69 marked working directory as branch c
70 $ hg commit -d '5 0' -m "Adding c branch"
70 $ hg commit -d '5 0' -m "Adding c branch"
71
71
72 reserved names
72 reserved names
73
73
74 $ hg branch tip
74 $ hg branch tip
75 abort: the name 'tip' is reserved
75 abort: the name 'tip' is reserved
76 [10]
76 [10]
77 $ hg branch null
77 $ hg branch null
78 abort: the name 'null' is reserved
78 abort: the name 'null' is reserved
79 [10]
79 [10]
80 $ hg branch .
80 $ hg branch .
81 abort: the name '.' is reserved
81 abort: the name '.' is reserved
82 [10]
82 [10]
83
83
84 invalid characters
84 invalid characters
85
85
86 $ hg branch 'foo:bar'
86 $ hg branch 'foo:bar'
87 abort: ':' cannot be used in a name
87 abort: ':' cannot be used in a name
88 [10]
88 [10]
89
89
90 $ hg branch 'foo
90 $ hg branch 'foo
91 > bar'
91 > bar'
92 abort: '\n' cannot be used in a name
92 abort: '\n' cannot be used in a name
93 [10]
93 [10]
94
94
95 trailing or leading spaces should be stripped before testing duplicates
95 trailing or leading spaces should be stripped before testing duplicates
96
96
97 $ hg branch 'b '
97 $ hg branch 'b '
98 abort: a branch of the same name already exists
98 abort: a branch of the same name already exists
99 (use 'hg update' to switch to it)
99 (use 'hg update' to switch to it)
100 [10]
100 [10]
101
101
102 $ hg branch ' b'
102 $ hg branch ' b'
103 abort: a branch of the same name already exists
103 abort: a branch of the same name already exists
104 (use 'hg update' to switch to it)
104 (use 'hg update' to switch to it)
105 [10]
105 [10]
106
106
107 underscores in numeric branch names (issue6737)
107 underscores in numeric branch names (issue6737)
108
108
109 $ hg branch 2700_210
109 $ hg branch 2700_210
110 marked working directory as branch 2700_210
110 marked working directory as branch 2700_210
111
111
112 verify update will accept invalid legacy branch names
112 verify update will accept invalid legacy branch names
113
113
114 $ hg init test-invalid-branch-name
114 $ hg init test-invalid-branch-name
115 $ cd test-invalid-branch-name
115 $ cd test-invalid-branch-name
116 $ hg unbundle -u "$TESTDIR"/bundles/test-invalid-branch-name.hg
116 $ hg unbundle -u "$TESTDIR"/bundles/test-invalid-branch-name.hg
117 adding changesets
117 adding changesets
118 adding manifests
118 adding manifests
119 adding file changes
119 adding file changes
120 added 3 changesets with 3 changes to 2 files
120 added 3 changesets with 3 changes to 2 files
121 new changesets f0e4c7f04036:33c2ceb9310b (3 drafts)
121 new changesets f0e4c7f04036:33c2ceb9310b (3 drafts)
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
123
123
124 $ hg update '"colon:test"'
124 $ hg update '"colon:test"'
125 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
125 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 $ cd ..
126 $ cd ..
127
127
128 $ echo 'd' >d
128 $ echo 'd' >d
129 $ hg add d
129 $ hg add d
130 $ hg branch 'a branch name much longer than the default justification used by branches'
130 $ hg branch 'a branch name much longer than the default justification used by branches'
131 marked working directory as branch a branch name much longer than the default justification used by branches
131 marked working directory as branch a branch name much longer than the default justification used by branches
132 $ hg commit -d '6 0' -m "Adding d branch"
132 $ hg commit -d '6 0' -m "Adding d branch"
133
133
134 $ hg branches
134 $ hg branches
135 a branch name much longer than the default justification used by branches 7:10ff5895aa57
135 a branch name much longer than the default justification used by branches 7:10ff5895aa57
136 b 4:aee39cd168d0
136 b 4:aee39cd168d0
137 c 6:589736a22561 (inactive)
137 c 6:589736a22561 (inactive)
138 a 5:d8cbc61dbaa6 (inactive)
138 a 5:d8cbc61dbaa6 (inactive)
139 default 0:19709c5a4e75 (inactive)
139 default 0:19709c5a4e75 (inactive)
140
140
141 -------
141 -------
142
142
143 $ hg branches -a
143 $ hg branches -a
144 a branch name much longer than the default justification used by branches 7:10ff5895aa57
144 a branch name much longer than the default justification used by branches 7:10ff5895aa57
145 b 4:aee39cd168d0
145 b 4:aee39cd168d0
146
146
147 --- Branch a
147 --- Branch a
148
148
149 $ hg log -b a
149 $ hg log -b a
150 changeset: 5:d8cbc61dbaa6
150 changeset: 5:d8cbc61dbaa6
151 branch: a
151 branch: a
152 parent: 2:881fe2b92ad0
152 parent: 2:881fe2b92ad0
153 user: test
153 user: test
154 date: Thu Jan 01 00:00:04 1970 +0000
154 date: Thu Jan 01 00:00:04 1970 +0000
155 summary: Adding b branch head 2
155 summary: Adding b branch head 2
156
156
157 changeset: 2:881fe2b92ad0
157 changeset: 2:881fe2b92ad0
158 branch: a
158 branch: a
159 user: test
159 user: test
160 date: Thu Jan 01 00:00:02 1970 +0000
160 date: Thu Jan 01 00:00:02 1970 +0000
161 summary: Adding to a branch
161 summary: Adding to a branch
162
162
163 changeset: 1:dd6b440dd85a
163 changeset: 1:dd6b440dd85a
164 branch: a
164 branch: a
165 user: test
165 user: test
166 date: Thu Jan 01 00:00:01 1970 +0000
166 date: Thu Jan 01 00:00:01 1970 +0000
167 summary: Adding a branch
167 summary: Adding a branch
168
168
169
169
170 ---- Branch b
170 ---- Branch b
171
171
172 $ hg log -b b
172 $ hg log -b b
173 changeset: 4:aee39cd168d0
173 changeset: 4:aee39cd168d0
174 branch: b
174 branch: b
175 user: test
175 user: test
176 date: Thu Jan 01 00:00:03 1970 +0000
176 date: Thu Jan 01 00:00:03 1970 +0000
177 summary: Adding b branch head 1
177 summary: Adding b branch head 1
178
178
179 changeset: 3:ac22033332d1
179 changeset: 3:ac22033332d1
180 branch: b
180 branch: b
181 parent: 0:19709c5a4e75
181 parent: 0:19709c5a4e75
182 user: test
182 user: test
183 date: Thu Jan 01 00:00:02 1970 +0000
183 date: Thu Jan 01 00:00:02 1970 +0000
184 summary: Adding b branch
184 summary: Adding b branch
185
185
186
186
187 ---- going to test branch listing by rev
187 ---- going to test branch listing by rev
188 $ hg branches -r0
188 $ hg branches -r0
189 default 0:19709c5a4e75 (inactive)
189 default 0:19709c5a4e75 (inactive)
190 $ hg branches -qr0
190 $ hg branches -qr0
191 default
191 default
192 --- now more than one rev
192 --- now more than one rev
193 $ hg branches -r2:5
193 $ hg branches -r2:5
194 b 4:aee39cd168d0
194 b 4:aee39cd168d0
195 a 5:d8cbc61dbaa6 (inactive)
195 a 5:d8cbc61dbaa6 (inactive)
196 $ hg branches -qr2:5
196 $ hg branches -qr2:5
197 b
197 b
198 a
198 a
199 ---- going to test branch closing
199 ---- going to test branch closing
200
200
201 $ hg branches
201 $ hg branches
202 a branch name much longer than the default justification used by branches 7:10ff5895aa57
202 a branch name much longer than the default justification used by branches 7:10ff5895aa57
203 b 4:aee39cd168d0
203 b 4:aee39cd168d0
204 c 6:589736a22561 (inactive)
204 c 6:589736a22561 (inactive)
205 a 5:d8cbc61dbaa6 (inactive)
205 a 5:d8cbc61dbaa6 (inactive)
206 default 0:19709c5a4e75 (inactive)
206 default 0:19709c5a4e75 (inactive)
207 $ hg up -C b
207 $ hg up -C b
208 2 files updated, 0 files merged, 4 files removed, 0 files unresolved
208 2 files updated, 0 files merged, 4 files removed, 0 files unresolved
209 $ echo 'xxx1' >> b
209 $ echo 'xxx1' >> b
210 $ hg commit -d '7 0' -m 'adding cset to branch b'
210 $ hg commit -d '7 0' -m 'adding cset to branch b'
211 $ hg up -C aee39cd168d0
211 $ hg up -C aee39cd168d0
212 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
212 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
213 $ echo 'xxx2' >> b
213 $ echo 'xxx2' >> b
214 $ hg commit -d '8 0' -m 'adding head to branch b'
214 $ hg commit -d '8 0' -m 'adding head to branch b'
215 created new head
215 created new head
216 $ echo 'xxx3' >> b
216 $ echo 'xxx3' >> b
217 $ hg commit -d '9 0' -m 'adding another cset to branch b'
217 $ hg commit -d '9 0' -m 'adding another cset to branch b'
218 $ hg branches
218 $ hg branches
219 b 10:bfbe841b666e
219 b 10:bfbe841b666e
220 a branch name much longer than the default justification used by branches 7:10ff5895aa57
220 a branch name much longer than the default justification used by branches 7:10ff5895aa57
221 c 6:589736a22561 (inactive)
221 c 6:589736a22561 (inactive)
222 a 5:d8cbc61dbaa6 (inactive)
222 a 5:d8cbc61dbaa6 (inactive)
223 default 0:19709c5a4e75 (inactive)
223 default 0:19709c5a4e75 (inactive)
224 $ hg heads --closed
224 $ hg heads --closed
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 heads
263 $ hg heads
264 changeset: 10:bfbe841b666e
264 changeset: 10:bfbe841b666e
265 branch: b
265 branch: b
266 tag: tip
266 tag: tip
267 user: test
267 user: test
268 date: Thu Jan 01 00:00:09 1970 +0000
268 date: Thu Jan 01 00:00:09 1970 +0000
269 summary: adding another cset to branch b
269 summary: adding another cset to branch b
270
270
271 changeset: 8:eebb944467c9
271 changeset: 8:eebb944467c9
272 branch: b
272 branch: b
273 parent: 4:aee39cd168d0
273 parent: 4:aee39cd168d0
274 user: test
274 user: test
275 date: Thu Jan 01 00:00:07 1970 +0000
275 date: Thu Jan 01 00:00:07 1970 +0000
276 summary: adding cset to branch b
276 summary: adding cset to branch b
277
277
278 changeset: 7:10ff5895aa57
278 changeset: 7:10ff5895aa57
279 branch: a branch name much longer than the default justification used by branches
279 branch: a branch name much longer than the default justification used by branches
280 user: test
280 user: test
281 date: Thu Jan 01 00:00:06 1970 +0000
281 date: Thu Jan 01 00:00:06 1970 +0000
282 summary: Adding d branch
282 summary: Adding d branch
283
283
284 changeset: 6:589736a22561
284 changeset: 6:589736a22561
285 branch: c
285 branch: c
286 user: test
286 user: test
287 date: Thu Jan 01 00:00:05 1970 +0000
287 date: Thu Jan 01 00:00:05 1970 +0000
288 summary: Adding c branch
288 summary: Adding c branch
289
289
290 changeset: 5:d8cbc61dbaa6
290 changeset: 5:d8cbc61dbaa6
291 branch: a
291 branch: a
292 parent: 2:881fe2b92ad0
292 parent: 2:881fe2b92ad0
293 user: test
293 user: test
294 date: Thu Jan 01 00:00:04 1970 +0000
294 date: Thu Jan 01 00:00:04 1970 +0000
295 summary: Adding b branch head 2
295 summary: Adding b branch head 2
296
296
297 changeset: 0:19709c5a4e75
297 changeset: 0:19709c5a4e75
298 user: test
298 user: test
299 date: Thu Jan 01 00:00:00 1970 +0000
299 date: Thu Jan 01 00:00:00 1970 +0000
300 summary: Adding root node
300 summary: Adding root node
301
301
302 $ hg commit -d '9 0' --close-branch -m 'prune bad branch'
302 $ hg commit -d '9 0' --close-branch -m 'prune bad branch'
303 $ hg branches -a
303 $ hg branches -a
304 b 8:eebb944467c9
304 b 8:eebb944467c9
305 a branch name much longer than the default justification used by branches 7:10ff5895aa57
305 a branch name much longer than the default justification used by branches 7:10ff5895aa57
306 $ hg up -C b
306 $ hg up -C b
307 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
307 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
308 $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
308 $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
309 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
309 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
310 abort: current revision is already a branch closing head
310 abort: current revision is already a branch closing head
311 [10]
311 [10]
312
312
313 $ echo foo > b
313 $ echo foo > b
314 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
314 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
315
315
316 $ echo bar > b
316 $ echo bar > b
317 $ hg commit -d '9 0' --close-branch -m 're-closing this branch' bh1
317 $ hg commit -d '9 0' --close-branch -m 're-closing this branch' bh1
318 abort: current revision is already a branch closing head
318 abort: current revision is already a branch closing head
319 [10]
319 [10]
320 $ hg commit -d '9 0' --close-branch -m 're-closing this branch' b
320 $ hg commit -d '9 0' --close-branch -m 're-closing this branch' b
321
321
322 $ echo baz > b
322 $ echo baz > b
323 $ hg commit -d '9 0' --close-branch -m 'empty re-closing this branch' -X b
323 $ hg commit -d '9 0' --close-branch -m 'empty re-closing this branch' -X b
324 abort: current revision is already a branch closing head
324 abort: current revision is already a branch closing head
325 [10]
325 [10]
326 $ hg revert b
326 $ hg revert b
327
327
328 $ hg debugstrip --rev 13: --no-backup
328 $ hg debugstrip --rev 13: --no-backup
329 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
329 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 $ hg revert --all --no-backup
330 $ hg revert --all --no-backup
331
331
332 $ hg log -r tip --debug
332 $ hg log -r tip --debug
333 changeset: 12:e3d49c0575d8fc2cb1cd6859c747c14f5f6d499f
333 changeset: 12:e3d49c0575d8fc2cb1cd6859c747c14f5f6d499f
334 branch: b
334 branch: b
335 tag: tip
335 tag: tip
336 phase: draft
336 phase: draft
337 parent: 8:eebb944467c9fb9651ed232aeaf31b3c0a7fc6c1
337 parent: 8:eebb944467c9fb9651ed232aeaf31b3c0a7fc6c1
338 parent: -1:0000000000000000000000000000000000000000
338 parent: -1:0000000000000000000000000000000000000000
339 manifest: 8:6f9ed32d2b310e391a4f107d5f0f071df785bfee
339 manifest: 8:6f9ed32d2b310e391a4f107d5f0f071df785bfee
340 user: test
340 user: test
341 date: Thu Jan 01 00:00:09 1970 +0000
341 date: Thu Jan 01 00:00:09 1970 +0000
342 extra: branch=b
342 extra: branch=b
343 extra: close=1
343 extra: close=1
344 description:
344 description:
345 close this part branch too
345 close this part branch too
346
346
347
347
348 --- b branch should be inactive
348 --- b branch should be inactive
349
349
350 $ hg branches
350 $ hg branches
351 a branch name much longer than the default justification used by branches 7:10ff5895aa57
351 a branch name much longer than the default justification used by branches 7:10ff5895aa57
352 c 6:589736a22561 (inactive)
352 c 6:589736a22561 (inactive)
353 a 5:d8cbc61dbaa6 (inactive)
353 a 5:d8cbc61dbaa6 (inactive)
354 default 0:19709c5a4e75 (inactive)
354 default 0:19709c5a4e75 (inactive)
355 $ hg branches -c
355 $ hg branches -c
356 a branch name much longer than the default justification used by branches 7:10ff5895aa57
356 a branch name much longer than the default justification used by branches 7:10ff5895aa57
357 b 12:e3d49c0575d8 (closed)
357 b 12:e3d49c0575d8 (closed)
358 c 6:589736a22561 (inactive)
358 c 6:589736a22561 (inactive)
359 a 5:d8cbc61dbaa6 (inactive)
359 a 5:d8cbc61dbaa6 (inactive)
360 default 0:19709c5a4e75 (inactive)
360 default 0:19709c5a4e75 (inactive)
361 $ hg branches -a
361 $ hg branches -a
362 a branch name much longer than the default justification used by branches 7:10ff5895aa57
362 a branch name much longer than the default justification used by branches 7:10ff5895aa57
363 $ hg branches -q
363 $ hg branches -q
364 a branch name much longer than the default justification used by branches
364 a branch name much longer than the default justification used by branches
365 c
365 c
366 a
366 a
367 default
367 default
368 $ hg heads b
368 $ hg heads b
369 no open branch heads found on branches b
369 no open branch heads found on branches b
370 [1]
370 [1]
371 $ hg heads --closed b
371 $ hg heads --closed b
372 changeset: 12:e3d49c0575d8
372 changeset: 12:e3d49c0575d8
373 branch: b
373 branch: b
374 tag: tip
374 tag: tip
375 parent: 8:eebb944467c9
375 parent: 8:eebb944467c9
376 user: test
376 user: test
377 date: Thu Jan 01 00:00:09 1970 +0000
377 date: Thu Jan 01 00:00:09 1970 +0000
378 summary: close this part branch too
378 summary: close this part branch too
379
379
380 changeset: 11:d3f163457ebf
380 changeset: 11:d3f163457ebf
381 branch: b
381 branch: b
382 user: test
382 user: test
383 date: Thu Jan 01 00:00:09 1970 +0000
383 date: Thu Jan 01 00:00:09 1970 +0000
384 summary: prune bad branch
384 summary: prune bad branch
385
385
386 $ echo 'xxx4' >> b
386 $ echo 'xxx4' >> b
387 $ hg commit -d '9 0' -m 'reopen branch with a change'
387 $ hg commit -d '9 0' -m 'reopen branch with a change'
388 reopening closed branch head 12
388 reopening closed branch head 12
389
389
390 --- branch b is back in action
390 --- branch b is back in action
391
391
392 $ hg branches -a
392 $ hg branches -a
393 b 13:e23b5505d1ad
393 b 13:e23b5505d1ad
394 a branch name much longer than the default justification used by branches 7:10ff5895aa57
394 a branch name much longer than the default justification used by branches 7:10ff5895aa57
395
395
396 ---- test heads listings
396 ---- test heads listings
397
397
398 $ hg heads
398 $ hg heads
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 changeset: 7:10ff5895aa57
406 changeset: 7:10ff5895aa57
407 branch: a branch name much longer than the default justification used by branches
407 branch: a branch name much longer than the default justification used by branches
408 user: test
408 user: test
409 date: Thu Jan 01 00:00:06 1970 +0000
409 date: Thu Jan 01 00:00:06 1970 +0000
410 summary: Adding d branch
410 summary: Adding d branch
411
411
412 changeset: 6:589736a22561
412 changeset: 6:589736a22561
413 branch: c
413 branch: c
414 user: test
414 user: test
415 date: Thu Jan 01 00:00:05 1970 +0000
415 date: Thu Jan 01 00:00:05 1970 +0000
416 summary: Adding c branch
416 summary: Adding c branch
417
417
418 changeset: 5:d8cbc61dbaa6
418 changeset: 5:d8cbc61dbaa6
419 branch: a
419 branch: a
420 parent: 2:881fe2b92ad0
420 parent: 2:881fe2b92ad0
421 user: test
421 user: test
422 date: Thu Jan 01 00:00:04 1970 +0000
422 date: Thu Jan 01 00:00:04 1970 +0000
423 summary: Adding b branch head 2
423 summary: Adding b branch head 2
424
424
425 changeset: 0:19709c5a4e75
425 changeset: 0:19709c5a4e75
426 user: test
426 user: test
427 date: Thu Jan 01 00:00:00 1970 +0000
427 date: Thu Jan 01 00:00:00 1970 +0000
428 summary: Adding root node
428 summary: Adding root node
429
429
430
430
431 branch default
431 branch default
432
432
433 $ hg heads default
433 $ hg heads default
434 changeset: 0:19709c5a4e75
434 changeset: 0:19709c5a4e75
435 user: test
435 user: test
436 date: Thu Jan 01 00:00:00 1970 +0000
436 date: Thu Jan 01 00:00:00 1970 +0000
437 summary: Adding root node
437 summary: Adding root node
438
438
439
439
440 branch a
440 branch a
441
441
442 $ hg heads a
442 $ hg heads a
443 changeset: 5:d8cbc61dbaa6
443 changeset: 5:d8cbc61dbaa6
444 branch: a
444 branch: a
445 parent: 2:881fe2b92ad0
445 parent: 2:881fe2b92ad0
446 user: test
446 user: test
447 date: Thu Jan 01 00:00:04 1970 +0000
447 date: Thu Jan 01 00:00:04 1970 +0000
448 summary: Adding b branch head 2
448 summary: Adding b branch head 2
449
449
450 $ hg heads --active a
450 $ hg heads --active a
451 no open branch heads found on branches a
451 no open branch heads found on branches a
452 [1]
452 [1]
453
453
454 branch b
454 branch b
455
455
456 $ hg heads b
456 $ hg heads b
457 changeset: 13:e23b5505d1ad
457 changeset: 13:e23b5505d1ad
458 branch: b
458 branch: b
459 tag: tip
459 tag: tip
460 user: test
460 user: test
461 date: Thu Jan 01 00:00:09 1970 +0000
461 date: Thu Jan 01 00:00:09 1970 +0000
462 summary: reopen branch with a change
462 summary: reopen branch with a change
463
463
464 $ hg heads --closed b
464 $ hg heads --closed b
465 changeset: 13:e23b5505d1ad
465 changeset: 13:e23b5505d1ad
466 branch: b
466 branch: b
467 tag: tip
467 tag: tip
468 user: test
468 user: test
469 date: Thu Jan 01 00:00:09 1970 +0000
469 date: Thu Jan 01 00:00:09 1970 +0000
470 summary: reopen branch with a change
470 summary: reopen branch with a change
471
471
472 changeset: 11:d3f163457ebf
472 changeset: 11:d3f163457ebf
473 branch: b
473 branch: b
474 user: test
474 user: test
475 date: Thu Jan 01 00:00:09 1970 +0000
475 date: Thu Jan 01 00:00:09 1970 +0000
476 summary: prune bad branch
476 summary: prune bad branch
477
477
478
478
479 reclose branch
479 reclose branch
480
480
481 $ hg up -C c
481 $ hg up -C c
482 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
482 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
483 $ hg commit -d '9 0' --close-branch -m 'reclosing this branch'
483 $ hg commit -d '9 0' --close-branch -m 'reclosing this branch'
484 $ hg branches
484 $ hg branches
485 b 13:e23b5505d1ad
485 b 13:e23b5505d1ad
486 a branch name much longer than the default justification used by branches 7:10ff5895aa57
486 a branch name much longer than the default justification used by branches 7:10ff5895aa57
487 a 5:d8cbc61dbaa6 (inactive)
487 a 5:d8cbc61dbaa6 (inactive)
488 default 0:19709c5a4e75 (inactive)
488 default 0:19709c5a4e75 (inactive)
489 $ hg branches --closed
489 $ hg branches --closed
490 b 13:e23b5505d1ad
490 b 13:e23b5505d1ad
491 a branch name much longer than the default justification used by branches 7:10ff5895aa57
491 a branch name much longer than the default justification used by branches 7:10ff5895aa57
492 c 14:f894c25619d3 (closed)
492 c 14:f894c25619d3 (closed)
493 a 5:d8cbc61dbaa6 (inactive)
493 a 5:d8cbc61dbaa6 (inactive)
494 default 0:19709c5a4e75 (inactive)
494 default 0:19709c5a4e75 (inactive)
495
495
496 multihead branch
496 multihead branch
497
497
498 $ hg up -C default
498 $ hg up -C default
499 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
499 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
500 $ hg branch m
500 $ hg branch m
501 marked working directory as branch m
501 marked working directory as branch m
502 $ touch m
502 $ touch m
503 $ hg add m
503 $ hg add m
504 $ hg commit -d '10 0' -m 'multihead base'
504 $ hg commit -d '10 0' -m 'multihead base'
505 $ echo "m1" >m
505 $ echo "m1" >m
506 $ hg commit -d '10 0' -m 'head 1'
506 $ hg commit -d '10 0' -m 'head 1'
507 $ hg up -C '.^'
507 $ hg up -C '.^'
508 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
508 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
509 $ echo "m2" >m
509 $ echo "m2" >m
510 $ hg commit -d '10 0' -m 'head 2'
510 $ hg commit -d '10 0' -m 'head 2'
511 created new head
511 created new head
512 $ hg log -b m
512 $ hg log -b m
513 changeset: 17:df343b0df04f
513 changeset: 17:df343b0df04f
514 branch: m
514 branch: m
515 tag: tip
515 tag: tip
516 parent: 15:f3447637f53e
516 parent: 15:f3447637f53e
517 user: test
517 user: test
518 date: Thu Jan 01 00:00:10 1970 +0000
518 date: Thu Jan 01 00:00:10 1970 +0000
519 summary: head 2
519 summary: head 2
520
520
521 changeset: 16:a58ca5d3bdf3
521 changeset: 16:a58ca5d3bdf3
522 branch: m
522 branch: m
523 user: test
523 user: test
524 date: Thu Jan 01 00:00:10 1970 +0000
524 date: Thu Jan 01 00:00:10 1970 +0000
525 summary: head 1
525 summary: head 1
526
526
527 changeset: 15:f3447637f53e
527 changeset: 15:f3447637f53e
528 branch: m
528 branch: m
529 parent: 0:19709c5a4e75
529 parent: 0:19709c5a4e75
530 user: test
530 user: test
531 date: Thu Jan 01 00:00:10 1970 +0000
531 date: Thu Jan 01 00:00:10 1970 +0000
532 summary: multihead base
532 summary: multihead base
533
533
534 $ hg heads --topo m
534 $ hg heads --topo m
535 changeset: 17:df343b0df04f
535 changeset: 17:df343b0df04f
536 branch: m
536 branch: m
537 tag: tip
537 tag: tip
538 parent: 15:f3447637f53e
538 parent: 15:f3447637f53e
539 user: test
539 user: test
540 date: Thu Jan 01 00:00:10 1970 +0000
540 date: Thu Jan 01 00:00:10 1970 +0000
541 summary: head 2
541 summary: head 2
542
542
543 changeset: 16:a58ca5d3bdf3
543 changeset: 16:a58ca5d3bdf3
544 branch: m
544 branch: m
545 user: test
545 user: test
546 date: Thu Jan 01 00:00:10 1970 +0000
546 date: Thu Jan 01 00:00:10 1970 +0000
547 summary: head 1
547 summary: head 1
548
548
549 $ hg branches
549 $ hg branches
550 m 17:df343b0df04f
550 m 17:df343b0df04f
551 b 13:e23b5505d1ad
551 b 13:e23b5505d1ad
552 a branch name much longer than the default justification used by branches 7:10ff5895aa57
552 a branch name much longer than the default justification used by branches 7:10ff5895aa57
553 a 5:d8cbc61dbaa6 (inactive)
553 a 5:d8cbc61dbaa6 (inactive)
554 default 0:19709c5a4e75 (inactive)
554 default 0:19709c5a4e75 (inactive)
555
555
556 partially merge multihead branch
556 partially merge multihead branch
557
557
558 $ hg up -C default
558 $ hg up -C default
559 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
559 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
560 $ hg branch md
560 $ hg branch md
561 marked working directory as branch md
561 marked working directory as branch md
562 $ hg merge m
562 $ hg merge m
563 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
563 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
564 (branch merge, don't forget to commit)
564 (branch merge, don't forget to commit)
565 $ hg commit -d '11 0' -m 'merge head 2'
565 $ hg commit -d '11 0' -m 'merge head 2'
566 $ hg heads --topo m
566 $ hg heads --topo m
567 changeset: 16:a58ca5d3bdf3
567 changeset: 16:a58ca5d3bdf3
568 branch: m
568 branch: m
569 user: test
569 user: test
570 date: Thu Jan 01 00:00:10 1970 +0000
570 date: Thu Jan 01 00:00:10 1970 +0000
571 summary: head 1
571 summary: head 1
572
572
573 $ hg branches
573 $ hg branches
574 md 18:c914c99f1fbb
574 md 18:c914c99f1fbb
575 m 17:df343b0df04f
575 m 17:df343b0df04f
576 b 13:e23b5505d1ad
576 b 13:e23b5505d1ad
577 a branch name much longer than the default justification used by branches 7:10ff5895aa57
577 a branch name much longer than the default justification used by branches 7:10ff5895aa57
578 a 5:d8cbc61dbaa6 (inactive)
578 a 5:d8cbc61dbaa6 (inactive)
579 default 0:19709c5a4e75 (inactive)
579 default 0:19709c5a4e75 (inactive)
580
580
581 partially close multihead branch
581 partially close multihead branch
582
582
583 $ hg up -C a58ca5d3bdf3
583 $ hg up -C a58ca5d3bdf3
584 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
584 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
585 $ hg commit -d '12 0' -m 'close head 1' --close-branch
585 $ hg commit -d '12 0' -m 'close head 1' --close-branch
586 $ hg heads --topo m
586 $ hg heads --topo m
587 changeset: 19:cd21a80baa3d
587 changeset: 19:cd21a80baa3d
588 branch: m
588 branch: m
589 tag: tip
589 tag: tip
590 parent: 16:a58ca5d3bdf3
590 parent: 16:a58ca5d3bdf3
591 user: test
591 user: test
592 date: Thu Jan 01 00:00:12 1970 +0000
592 date: Thu Jan 01 00:00:12 1970 +0000
593 summary: close head 1
593 summary: close head 1
594
594
595 $ hg branches
595 $ hg branches
596 md 18:c914c99f1fbb
596 md 18:c914c99f1fbb
597 b 13:e23b5505d1ad
597 b 13:e23b5505d1ad
598 a branch name much longer than the default justification used by branches 7:10ff5895aa57
598 a branch name much longer than the default justification used by branches 7:10ff5895aa57
599 m 17:df343b0df04f (inactive)
599 m 17:df343b0df04f (inactive)
600 a 5:d8cbc61dbaa6 (inactive)
600 a 5:d8cbc61dbaa6 (inactive)
601 default 0:19709c5a4e75 (inactive)
601 default 0:19709c5a4e75 (inactive)
602
602
603 default branch colors:
603 default branch colors:
604
604
605 $ cat <<EOF >> $HGRCPATH
605 $ cat <<EOF >> $HGRCPATH
606 > [extensions]
606 > [extensions]
607 > color =
607 > color =
608 > [color]
608 > [color]
609 > mode = ansi
609 > mode = ansi
610 > EOF
610 > EOF
611
611
612 $ hg up -C b
612 $ hg up -C b
613 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
613 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
614 $ hg branches --color=always
614 $ hg branches --color=always
615 \x1b[0;0mmd\x1b[0m\x1b[0;33m 18:c914c99f1fbb\x1b[0m (esc)
615 \x1b[0;0mmd\x1b[0m\x1b[0;33m 18:c914c99f1fbb\x1b[0m (esc)
616 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
616 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
617 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
617 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
618 \x1b[0;0mm\x1b[0m\x1b[0;33m 17:df343b0df04f\x1b[0m (inactive) (esc)
618 \x1b[0;0mm\x1b[0m\x1b[0;33m 17:df343b0df04f\x1b[0m (inactive) (esc)
619 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
619 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
620 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
620 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
621
621
622 default closed branch color:
622 default closed branch color:
623
623
624 $ hg branches --color=always --closed
624 $ hg branches --color=always --closed
625 \x1b[0;0mmd\x1b[0m\x1b[0;33m 18:c914c99f1fbb\x1b[0m (esc)
625 \x1b[0;0mmd\x1b[0m\x1b[0;33m 18:c914c99f1fbb\x1b[0m (esc)
626 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
626 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
627 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
627 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
628 \x1b[0;0mm\x1b[0m\x1b[0;33m 17:df343b0df04f\x1b[0m (inactive) (esc)
628 \x1b[0;0mm\x1b[0m\x1b[0;33m 17:df343b0df04f\x1b[0m (inactive) (esc)
629 \x1b[0;30;1mc\x1b[0m\x1b[0;33m 14:f894c25619d3\x1b[0m (closed) (esc)
629 \x1b[0;30;1mc\x1b[0m\x1b[0;33m 14:f894c25619d3\x1b[0m (closed) (esc)
630 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
630 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
631 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
631 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
632
632
633 $ cat <<EOF >> $HGRCPATH
633 $ cat <<EOF >> $HGRCPATH
634 > [extensions]
634 > [extensions]
635 > color =
635 > color =
636 > [color]
636 > [color]
637 > branches.active = green
637 > branches.active = green
638 > branches.closed = blue
638 > branches.closed = blue
639 > branches.current = red
639 > branches.current = red
640 > branches.inactive = magenta
640 > branches.inactive = magenta
641 > log.changeset = cyan
641 > log.changeset = cyan
642 > EOF
642 > EOF
643
643
644 custom branch colors:
644 custom branch colors:
645
645
646 $ hg branches --color=always
646 $ hg branches --color=always
647 \x1b[0;32mmd\x1b[0m\x1b[0;36m 18:c914c99f1fbb\x1b[0m (esc)
647 \x1b[0;32mmd\x1b[0m\x1b[0;36m 18:c914c99f1fbb\x1b[0m (esc)
648 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
648 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
649 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
649 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
650 \x1b[0;35mm\x1b[0m\x1b[0;36m 17:df343b0df04f\x1b[0m (inactive) (esc)
650 \x1b[0;35mm\x1b[0m\x1b[0;36m 17:df343b0df04f\x1b[0m (inactive) (esc)
651 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
651 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
652 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
652 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
653
653
654 custom closed branch color:
654 custom closed branch color:
655
655
656 $ hg branches --color=always --closed
656 $ hg branches --color=always --closed
657 \x1b[0;32mmd\x1b[0m\x1b[0;36m 18:c914c99f1fbb\x1b[0m (esc)
657 \x1b[0;32mmd\x1b[0m\x1b[0;36m 18:c914c99f1fbb\x1b[0m (esc)
658 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
658 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
659 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
659 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
660 \x1b[0;35mm\x1b[0m\x1b[0;36m 17:df343b0df04f\x1b[0m (inactive) (esc)
660 \x1b[0;35mm\x1b[0m\x1b[0;36m 17:df343b0df04f\x1b[0m (inactive) (esc)
661 \x1b[0;34mc\x1b[0m\x1b[0;36m 14:f894c25619d3\x1b[0m (closed) (esc)
661 \x1b[0;34mc\x1b[0m\x1b[0;36m 14:f894c25619d3\x1b[0m (closed) (esc)
662 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
662 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
663 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
663 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
664
664
665 template output:
665 template output:
666
666
667 $ hg branches -Tjson --closed
667 $ hg branches -Tjson --closed
668 [
668 [
669 {
669 {
670 "active": true,
670 "active": true,
671 "branch": "md",
671 "branch": "md",
672 "closed": false,
672 "closed": false,
673 "current": false,
673 "current": false,
674 "node": "c914c99f1fbb2b1d785a0a939ed3f67275df18e9",
674 "node": "c914c99f1fbb2b1d785a0a939ed3f67275df18e9",
675 "rev": 18
675 "rev": 18
676 },
676 },
677 {
677 {
678 "active": true,
678 "active": true,
679 "branch": "b",
679 "branch": "b",
680 "closed": false,
680 "closed": false,
681 "current": true,
681 "current": true,
682 "node": "e23b5505d1ad24aab6f84fd8c7cb8cd8e5e93be0",
682 "node": "e23b5505d1ad24aab6f84fd8c7cb8cd8e5e93be0",
683 "rev": 13
683 "rev": 13
684 },
684 },
685 {
685 {
686 "active": true,
686 "active": true,
687 "branch": "a branch name much longer than the default justification used by branches",
687 "branch": "a branch name much longer than the default justification used by branches",
688 "closed": false,
688 "closed": false,
689 "current": false,
689 "current": false,
690 "node": "10ff5895aa5793bd378da574af8cec8ea408d831",
690 "node": "10ff5895aa5793bd378da574af8cec8ea408d831",
691 "rev": 7
691 "rev": 7
692 },
692 },
693 {
693 {
694 "active": false,
694 "active": false,
695 "branch": "m",
695 "branch": "m",
696 "closed": false,
696 "closed": false,
697 "current": false,
697 "current": false,
698 "node": "df343b0df04feb2a946cd4b6e9520e552fef14ee",
698 "node": "df343b0df04feb2a946cd4b6e9520e552fef14ee",
699 "rev": 17
699 "rev": 17
700 },
700 },
701 {
701 {
702 "active": false,
702 "active": false,
703 "branch": "c",
703 "branch": "c",
704 "closed": true,
704 "closed": true,
705 "current": false,
705 "current": false,
706 "node": "f894c25619d3f1484639d81be950e0a07bc6f1f6",
706 "node": "f894c25619d3f1484639d81be950e0a07bc6f1f6",
707 "rev": 14
707 "rev": 14
708 },
708 },
709 {
709 {
710 "active": false,
710 "active": false,
711 "branch": "a",
711 "branch": "a",
712 "closed": false,
712 "closed": false,
713 "current": false,
713 "current": false,
714 "node": "d8cbc61dbaa6dc817175d1e301eecb863f280832",
714 "node": "d8cbc61dbaa6dc817175d1e301eecb863f280832",
715 "rev": 5
715 "rev": 5
716 },
716 },
717 {
717 {
718 "active": false,
718 "active": false,
719 "branch": "default",
719 "branch": "default",
720 "closed": false,
720 "closed": false,
721 "current": false,
721 "current": false,
722 "node": "19709c5a4e75bf938f8e349aff97438539bb729e",
722 "node": "19709c5a4e75bf938f8e349aff97438539bb729e",
723 "rev": 0
723 "rev": 0
724 }
724 }
725 ]
725 ]
726
726
727 $ hg branches --closed -T '{if(closed, "{branch}\n")}'
727 $ hg branches --closed -T '{if(closed, "{branch}\n")}'
728 c
728 c
729
729
730 $ hg branches -T '{word(0, branch)}: {desc|firstline}\n'
730 $ hg branches -T '{word(0, branch)}: {desc|firstline}\n'
731 md: merge head 2
731 md: merge head 2
732 b: reopen branch with a change
732 b: reopen branch with a change
733 a: Adding d branch
733 a: Adding d branch
734 m: head 2
734 m: head 2
735 a: Adding b branch head 2
735 a: Adding b branch head 2
736 default: Adding root node
736 default: Adding root node
737
737
738 $ cat <<'EOF' > "$TESTTMP/map-myjson"
738 $ cat <<'EOF' > "$TESTTMP/map-myjson"
739 > docheader = '\{\n'
739 > docheader = '\{\n'
740 > docfooter = '\n}\n'
740 > docfooter = '\n}\n'
741 > separator = ',\n'
741 > separator = ',\n'
742 > branches = ' {dict(branch, node|short)|json}'
742 > branches = ' {dict(branch, node|short)|json}'
743 > EOF
743 > EOF
744 $ hg branches -T "$TESTTMP/map-myjson"
744 $ hg branches -T "$TESTTMP/map-myjson"
745 {
745 {
746 {"branch": "md", "node": "c914c99f1fbb"},
746 {"branch": "md", "node": "c914c99f1fbb"},
747 {"branch": "b", "node": "e23b5505d1ad"},
747 {"branch": "b", "node": "e23b5505d1ad"},
748 {"branch": "a branch *", "node": "10ff5895aa57"}, (glob)
748 {"branch": "a branch *", "node": "10ff5895aa57"}, (glob)
749 {"branch": "m", "node": "df343b0df04f"},
749 {"branch": "m", "node": "df343b0df04f"},
750 {"branch": "a", "node": "d8cbc61dbaa6"},
750 {"branch": "a", "node": "d8cbc61dbaa6"},
751 {"branch": "default", "node": "19709c5a4e75"}
751 {"branch": "default", "node": "19709c5a4e75"}
752 }
752 }
753
753
754 $ cat <<'EOF' >> .hg/hgrc
754 $ cat <<'EOF' >> .hg/hgrc
755 > [templates]
755 > [templates]
756 > myjson = ' {dict(branch, node|short)|json}'
756 > myjson = ' {dict(branch, node|short)|json}'
757 > myjson:docheader = '\{\n'
757 > myjson:docheader = '\{\n'
758 > myjson:docfooter = '\n}\n'
758 > myjson:docfooter = '\n}\n'
759 > myjson:separator = ',\n'
759 > myjson:separator = ',\n'
760 > EOF
760 > EOF
761 $ hg branches -T myjson
761 $ hg branches -T myjson
762 {
762 {
763 {"branch": "md", "node": "c914c99f1fbb"},
763 {"branch": "md", "node": "c914c99f1fbb"},
764 {"branch": "b", "node": "e23b5505d1ad"},
764 {"branch": "b", "node": "e23b5505d1ad"},
765 {"branch": "a branch *", "node": "10ff5895aa57"}, (glob)
765 {"branch": "a branch *", "node": "10ff5895aa57"}, (glob)
766 {"branch": "m", "node": "df343b0df04f"},
766 {"branch": "m", "node": "df343b0df04f"},
767 {"branch": "a", "node": "d8cbc61dbaa6"},
767 {"branch": "a", "node": "d8cbc61dbaa6"},
768 {"branch": "default", "node": "19709c5a4e75"}
768 {"branch": "default", "node": "19709c5a4e75"}
769 }
769 }
770
770
771 $ cat <<'EOF' >> .hg/hgrc
771 $ cat <<'EOF' >> .hg/hgrc
772 > [templates]
772 > [templates]
773 > :docheader = 'should not be selected as a docheader for literal templates\n'
773 > :docheader = 'should not be selected as a docheader for literal templates\n'
774 > EOF
774 > EOF
775 $ hg branches -T '{branch}\n'
775 $ hg branches -T '{branch}\n'
776 md
776 md
777 b
777 b
778 a branch name much longer than the default justification used by branches
778 a branch name much longer than the default justification used by branches
779 m
779 m
780 a
780 a
781 default
781 default
782
782
783 Tests of revision branch name caching
783 Tests of revision branch name caching
784
784
785 We rev branch cache is updated automatically. In these tests we use a trick to
785 We rev branch cache is updated automatically. In these tests we use a trick to
786 trigger rebuilds. We remove the branch head cache and run 'hg head' to cause a
786 trigger rebuilds. We remove the branch head cache and run 'hg head' to cause a
787 rebuild that also will populate the rev branch cache.
787 rebuild that also will populate the rev branch cache.
788
788
789 revision branch cache is created when building the branch head cache
789 revision branch cache is created when building the branch head cache
790 $ rm -rf .hg/cache; hg head a -T '{rev}\n'
790 $ rm -rf .hg/cache; hg head a -T '{rev}\n'
791 5
791 5
792 $ f --hexdump --size .hg/cache/rbc-*
792 $ f --hexdump --size .hg/cache/rbc-*
793 .hg/cache/rbc-names-v1: size=92
793 .hg/cache/rbc-names-v1: size=92
794 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a |
794 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a |
795 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much|
795 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much|
796 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the|
796 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the|
797 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi|
797 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi|
798 0040: 63 61 74 69 6f 6e 20 75 73 65 64 20 62 79 20 62 |cation used by b|
798 0040: 63 61 74 69 6f 6e 20 75 73 65 64 20 62 79 20 62 |cation used by b|
799 0050: 72 61 6e 63 68 65 73 00 6d 00 6d 64 |ranches.m.md|
799 0050: 72 61 6e 63 68 65 73 00 6d 00 6d 64 |ranches.m.md|
800 .hg/cache/rbc-revs-v1: size=160
800 .hg/cache/rbc-revs-v1: size=160
801 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
801 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
802 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....|
802 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....|
803 0020: ae e3 9c d1 00 00 00 02 d8 cb c6 1d 00 00 00 01 |................|
803 0020: ae e3 9c d1 00 00 00 02 d8 cb c6 1d 00 00 00 01 |................|
804 0030: 58 97 36 a2 00 00 00 03 10 ff 58 95 00 00 00 04 |X.6.......X.....|
804 0030: 58 97 36 a2 00 00 00 03 10 ff 58 95 00 00 00 04 |X.6.......X.....|
805 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....|
805 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....|
806 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....|
806 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....|
807 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....|
807 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....|
808 0070: f8 94 c2 56 80 00 00 03 f3 44 76 37 00 00 00 05 |...V.....Dv7....|
808 0070: f8 94 c2 56 80 00 00 03 f3 44 76 37 00 00 00 05 |...V.....Dv7....|
809 0080: a5 8c a5 d3 00 00 00 05 df 34 3b 0d 00 00 00 05 |.........4;.....|
809 0080: a5 8c a5 d3 00 00 00 05 df 34 3b 0d 00 00 00 05 |.........4;.....|
810 0090: c9 14 c9 9f 00 00 00 06 cd 21 a8 0b 80 00 00 05 |.........!......|
810 0090: c9 14 c9 9f 00 00 00 06 cd 21 a8 0b 80 00 00 05 |.........!......|
811
811
812 no errors when revbranchcache is not writable
812 no errors when revbranchcache is not writable
813
813
814 $ echo >> .hg/cache/rbc-revs-v1
814 $ echo >> .hg/cache/rbc-revs-v1
815 $ mv .hg/cache/rbc-revs-v1 .hg/cache/rbc-revs-v1_
815 $ mv .hg/cache/rbc-revs-v1 .hg/cache/rbc-revs-v1_
816 $ mkdir .hg/cache/rbc-revs-v1
816 $ mkdir .hg/cache/rbc-revs-v1
817 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n'
817 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n'
818 5
818 5
819 $ rmdir .hg/cache/rbc-revs-v1
819 $ rmdir .hg/cache/rbc-revs-v1
820 $ mv .hg/cache/rbc-revs-v1_ .hg/cache/rbc-revs-v1
820 $ mv .hg/cache/rbc-revs-v1_ .hg/cache/rbc-revs-v1
821
821
822 no errors when wlock cannot be acquired
822 no errors when wlock cannot be acquired
823
823
824 #if unix-permissions
824 #if unix-permissions
825 $ mv .hg/cache/rbc-revs-v1 .hg/cache/rbc-revs-v1_
825 $ mv .hg/cache/rbc-revs-v1 .hg/cache/rbc-revs-v1_
826 $ rm -f .hg/cache/branch*
826 $ rm -f .hg/cache/branch*
827 $ chmod 555 .hg
827 $ chmod 555 .hg
828 $ hg head a -T '{rev}\n'
828 $ hg head a -T '{rev}\n'
829 5
829 5
830 $ chmod 755 .hg
830 $ chmod 755 .hg
831 $ mv .hg/cache/rbc-revs-v1_ .hg/cache/rbc-revs-v1
831 $ mv .hg/cache/rbc-revs-v1_ .hg/cache/rbc-revs-v1
832 #endif
832 #endif
833
833
834 recovery from invalid cache revs file with trailing data
834 recovery from invalid cache revs file with trailing data
835 $ echo >> .hg/cache/rbc-revs-v1
835 $ echo >> .hg/cache/rbc-revs-v1
836 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
836 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
837 5
837 5
838 truncating cache/rbc-revs-v1 to 160
838 truncating cache/rbc-revs-v1 to 160
839 $ f --size .hg/cache/rbc-revs*
839 $ f --size .hg/cache/rbc-revs*
840 .hg/cache/rbc-revs-v1: size=160
840 .hg/cache/rbc-revs-v1: size=160
841
841
842 recovery from invalid cache file with partial last record
842 recovery from invalid cache file with partial last record
843 $ mv .hg/cache/rbc-revs-v1 .
843 $ mv .hg/cache/rbc-revs-v1 .
844 $ f -qDB 119 rbc-revs-v1 > .hg/cache/rbc-revs-v1
844 $ f -qDB 119 rbc-revs-v1 > .hg/cache/rbc-revs-v1
845 $ f --size .hg/cache/rbc-revs*
845 $ f --size .hg/cache/rbc-revs*
846 .hg/cache/rbc-revs-v1: size=119
846 .hg/cache/rbc-revs-v1: size=119
847 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
847 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
848 5
848 5
849 truncating cache/rbc-revs-v1 to 112
849 truncating cache/rbc-revs-v1 to 112
850 $ f --size .hg/cache/rbc-revs*
850 $ f --size .hg/cache/rbc-revs*
851 .hg/cache/rbc-revs-v1: size=160
851 .hg/cache/rbc-revs-v1: size=160
852
852
853 recovery from invalid cache file with missing record - no truncation
853 recovery from invalid cache file with missing record - no truncation
854 $ mv .hg/cache/rbc-revs-v1 .
854 $ mv .hg/cache/rbc-revs-v1 .
855 $ f -qDB 112 rbc-revs-v1 > .hg/cache/rbc-revs-v1
855 $ f -qDB 112 rbc-revs-v1 > .hg/cache/rbc-revs-v1
856 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
856 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
857 5
857 5
858 $ f --size .hg/cache/rbc-revs*
858 $ f --size .hg/cache/rbc-revs*
859 .hg/cache/rbc-revs-v1: size=160
859 .hg/cache/rbc-revs-v1: size=160
860
860
861 recovery from invalid cache file with some bad records
861 recovery from invalid cache file with some bad records
862 $ mv .hg/cache/rbc-revs-v1 .
862 $ mv .hg/cache/rbc-revs-v1 .
863 $ f -qDB 8 rbc-revs-v1 > .hg/cache/rbc-revs-v1
863 $ f -qDB 8 rbc-revs-v1 > .hg/cache/rbc-revs-v1
864 $ f --size .hg/cache/rbc-revs*
864 $ f --size .hg/cache/rbc-revs*
865 .hg/cache/rbc-revs-v1: size=8
865 .hg/cache/rbc-revs-v1: size=8
866 $ f -qDB 112 rbc-revs-v1 >> .hg/cache/rbc-revs-v1
866 $ f -qDB 112 rbc-revs-v1 >> .hg/cache/rbc-revs-v1
867 $ f --size .hg/cache/rbc-revs*
867 $ f --size .hg/cache/rbc-revs*
868 .hg/cache/rbc-revs-v1: size=120
868 .hg/cache/rbc-revs-v1: size=120
869 $ hg log -r 'branch(.)' -T '{rev} ' --debug
869 $ hg log -r 'branch(.)' -T '{rev} ' --debug
870 history modification detected - truncating revision branch cache to revision 13
870 history modification detected - truncating revision branch cache to revision * (glob)
871 history modification detected - truncating revision branch cache to revision 1
871 history modification detected - truncating revision branch cache to revision 1
872 3 4 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 8
872 3 4 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 8
873 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
873 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
874 5
874 5
875 truncating cache/rbc-revs-v1 to 104
875 truncating cache/rbc-revs-v1 to 104
876 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs*
876 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs*
877 .hg/cache/rbc-revs-v1: size=160
877 .hg/cache/rbc-revs-v1: size=160
878 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
878 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
879
879
880 cache is updated when committing
880 cache is updated when committing
881 $ hg branch i-will-regret-this
881 $ hg branch i-will-regret-this
882 marked working directory as branch i-will-regret-this
882 marked working directory as branch i-will-regret-this
883 $ hg ci -m regrets
883 $ hg ci -m regrets
884 $ f --size .hg/cache/rbc-*
884 $ f --size .hg/cache/rbc-*
885 .hg/cache/rbc-names-v1: size=111
885 .hg/cache/rbc-names-v1: size=111
886 .hg/cache/rbc-revs-v1: size=168
886 .hg/cache/rbc-revs-v1: size=168
887
887
888 update after rollback - the cache will be correct but rbc-names will will still
888 update after rollback - the cache will be correct but rbc-names will will still
889 contain the branch name even though it no longer is used
889 contain the branch name even though it no longer is used
890 $ hg up -qr '.^'
890 $ hg up -qr '.^'
891 $ hg rollback -qf
891 $ hg rollback -qf
892 $ f --size --hexdump .hg/cache/rbc-*
892 $ f --size .hg/cache/rbc-names-*
893 .hg/cache/rbc-names-v1: size=111
893 .hg/cache/rbc-names-v1: size=111
894 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a |
894 $ grep "i-will-regret-this" .hg/cache/rbc-names-* > /dev/null
895 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much|
895 $ f --size .hg/cache/rbc-revs-*
896 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the|
897 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi|
898 0040: 63 61 74 69 6f 6e 20 75 73 65 64 20 62 79 20 62 |cation used by b|
899 0050: 72 61 6e 63 68 65 73 00 6d 00 6d 64 00 69 2d 77 |ranches.m.md.i-w|
900 0060: 69 6c 6c 2d 72 65 67 72 65 74 2d 74 68 69 73 |ill-regret-this|
901 .hg/cache/rbc-revs-v1: size=160
896 .hg/cache/rbc-revs-v1: size=160
902 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
903 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....|
904 0020: ae e3 9c d1 00 00 00 02 d8 cb c6 1d 00 00 00 01 |................|
905 0030: 58 97 36 a2 00 00 00 03 10 ff 58 95 00 00 00 04 |X.6.......X.....|
906 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....|
907 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....|
908 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....|
909 0070: f8 94 c2 56 80 00 00 03 f3 44 76 37 00 00 00 05 |...V.....Dv7....|
910 0080: a5 8c a5 d3 00 00 00 05 df 34 3b 0d 00 00 00 05 |.........4;.....|
911 0090: c9 14 c9 9f 00 00 00 06 cd 21 a8 0b 80 00 00 05 |.........!......|
912
897
913 cache is updated/truncated when stripping - it is thus very hard to get in a
898 cache is updated/truncated when stripping - it is thus very hard to get in a
914 situation where the cache is out of sync and the hash check detects it
899 situation where the cache is out of sync and the hash check detects it
915 $ hg --config extensions.strip= strip -r tip --nob
900 $ hg --config extensions.strip= strip -r tip --nob
916 $ f --size .hg/cache/rbc-revs*
901 $ f --size .hg/cache/rbc-revs*
917 .hg/cache/rbc-revs-v1: size=152
902 .hg/cache/rbc-revs-v1: size=152
918
903
919 cache is rebuilt when corruption is detected
904 cache is rebuilt when corruption is detected
920 $ echo > .hg/cache/rbc-names-v1
905 $ echo > .hg/cache/rbc-names-v1
921 $ hg log -r '5:&branch(.)' -T '{rev} ' --debug
906 $ hg log -r '5:&branch(.)' -T '{rev} ' --debug
922 referenced branch names not found - rebuilding revision branch cache from scratch
907 referenced branch names not found - rebuilding revision branch cache from scratch
923 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 40
908 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 40
924 $ f --size --hexdump .hg/cache/rbc-*
909 $ f --size .hg/cache/rbc-names-*
925 .hg/cache/rbc-names-v1: size=84
910 .hg/cache/rbc-names-v1: size=84
926 0000: 62 00 61 00 63 00 61 20 62 72 61 6e 63 68 20 6e |b.a.c.a branch n|
911 $ grep "i-will-regret-this" .hg/cache/rbc-names-* > /dev/null
927 0010: 61 6d 65 20 6d 75 63 68 20 6c 6f 6e 67 65 72 20 |ame much longer |
912 [1]
928 0020: 74 68 61 6e 20 74 68 65 20 64 65 66 61 75 6c 74 |than the default|
913 $ f --size .hg/cache/rbc-revs-*
929 0030: 20 6a 75 73 74 69 66 69 63 61 74 69 6f 6e 20 75 | justification u|
930 0040: 73 65 64 20 62 79 20 62 72 61 6e 63 68 65 73 00 |sed by branches.|
931 0050: 6d 00 6d 64 |m.md|
932 .hg/cache/rbc-revs-v1: size=152
914 .hg/cache/rbc-revs-v1: size=152
933 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
934 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
935 0020: 00 00 00 00 00 00 00 00 d8 cb c6 1d 00 00 00 01 |................|
936 0030: 58 97 36 a2 00 00 00 02 10 ff 58 95 00 00 00 03 |X.6.......X.....|
937 0040: ee bb 94 44 00 00 00 00 5f 40 61 bb 00 00 00 00 |...D...._@a.....|
938 0050: bf be 84 1b 00 00 00 00 d3 f1 63 45 80 00 00 00 |..........cE....|
939 0060: e3 d4 9c 05 80 00 00 00 e2 3b 55 05 00 00 00 00 |.........;U.....|
940 0070: f8 94 c2 56 80 00 00 02 f3 44 76 37 00 00 00 04 |...V.....Dv7....|
941 0080: a5 8c a5 d3 00 00 00 04 df 34 3b 0d 00 00 00 04 |.........4;.....|
942 0090: c9 14 c9 9f 00 00 00 05 |........|
943
915
944 Test that cache files are created and grows correctly:
916 Test that cache files are created and grows correctly:
945
917
946 $ rm .hg/cache/rbc*
918 $ rm .hg/cache/rbc*
947 $ hg log -r "5 & branch(5)" -T "{rev}\n"
919 $ hg log -r "5 & branch(5)" -T "{rev}\n"
948 5
920 5
949 $ f --size --hexdump .hg/cache/rbc-*
921 $ f --size .hg/cache/rbc-*
950 .hg/cache/rbc-names-v1: size=1
922 .hg/cache/rbc-names-v1: size=1
951 0000: 61 |a|
952 .hg/cache/rbc-revs-v1: size=48
923 .hg/cache/rbc-revs-v1: size=48
953 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
954 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
955 0020: 00 00 00 00 00 00 00 00 d8 cb c6 1d 00 00 00 00 |................|
956
924
957 $ cd ..
925 $ cd ..
958
926
959 Test for multiple incorrect branch cache entries:
927 Test for multiple incorrect branch cache entries:
960
928
961 $ hg init b
929 $ hg init b
962 $ cd b
930 $ cd b
963 $ touch f
931 $ touch f
964 $ hg ci -Aqmf
932 $ hg ci -Aqmf
965 $ echo >> f
933 $ echo >> f
966 $ hg ci -Amf
934 $ hg ci -Amf
967 $ hg branch -q branch
935 $ hg branch -q branch
968 $ hg ci -Amf
936 $ hg ci -Amf
969
937
970 $ f --size --hexdump .hg/cache/rbc-*
938 #if v2
971 .hg/cache/rbc-names-v1: size=14
939
972 0000: 64 65 66 61 75 6c 74 00 62 72 61 6e 63 68 |default.branch|
940 $ f --size --sha256 .hg/cache/rbc-*
973 .hg/cache/rbc-revs-v1: size=24
941 .hg/cache/rbc-names-v1: size=14, sha256=d376f7eea9a7e28fac6470e78dae753c81a5543c9ad436e96999590e004a281c
974 0000: 66 e5 f5 aa 00 00 00 00 fa 4c 04 e5 00 00 00 00 |f........L......|
942 .hg/cache/rbc-revs-v1: size=24, sha256=ec89032fd4e66e7282cb6e403848c681a855a9c36c6b44d19179218553b78779
975 0010: 56 46 78 69 00 00 00 01 |VFxi....|
943
976 $ : > .hg/cache/rbc-revs-v1
944 $ : > .hg/cache/rbc-revs-v1
977
945
978 No superfluous rebuilding of cache:
946 No superfluous rebuilding of cache:
979 $ hg log -r "branch(null)&branch(branch)" --debug
947 $ hg log -r "branch(null)&branch(branch)" --debug
980 $ f --size --hexdump .hg/cache/rbc-*
948 $ f --size --sha256 .hg/cache/rbc-*
981 .hg/cache/rbc-names-v1: size=14
949 .hg/cache/rbc-names-v1: size=14, sha256=d376f7eea9a7e28fac6470e78dae753c81a5543c9ad436e96999590e004a281c
982 0000: 64 65 66 61 75 6c 74 00 62 72 61 6e 63 68 |default.branch|
950 .hg/cache/rbc-revs-v1: size=24, sha256=ec89032fd4e66e7282cb6e403848c681a855a9c36c6b44d19179218553b78779
983 .hg/cache/rbc-revs-v1: size=24
951 #endif
984 0000: 66 e5 f5 aa 00 00 00 00 fa 4c 04 e5 00 00 00 00 |f........L......|
985 0010: 56 46 78 69 00 00 00 01 |VFxi....|
986
952
987 $ cd ..
953 $ cd ..
988
954
989 Test to make sure that `--close-branch` only works on a branch head:
955 Test to make sure that `--close-branch` only works on a branch head:
990 --------------------------------------------------------------------
956 --------------------------------------------------------------------
991 $ hg init closebranch
957 $ hg init closebranch
992 $ cd closebranch
958 $ cd closebranch
993 $ for ch in a b c; do
959 $ for ch in a b c; do
994 > echo $ch > $ch
960 > echo $ch > $ch
995 > hg add $ch
961 > hg add $ch
996 > hg ci -m "added "$ch
962 > hg ci -m "added "$ch
997 > done;
963 > done;
998
964
999 $ hg up -r "desc('added b')"
965 $ hg up -r "desc('added b')"
1000 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
966 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1001
967
1002 trying to close branch from a cset which is not a branch head
968 trying to close branch from a cset which is not a branch head
1003 it should abort:
969 it should abort:
1004 $ hg ci -m "closing branch" --close-branch
970 $ hg ci -m "closing branch" --close-branch
1005 abort: can only close branch heads
971 abort: can only close branch heads
1006 (use --force-close-branch to close branch from a non-head changeset)
972 (use --force-close-branch to close branch from a non-head changeset)
1007 [10]
973 [10]
1008
974
1009 $ hg up 0
975 $ hg up 0
1010 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
976 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1011 $ hg log -GT "{rev}: {node|short} {desc|firstline}\n\t{branch}\n\n"
977 $ hg log -GT "{rev}: {node|short} {desc|firstline}\n\t{branch}\n\n"
1012 o 2: 155349b645be added c
978 o 2: 155349b645be added c
1013 | default
979 | default
1014 |
980 |
1015 o 1: 5f6d8a4bf34a added b
981 o 1: 5f6d8a4bf34a added b
1016 | default
982 | default
1017 |
983 |
1018 @ 0: 9092f1db7931 added a
984 @ 0: 9092f1db7931 added a
1019 default
985 default
1020
986
1021 Test --force-close-branch to close a branch from a non-head changeset:
987 Test --force-close-branch to close a branch from a non-head changeset:
1022 ---------------------------------------------------------------------
988 ---------------------------------------------------------------------
1023
989
1024 $ hg show stack --config extensions.show=
990 $ hg show stack --config extensions.show=
1025 o 1553 added c
991 o 1553 added c
1026 o 5f6d added b
992 o 5f6d added b
1027 @ 9092 added a
993 @ 9092 added a
1028
994
1029 $ hg ci -m "branch closed" --close-branch
995 $ hg ci -m "branch closed" --close-branch
1030 abort: can only close branch heads
996 abort: can only close branch heads
1031 (use --force-close-branch to close branch from a non-head changeset)
997 (use --force-close-branch to close branch from a non-head changeset)
1032 [10]
998 [10]
1033
999
1034 $ hg ci -m "branch closed" --force-close-branch
1000 $ hg ci -m "branch closed" --force-close-branch
1035 created new head
1001 created new head
1036 $ cd ..
1002 $ cd ..
1037
1003
1038 Test various special cases for the branchmap
1004 Test various special cases for the branchmap
1039 --------------------------------------------
1005 --------------------------------------------
1040
1006
1041 Basic fork of the same branch
1007 Basic fork of the same branch
1042
1008
1043 $ hg init branchmap-testing1
1009 $ hg init branchmap-testing1
1044 $ cd branchmap-testing1
1010 $ cd branchmap-testing1
1045 $ hg debugbuild '@A . :base . :p1 *base /p1'
1011 $ hg debugbuild '@A . :base . :p1 *base /p1'
1046 $ hg log -G
1012 $ hg log -G
1047 o changeset: 3:71ca9a6d524e
1013 o changeset: 3:71ca9a6d524e
1048 |\ branch: A
1014 |\ branch: A
1049 | | tag: tip
1015 | | tag: tip
1050 | | parent: 2:a3b807b3ff0b
1016 | | parent: 2:a3b807b3ff0b
1051 | | parent: 1:99ba08759bc7
1017 | | parent: 1:99ba08759bc7
1052 | | user: debugbuilddag
1018 | | user: debugbuilddag
1053 | | date: Thu Jan 01 00:00:03 1970 +0000
1019 | | date: Thu Jan 01 00:00:03 1970 +0000
1054 | | summary: r3
1020 | | summary: r3
1055 | |
1021 | |
1056 | o changeset: 2:a3b807b3ff0b
1022 | o changeset: 2:a3b807b3ff0b
1057 | | branch: A
1023 | | branch: A
1058 | | parent: 0:2ab8003a1750
1024 | | parent: 0:2ab8003a1750
1059 | | user: debugbuilddag
1025 | | user: debugbuilddag
1060 | | date: Thu Jan 01 00:00:02 1970 +0000
1026 | | date: Thu Jan 01 00:00:02 1970 +0000
1061 | | summary: r2
1027 | | summary: r2
1062 | |
1028 | |
1063 o | changeset: 1:99ba08759bc7
1029 o | changeset: 1:99ba08759bc7
1064 |/ branch: A
1030 |/ branch: A
1065 | tag: p1
1031 | tag: p1
1066 | user: debugbuilddag
1032 | user: debugbuilddag
1067 | date: Thu Jan 01 00:00:01 1970 +0000
1033 | date: Thu Jan 01 00:00:01 1970 +0000
1068 | summary: r1
1034 | summary: r1
1069 |
1035 |
1070 o changeset: 0:2ab8003a1750
1036 o changeset: 0:2ab8003a1750
1071 branch: A
1037 branch: A
1072 tag: base
1038 tag: base
1073 user: debugbuilddag
1039 user: debugbuilddag
1074 date: Thu Jan 01 00:00:00 1970 +0000
1040 date: Thu Jan 01 00:00:00 1970 +0000
1075 summary: r0
1041 summary: r0
1076
1042
1077 $ hg branches
1043 $ hg branches
1078 A 3:71ca9a6d524e
1044 A 3:71ca9a6d524e
1079 $ hg clone -r 1 -r 2 . ../branchmap-testing1-clone
1045 $ hg clone -r 1 -r 2 . ../branchmap-testing1-clone
1080 adding changesets
1046 adding changesets
1081 adding manifests
1047 adding manifests
1082 adding file changes
1048 adding file changes
1083 added 3 changesets with 0 changes to 0 files (+1 heads)
1049 added 3 changesets with 0 changes to 0 files (+1 heads)
1084 new changesets 2ab8003a1750:a3b807b3ff0b
1050 new changesets 2ab8003a1750:a3b807b3ff0b
1085 updating to branch A
1051 updating to branch A
1086 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1052 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1087 $ cd ../branchmap-testing1-clone
1053 $ cd ../branchmap-testing1-clone
1088 $ hg pull ../branchmap-testing1
1054 $ hg pull ../branchmap-testing1
1089 pulling from ../branchmap-testing1
1055 pulling from ../branchmap-testing1
1090 searching for changes
1056 searching for changes
1091 adding changesets
1057 adding changesets
1092 adding manifests
1058 adding manifests
1093 adding file changes
1059 adding file changes
1094 added 1 changesets with 0 changes to 0 files (-1 heads)
1060 added 1 changesets with 0 changes to 0 files (-1 heads)
1095 new changesets 71ca9a6d524e
1061 new changesets 71ca9a6d524e
1096 (run 'hg update' to get a working copy)
1062 (run 'hg update' to get a working copy)
1097 $ hg branches
1063 $ hg branches
1098 A 3:71ca9a6d524e
1064 A 3:71ca9a6d524e
1099 $ cd ..
1065 $ cd ..
1100
1066
1101 Switching to a different branch and back
1067 Switching to a different branch and back
1102
1068
1103 $ hg init branchmap-testing2
1069 $ hg init branchmap-testing2
1104 $ cd branchmap-testing2
1070 $ cd branchmap-testing2
1105 $ hg debugbuild '@A . @B . @A .'
1071 $ hg debugbuild '@A . @B . @A .'
1106 $ hg log -G
1072 $ hg log -G
1107 o changeset: 2:9699e9f260b5
1073 o changeset: 2:9699e9f260b5
1108 | branch: A
1074 | branch: A
1109 | tag: tip
1075 | tag: tip
1110 | user: debugbuilddag
1076 | user: debugbuilddag
1111 | date: Thu Jan 01 00:00:02 1970 +0000
1077 | date: Thu Jan 01 00:00:02 1970 +0000
1112 | summary: r2
1078 | summary: r2
1113 |
1079 |
1114 o changeset: 1:0bc7d348d965
1080 o changeset: 1:0bc7d348d965
1115 | branch: B
1081 | branch: B
1116 | user: debugbuilddag
1082 | user: debugbuilddag
1117 | date: Thu Jan 01 00:00:01 1970 +0000
1083 | date: Thu Jan 01 00:00:01 1970 +0000
1118 | summary: r1
1084 | summary: r1
1119 |
1085 |
1120 o changeset: 0:2ab8003a1750
1086 o changeset: 0:2ab8003a1750
1121 branch: A
1087 branch: A
1122 user: debugbuilddag
1088 user: debugbuilddag
1123 date: Thu Jan 01 00:00:00 1970 +0000
1089 date: Thu Jan 01 00:00:00 1970 +0000
1124 summary: r0
1090 summary: r0
1125
1091
1126 $ hg branches
1092 $ hg branches
1127 A 2:9699e9f260b5
1093 A 2:9699e9f260b5
1128 B 1:0bc7d348d965 (inactive)
1094 B 1:0bc7d348d965 (inactive)
1129 $ hg clone -r 1 . ../branchmap-testing2-clone
1095 $ hg clone -r 1 . ../branchmap-testing2-clone
1130 adding changesets
1096 adding changesets
1131 adding manifests
1097 adding manifests
1132 adding file changes
1098 adding file changes
1133 added 2 changesets with 0 changes to 0 files
1099 added 2 changesets with 0 changes to 0 files
1134 new changesets 2ab8003a1750:0bc7d348d965
1100 new changesets 2ab8003a1750:0bc7d348d965
1135 updating to branch B
1101 updating to branch B
1136 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1102 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1137 $ cd ../branchmap-testing2-clone
1103 $ cd ../branchmap-testing2-clone
1138 $ hg pull ../branchmap-testing2
1104 $ hg pull ../branchmap-testing2
1139 pulling from ../branchmap-testing2
1105 pulling from ../branchmap-testing2
1140 searching for changes
1106 searching for changes
1141 adding changesets
1107 adding changesets
1142 adding manifests
1108 adding manifests
1143 adding file changes
1109 adding file changes
1144 added 1 changesets with 0 changes to 0 files
1110 added 1 changesets with 0 changes to 0 files
1145 new changesets 9699e9f260b5
1111 new changesets 9699e9f260b5
1146 (run 'hg update' to get a working copy)
1112 (run 'hg update' to get a working copy)
1147 $ hg branches
1113 $ hg branches
1148 A 2:9699e9f260b5
1114 A 2:9699e9f260b5
1149 B 1:0bc7d348d965 (inactive)
1115 B 1:0bc7d348d965 (inactive)
1150 $ cd ..
1116 $ cd ..
1151
1117
1152 A fork on a branch switching to a different branch and back
1118 A fork on a branch switching to a different branch and back
1153 is still collecting the fork.
1119 is still collecting the fork.
1154
1120
1155 $ hg init branchmap-testing3
1121 $ hg init branchmap-testing3
1156 $ cd branchmap-testing3
1122 $ cd branchmap-testing3
1157 $ hg debugbuild '@A . :base . :p1 *base @B . @A /p1'
1123 $ hg debugbuild '@A . :base . :p1 *base @B . @A /p1'
1158 $ hg log -G
1124 $ hg log -G
1159 o changeset: 4:3614a1711d23
1125 o changeset: 4:3614a1711d23
1160 |\ branch: A
1126 |\ branch: A
1161 | | tag: tip
1127 | | tag: tip
1162 | | parent: 3:e9c8abcf65aa
1128 | | parent: 3:e9c8abcf65aa
1163 | | parent: 1:99ba08759bc7
1129 | | parent: 1:99ba08759bc7
1164 | | user: debugbuilddag
1130 | | user: debugbuilddag
1165 | | date: Thu Jan 01 00:00:04 1970 +0000
1131 | | date: Thu Jan 01 00:00:04 1970 +0000
1166 | | summary: r4
1132 | | summary: r4
1167 | |
1133 | |
1168 | o changeset: 3:e9c8abcf65aa
1134 | o changeset: 3:e9c8abcf65aa
1169 | | branch: B
1135 | | branch: B
1170 | | user: debugbuilddag
1136 | | user: debugbuilddag
1171 | | date: Thu Jan 01 00:00:03 1970 +0000
1137 | | date: Thu Jan 01 00:00:03 1970 +0000
1172 | | summary: r3
1138 | | summary: r3
1173 | |
1139 | |
1174 | o changeset: 2:a3b807b3ff0b
1140 | o changeset: 2:a3b807b3ff0b
1175 | | branch: A
1141 | | branch: A
1176 | | parent: 0:2ab8003a1750
1142 | | parent: 0:2ab8003a1750
1177 | | user: debugbuilddag
1143 | | user: debugbuilddag
1178 | | date: Thu Jan 01 00:00:02 1970 +0000
1144 | | date: Thu Jan 01 00:00:02 1970 +0000
1179 | | summary: r2
1145 | | summary: r2
1180 | |
1146 | |
1181 o | changeset: 1:99ba08759bc7
1147 o | changeset: 1:99ba08759bc7
1182 |/ branch: A
1148 |/ branch: A
1183 | tag: p1
1149 | tag: p1
1184 | user: debugbuilddag
1150 | user: debugbuilddag
1185 | date: Thu Jan 01 00:00:01 1970 +0000
1151 | date: Thu Jan 01 00:00:01 1970 +0000
1186 | summary: r1
1152 | summary: r1
1187 |
1153 |
1188 o changeset: 0:2ab8003a1750
1154 o changeset: 0:2ab8003a1750
1189 branch: A
1155 branch: A
1190 tag: base
1156 tag: base
1191 user: debugbuilddag
1157 user: debugbuilddag
1192 date: Thu Jan 01 00:00:00 1970 +0000
1158 date: Thu Jan 01 00:00:00 1970 +0000
1193 summary: r0
1159 summary: r0
1194
1160
1195 $ hg branches
1161 $ hg branches
1196 A 4:3614a1711d23
1162 A 4:3614a1711d23
1197 B 3:e9c8abcf65aa (inactive)
1163 B 3:e9c8abcf65aa (inactive)
1198 $ hg clone -r 1 -r 3 . ../branchmap-testing3-clone
1164 $ hg clone -r 1 -r 3 . ../branchmap-testing3-clone
1199 adding changesets
1165 adding changesets
1200 adding manifests
1166 adding manifests
1201 adding file changes
1167 adding file changes
1202 added 4 changesets with 0 changes to 0 files (+1 heads)
1168 added 4 changesets with 0 changes to 0 files (+1 heads)
1203 new changesets 2ab8003a1750:e9c8abcf65aa
1169 new changesets 2ab8003a1750:e9c8abcf65aa
1204 updating to branch A
1170 updating to branch A
1205 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1171 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1206 $ cd ../branchmap-testing3-clone
1172 $ cd ../branchmap-testing3-clone
1207 $ hg pull ../branchmap-testing3
1173 $ hg pull ../branchmap-testing3
1208 pulling from ../branchmap-testing3
1174 pulling from ../branchmap-testing3
1209 searching for changes
1175 searching for changes
1210 adding changesets
1176 adding changesets
1211 adding manifests
1177 adding manifests
1212 adding file changes
1178 adding file changes
1213 added 1 changesets with 0 changes to 0 files (-1 heads)
1179 added 1 changesets with 0 changes to 0 files (-1 heads)
1214 new changesets 3614a1711d23
1180 new changesets 3614a1711d23
1215 (run 'hg update' to get a working copy)
1181 (run 'hg update' to get a working copy)
1216 $ hg branches
1182 $ hg branches
1217 A 4:3614a1711d23
1183 A 4:3614a1711d23
1218 B 3:e9c8abcf65aa (inactive)
1184 B 3:e9c8abcf65aa (inactive)
1219 $ cd ..
1185 $ cd ..
1220
1186
1221 Intermediary parents are on different branches.
1187 Intermediary parents are on different branches.
1222
1188
1223 $ hg init branchmap-testing4
1189 $ hg init branchmap-testing4
1224 $ cd branchmap-testing4
1190 $ cd branchmap-testing4
1225 $ hg debugbuild '@A . @B :base . @A :p1 *base @C . @A /p1'
1191 $ hg debugbuild '@A . @B :base . @A :p1 *base @C . @A /p1'
1226 $ hg log -G
1192 $ hg log -G
1227 o changeset: 4:4bf67499b70a
1193 o changeset: 4:4bf67499b70a
1228 |\ branch: A
1194 |\ branch: A
1229 | | tag: tip
1195 | | tag: tip
1230 | | parent: 3:4a546028fa8f
1196 | | parent: 3:4a546028fa8f
1231 | | parent: 1:0bc7d348d965
1197 | | parent: 1:0bc7d348d965
1232 | | user: debugbuilddag
1198 | | user: debugbuilddag
1233 | | date: Thu Jan 01 00:00:04 1970 +0000
1199 | | date: Thu Jan 01 00:00:04 1970 +0000
1234 | | summary: r4
1200 | | summary: r4
1235 | |
1201 | |
1236 | o changeset: 3:4a546028fa8f
1202 | o changeset: 3:4a546028fa8f
1237 | | branch: C
1203 | | branch: C
1238 | | user: debugbuilddag
1204 | | user: debugbuilddag
1239 | | date: Thu Jan 01 00:00:03 1970 +0000
1205 | | date: Thu Jan 01 00:00:03 1970 +0000
1240 | | summary: r3
1206 | | summary: r3
1241 | |
1207 | |
1242 | o changeset: 2:a3b807b3ff0b
1208 | o changeset: 2:a3b807b3ff0b
1243 | | branch: A
1209 | | branch: A
1244 | | parent: 0:2ab8003a1750
1210 | | parent: 0:2ab8003a1750
1245 | | user: debugbuilddag
1211 | | user: debugbuilddag
1246 | | date: Thu Jan 01 00:00:02 1970 +0000
1212 | | date: Thu Jan 01 00:00:02 1970 +0000
1247 | | summary: r2
1213 | | summary: r2
1248 | |
1214 | |
1249 o | changeset: 1:0bc7d348d965
1215 o | changeset: 1:0bc7d348d965
1250 |/ branch: B
1216 |/ branch: B
1251 | tag: p1
1217 | tag: p1
1252 | user: debugbuilddag
1218 | user: debugbuilddag
1253 | date: Thu Jan 01 00:00:01 1970 +0000
1219 | date: Thu Jan 01 00:00:01 1970 +0000
1254 | summary: r1
1220 | summary: r1
1255 |
1221 |
1256 o changeset: 0:2ab8003a1750
1222 o changeset: 0:2ab8003a1750
1257 branch: A
1223 branch: A
1258 tag: base
1224 tag: base
1259 user: debugbuilddag
1225 user: debugbuilddag
1260 date: Thu Jan 01 00:00:00 1970 +0000
1226 date: Thu Jan 01 00:00:00 1970 +0000
1261 summary: r0
1227 summary: r0
1262
1228
1263 $ hg branches
1229 $ hg branches
1264 A 4:4bf67499b70a
1230 A 4:4bf67499b70a
1265 C 3:4a546028fa8f (inactive)
1231 C 3:4a546028fa8f (inactive)
1266 B 1:0bc7d348d965 (inactive)
1232 B 1:0bc7d348d965 (inactive)
1267 $ hg clone -r 1 -r 3 . ../branchmap-testing4-clone
1233 $ hg clone -r 1 -r 3 . ../branchmap-testing4-clone
1268 adding changesets
1234 adding changesets
1269 adding manifests
1235 adding manifests
1270 adding file changes
1236 adding file changes
1271 added 4 changesets with 0 changes to 0 files (+1 heads)
1237 added 4 changesets with 0 changes to 0 files (+1 heads)
1272 new changesets 2ab8003a1750:4a546028fa8f
1238 new changesets 2ab8003a1750:4a546028fa8f
1273 updating to branch B
1239 updating to branch B
1274 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1240 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1275 $ cd ../branchmap-testing4-clone
1241 $ cd ../branchmap-testing4-clone
1276 $ hg pull ../branchmap-testing4
1242 $ hg pull ../branchmap-testing4
1277 pulling from ../branchmap-testing4
1243 pulling from ../branchmap-testing4
1278 searching for changes
1244 searching for changes
1279 adding changesets
1245 adding changesets
1280 adding manifests
1246 adding manifests
1281 adding file changes
1247 adding file changes
1282 added 1 changesets with 0 changes to 0 files (-1 heads)
1248 added 1 changesets with 0 changes to 0 files (-1 heads)
1283 new changesets 4bf67499b70a
1249 new changesets 4bf67499b70a
1284 (run 'hg update' to get a working copy)
1250 (run 'hg update' to get a working copy)
1285 $ hg branches
1251 $ hg branches
1286 A 4:4bf67499b70a
1252 A 4:4bf67499b70a
1287 C 3:4a546028fa8f (inactive)
1253 C 3:4a546028fa8f (inactive)
1288 B 1:0bc7d348d965 (inactive)
1254 B 1:0bc7d348d965 (inactive)
1289 $ cd ..
1255 $ cd ..
1290
1256
1291 Check that the cache are not written too early
1257 Check that the cache are not written too early
1292 ----------------------------------------------
1258 ----------------------------------------------
1293
1259
1294 $ hg log -R branchmap-testing1 -G
1260 $ hg log -R branchmap-testing1 -G
1295 o changeset: 3:71ca9a6d524e
1261 o changeset: 3:71ca9a6d524e
1296 |\ branch: A
1262 |\ branch: A
1297 | | tag: tip
1263 | | tag: tip
1298 | | parent: 2:a3b807b3ff0b
1264 | | parent: 2:a3b807b3ff0b
1299 | | parent: 1:99ba08759bc7
1265 | | parent: 1:99ba08759bc7
1300 | | user: debugbuilddag
1266 | | user: debugbuilddag
1301 | | date: Thu Jan 01 00:00:03 1970 +0000
1267 | | date: Thu Jan 01 00:00:03 1970 +0000
1302 | | summary: r3
1268 | | summary: r3
1303 | |
1269 | |
1304 | o changeset: 2:a3b807b3ff0b
1270 | o changeset: 2:a3b807b3ff0b
1305 | | branch: A
1271 | | branch: A
1306 | | parent: 0:2ab8003a1750
1272 | | parent: 0:2ab8003a1750
1307 | | user: debugbuilddag
1273 | | user: debugbuilddag
1308 | | date: Thu Jan 01 00:00:02 1970 +0000
1274 | | date: Thu Jan 01 00:00:02 1970 +0000
1309 | | summary: r2
1275 | | summary: r2
1310 | |
1276 | |
1311 o | changeset: 1:99ba08759bc7
1277 o | changeset: 1:99ba08759bc7
1312 |/ branch: A
1278 |/ branch: A
1313 | tag: p1
1279 | tag: p1
1314 | user: debugbuilddag
1280 | user: debugbuilddag
1315 | date: Thu Jan 01 00:00:01 1970 +0000
1281 | date: Thu Jan 01 00:00:01 1970 +0000
1316 | summary: r1
1282 | summary: r1
1317 |
1283 |
1318 o changeset: 0:2ab8003a1750
1284 o changeset: 0:2ab8003a1750
1319 branch: A
1285 branch: A
1320 tag: base
1286 tag: base
1321 user: debugbuilddag
1287 user: debugbuilddag
1322 date: Thu Jan 01 00:00:00 1970 +0000
1288 date: Thu Jan 01 00:00:00 1970 +0000
1323 summary: r0
1289 summary: r0
1324
1290
1325 $ hg bundle -R branchmap-testing1 --base 1 bundle.hg --rev 'head()'
1291 $ hg bundle -R branchmap-testing1 --base 1 bundle.hg --rev 'head()'
1326 2 changesets found
1292 2 changesets found
1327
1293
1328 Unbundling revision should warm the served cache
1294 Unbundling revision should warm the served cache
1329
1295
1330 $ hg clone branchmap-testing1 --rev 1 branchmap-update-01
1296 $ hg clone branchmap-testing1 --rev 1 branchmap-update-01
1331 adding changesets
1297 adding changesets
1332 adding manifests
1298 adding manifests
1333 adding file changes
1299 adding file changes
1334 added 2 changesets with 0 changes to 0 files
1300 added 2 changesets with 0 changes to 0 files
1335 new changesets 2ab8003a1750:99ba08759bc7
1301 new changesets 2ab8003a1750:99ba08759bc7
1336 updating to branch A
1302 updating to branch A
1337 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1303 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1338 #if v3
1304 #if v3
1339 $ cat branchmap-update-01/.hg/cache/branch3-base
1305 $ cat branchmap-update-01/.hg/cache/branch3-base
1340 tip-node=99ba08759bc7f6fdbe5304e83d0387f35c082479 tip-rev=1
1306 tip-node=99ba08759bc7f6fdbe5304e83d0387f35c082479 tip-rev=1
1341 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1307 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1342 #else
1308 #else
1343 $ cat branchmap-update-01/.hg/cache/branch2-base
1309 $ cat branchmap-update-01/.hg/cache/branch2-base
1344 99ba08759bc7f6fdbe5304e83d0387f35c082479 1
1310 99ba08759bc7f6fdbe5304e83d0387f35c082479 1
1345 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1311 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1346 #endif
1312 #endif
1347 $ hg -R branchmap-update-01 unbundle bundle.hg
1313 $ hg -R branchmap-update-01 unbundle bundle.hg
1348 adding changesets
1314 adding changesets
1349 adding manifests
1315 adding manifests
1350 adding file changes
1316 adding file changes
1351 added 2 changesets with 0 changes to 0 files
1317 added 2 changesets with 0 changes to 0 files
1352 new changesets a3b807b3ff0b:71ca9a6d524e (2 drafts)
1318 new changesets a3b807b3ff0b:71ca9a6d524e (2 drafts)
1353 (run 'hg update' to get a working copy)
1319 (run 'hg update' to get a working copy)
1354 #if v3
1320 #if v3
1355 $ cat branchmap-update-01/.hg/cache/branch3-served
1321 $ cat branchmap-update-01/.hg/cache/branch3-served
1356 tip-node=71ca9a6d524ed3c2a215119b2086ac3b8c4c8286 tip-rev=3
1322 tip-node=71ca9a6d524ed3c2a215119b2086ac3b8c4c8286 tip-rev=3
1357 71ca9a6d524ed3c2a215119b2086ac3b8c4c8286 o A
1323 71ca9a6d524ed3c2a215119b2086ac3b8c4c8286 o A
1358 #else
1324 #else
1359 $ cat branchmap-update-01/.hg/cache/branch2-served
1325 $ cat branchmap-update-01/.hg/cache/branch2-served
1360 71ca9a6d524ed3c2a215119b2086ac3b8c4c8286 3
1326 71ca9a6d524ed3c2a215119b2086ac3b8c4c8286 3
1361 71ca9a6d524ed3c2a215119b2086ac3b8c4c8286 o A
1327 71ca9a6d524ed3c2a215119b2086ac3b8c4c8286 o A
1362 #endif
1328 #endif
1363
1329
1364 aborted Unbundle should not update the on disk cache
1330 aborted Unbundle should not update the on disk cache
1365
1331
1366 $ cat >> simplehook.py << EOF
1332 $ cat >> simplehook.py << EOF
1367 > import sys
1333 > import sys
1368 > from mercurial import node
1334 > from mercurial import node
1369 > from mercurial import branchmap
1335 > from mercurial import branchmap
1370 > def hook(ui, repo, *args, **kwargs):
1336 > def hook(ui, repo, *args, **kwargs):
1371 > s = repo.filtered(b"served")
1337 > s = repo.filtered(b"served")
1372 > s.branchmap()
1338 > s.branchmap()
1373 > return 1
1339 > return 1
1374 > EOF
1340 > EOF
1375 $ hg clone branchmap-testing1 --rev 1 branchmap-update-02
1341 $ hg clone branchmap-testing1 --rev 1 branchmap-update-02
1376 adding changesets
1342 adding changesets
1377 adding manifests
1343 adding manifests
1378 adding file changes
1344 adding file changes
1379 added 2 changesets with 0 changes to 0 files
1345 added 2 changesets with 0 changes to 0 files
1380 new changesets 2ab8003a1750:99ba08759bc7
1346 new changesets 2ab8003a1750:99ba08759bc7
1381 updating to branch A
1347 updating to branch A
1382 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1348 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1383
1349
1384 #if v3
1350 #if v3
1385 $ cat branchmap-update-02/.hg/cache/branch3-base
1351 $ cat branchmap-update-02/.hg/cache/branch3-base
1386 tip-node=99ba08759bc7f6fdbe5304e83d0387f35c082479 tip-rev=1
1352 tip-node=99ba08759bc7f6fdbe5304e83d0387f35c082479 tip-rev=1
1387 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1353 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1388 #else
1354 #else
1389 $ cat branchmap-update-02/.hg/cache/branch2-base
1355 $ cat branchmap-update-02/.hg/cache/branch2-base
1390 99ba08759bc7f6fdbe5304e83d0387f35c082479 1
1356 99ba08759bc7f6fdbe5304e83d0387f35c082479 1
1391 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1357 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1392 #endif
1358 #endif
1393 $ hg -R branchmap-update-02 unbundle bundle.hg --config "hooks.pretxnclose=python:$TESTTMP/simplehook.py:hook"
1359 $ hg -R branchmap-update-02 unbundle bundle.hg --config "hooks.pretxnclose=python:$TESTTMP/simplehook.py:hook"
1394 adding changesets
1360 adding changesets
1395 adding manifests
1361 adding manifests
1396 adding file changes
1362 adding file changes
1397 transaction abort!
1363 transaction abort!
1398 rollback completed
1364 rollback completed
1399 abort: pretxnclose hook failed
1365 abort: pretxnclose hook failed
1400 [40]
1366 [40]
1401 #if v3
1367 #if v3
1402 $ cat branchmap-update-02/.hg/cache/branch3-base
1368 $ cat branchmap-update-02/.hg/cache/branch3-base
1403 tip-node=99ba08759bc7f6fdbe5304e83d0387f35c082479 tip-rev=1
1369 tip-node=99ba08759bc7f6fdbe5304e83d0387f35c082479 tip-rev=1
1404 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1370 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1405 #else
1371 #else
1406 $ cat branchmap-update-02/.hg/cache/branch2-base
1372 $ cat branchmap-update-02/.hg/cache/branch2-base
1407 99ba08759bc7f6fdbe5304e83d0387f35c082479 1
1373 99ba08759bc7f6fdbe5304e83d0387f35c082479 1
1408 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1374 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1409 #endif
1375 #endif
General Comments 0
You need to be logged in to leave comments. Login now