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