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