Show More
@@ -1,346 +1,346 b'' | |||
|
1 | 1 | #require icasefs |
|
2 | 2 | |
|
3 | 3 | ################################ |
|
4 | 4 | test for branch merging |
|
5 | 5 | ################################ |
|
6 | 6 | |
|
7 | 7 | test for rename awareness of case-folding collision check: |
|
8 | 8 | |
|
9 | 9 | (1) colliding file is one renamed from collided file: |
|
10 | 10 | this is also case for issue3370. |
|
11 | 11 | |
|
12 | 12 | $ hg init branch_merge_renaming |
|
13 | 13 | $ cd branch_merge_renaming |
|
14 | 14 | |
|
15 | 15 | $ echo a > a |
|
16 | 16 | $ hg add a |
|
17 | 17 | $ echo b > b |
|
18 | 18 | $ hg add b |
|
19 | 19 | $ hg commit -m '#0' |
|
20 | 20 | $ hg tag -l A |
|
21 | 21 | $ hg rename a tmp |
|
22 | 22 | $ hg rename tmp A |
|
23 | 23 | $ hg commit -m '#1' |
|
24 | 24 | $ hg tag -l B |
|
25 | 25 | $ hg update -q 0 |
|
26 | 26 | $ touch x |
|
27 | 27 | $ hg add x |
|
28 | 28 | $ hg commit -m '#2' |
|
29 | 29 | created new head |
|
30 | 30 | $ hg tag -l C |
|
31 | 31 | |
|
32 | 32 | $ hg merge -q |
|
33 | 33 | $ hg status -A |
|
34 | 34 | M A |
|
35 | 35 | R a |
|
36 | 36 | C b |
|
37 | 37 | C x |
|
38 | 38 | |
|
39 | 39 | $ hg update -q --clean 1 |
|
40 | 40 | $ hg merge -q |
|
41 | 41 | $ hg status -A |
|
42 | 42 | M x |
|
43 | 43 | C A |
|
44 | 44 | C b |
|
45 | 45 | $ hg commit -m '(D)' |
|
46 | 46 | $ hg tag -l D |
|
47 | 47 | |
|
48 | 48 | additional test for issue3452: |
|
49 | 49 | |
|
50 | 50 | | this assumes the history below. |
|
51 | 51 | | |
|
52 | 52 | | (A) -- (C) -- (E) ------- |
|
53 | 53 | | \ \ \ |
|
54 | 54 | | \ \ \ |
|
55 | 55 | | (B) -- (D) -- (F) -- (G) |
|
56 | 56 | | |
|
57 | 57 | | A: add file 'a' |
|
58 | 58 | | B: rename from 'a' to 'A' |
|
59 | 59 | | C: add 'x' (or operation other than modification of 'a') |
|
60 | 60 | | D: merge C into B |
|
61 | 61 | | E: modify 'a' |
|
62 | 62 | | F: modify 'A' |
|
63 | 63 | | G: merge E into F |
|
64 | 64 | | |
|
65 | 65 | | issue3452 occurs when (B) is recorded before (C) |
|
66 | 66 | |
|
67 | 67 | $ hg update -q --clean C |
|
68 | 68 | $ echo "modify 'a' at (E)" > a |
|
69 | 69 | $ echo "modify 'b' at (E)" > b |
|
70 | 70 | $ hg commit -m '(E)' |
|
71 | 71 | created new head |
|
72 | 72 | $ hg tag -l E |
|
73 | 73 | |
|
74 | 74 | $ hg update -q --clean D |
|
75 | 75 | $ echo "modify 'A' at (F)" > A |
|
76 | 76 | $ hg commit -m '(F)' |
|
77 | 77 | $ hg tag -l F |
|
78 | 78 | |
|
79 | 79 | $ hg merge -q --tool internal:other E |
|
80 | 80 | $ hg status -A |
|
81 | 81 | M A |
|
82 | 82 | a |
|
83 | 83 | M b |
|
84 | 84 | C x |
|
85 | 85 | $ cat A |
|
86 | 86 | modify 'a' at (E) |
|
87 | 87 | |
|
88 | 88 | test also the case that (B) is recorded after (C), to prevent |
|
89 | 89 | regression by changes in the future. |
|
90 | 90 | |
|
91 | 91 | to avoid unexpected (successful) behavior by filelog unification, |
|
92 | 92 | target file is not 'a'/'A' but 'b'/'B' in this case. |
|
93 | 93 | |
|
94 | 94 | $ hg update -q --clean A |
|
95 | 95 | $ hg rename b tmp |
|
96 | 96 | $ hg rename tmp B |
|
97 | 97 | $ hg commit -m '(B1)' |
|
98 | 98 | created new head |
|
99 | 99 | $ hg tag -l B1 |
|
100 | 100 | |
|
101 | 101 | $ hg merge -q C |
|
102 | 102 | $ hg status -A |
|
103 | 103 | M x |
|
104 | 104 | C B |
|
105 | 105 | C a |
|
106 | 106 | $ hg commit -m '(D1)' |
|
107 | 107 | $ hg tag -l D1 |
|
108 | 108 | |
|
109 | 109 | $ echo "modify 'B' at (F1)" > B |
|
110 | 110 | $ hg commit -m '(F1)' |
|
111 | 111 | $ hg tag -l F1 |
|
112 | 112 | |
|
113 | 113 | $ hg merge -q --tool internal:other E |
|
114 | 114 | $ hg status -A |
|
115 | 115 | M B |
|
116 | 116 | b |
|
117 | 117 | M a |
|
118 | 118 | C x |
|
119 | 119 | $ cat B |
|
120 | 120 | modify 'b' at (E) |
|
121 | 121 | |
|
122 | 122 | $ cd .. |
|
123 | 123 | |
|
124 | 124 | (2) colliding file is not related to collided file |
|
125 | 125 | |
|
126 | 126 | $ hg init branch_merge_collding |
|
127 | 127 | $ cd branch_merge_collding |
|
128 | 128 | |
|
129 | 129 | $ echo a > a |
|
130 | 130 | $ hg add a |
|
131 | 131 | $ hg commit -m '#0' |
|
132 | 132 | $ hg remove a |
|
133 | 133 | $ hg commit -m '#1' |
|
134 | 134 | $ echo A > A |
|
135 | 135 | $ hg add A |
|
136 | 136 | $ hg commit -m '#2' |
|
137 | 137 | $ hg update --clean 0 |
|
138 | 138 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
139 | 139 | $ echo x > x |
|
140 | 140 | $ hg add x |
|
141 | 141 | $ hg commit -m '#3' |
|
142 | 142 | created new head |
|
143 | 143 | $ echo 'modified at #4' > a |
|
144 | 144 | $ hg commit -m '#4' |
|
145 | 145 | |
|
146 | 146 | $ hg merge |
|
147 | 147 | abort: case-folding collision between [aA] and [Aa] (re) |
|
148 | 148 | [255] |
|
149 | 149 | $ hg parents --template '{rev}\n' |
|
150 | 150 | 4 |
|
151 | 151 | $ hg status -A |
|
152 | 152 | C a |
|
153 | 153 | C x |
|
154 | 154 | $ cat a |
|
155 | 155 | modified at #4 |
|
156 | 156 | |
|
157 | 157 | $ hg update --clean 2 |
|
158 | 158 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
159 | 159 | $ hg merge |
|
160 | 160 | abort: case-folding collision between [aA] and [Aa] (re) |
|
161 | 161 | [255] |
|
162 | 162 | $ hg parents --template '{rev}\n' |
|
163 | 163 | 2 |
|
164 | 164 | $ hg status -A |
|
165 | 165 | C A |
|
166 | 166 | $ cat A |
|
167 | 167 | A |
|
168 | 168 | |
|
169 | 169 | test for deletion awareness of case-folding collision check (issue3648): |
|
170 | 170 | revision '#3' doesn't change 'a', so 'a' should be recognized as |
|
171 | 171 | safely removed in merging between #2 and #3. |
|
172 | 172 | |
|
173 | 173 | $ hg update --clean 3 |
|
174 | 174 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
175 | 175 | $ hg merge 2 |
|
176 | 176 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
177 | 177 | (branch merge, don't forget to commit) |
|
178 | 178 | $ hg status -A |
|
179 | 179 | M A |
|
180 | 180 | R a |
|
181 | 181 | C x |
|
182 | 182 | |
|
183 | 183 | $ hg update --clean 2 |
|
184 | 184 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
185 | 185 | $ hg merge 3 |
|
186 | 186 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
187 | 187 | (branch merge, don't forget to commit) |
|
188 | 188 | $ hg status -A |
|
189 | 189 | M x |
|
190 | 190 | C A |
|
191 | 191 | |
|
192 | 192 | $ cd .. |
|
193 | 193 | |
|
194 | 194 | Prepare for tests of directory case-folding collisions |
|
195 | 195 | |
|
196 | 196 | $ hg init directory-casing |
|
197 | 197 | $ cd directory-casing |
|
198 | 198 | $ touch 0 # test: file without directory |
|
199 | 199 | $ mkdir 0a |
|
200 | 200 | $ touch 0a/f |
|
201 | 201 | $ mkdir aA |
|
202 | 202 | $ touch aA/a |
|
203 | 203 | $ hg ci -Aqm0 |
|
204 | 204 | |
|
205 | 205 | Directory/file case-folding collision: |
|
206 | 206 | |
|
207 | 207 | $ hg up -q null |
|
208 | 208 | $ touch 00 # test: starts as '0' |
|
209 | 209 | $ mkdir 000 # test: starts as '0' |
|
210 | 210 | $ touch 000/f |
|
211 | 211 | $ touch Aa # test: collision with 'aA/a' |
|
212 | 212 | $ hg ci -Aqm1 |
|
213 | 213 | |
|
214 | 214 | $ hg merge 0 |
|
215 | 215 | abort: case-folding collision between Aa and directory of aA/a |
|
216 | 216 | [255] |
|
217 | 217 | (note: no collision between 0 and 00 or 000/f) |
|
218 | 218 | |
|
219 | 219 | Directory case-folding collision: |
|
220 | 220 | |
|
221 | 221 | $ hg up -qC null |
|
222 | 222 | $ hg --config extensions.purge= purge |
|
223 | 223 | $ mkdir 0A0 |
|
224 | 224 | $ touch 0A0/f # test: starts as '0a' |
|
225 | 225 | $ mkdir Aa |
|
226 | 226 | $ touch Aa/b # test: collision with 'aA/a' |
|
227 | 227 | $ hg ci -Aqm2 |
|
228 | 228 | |
|
229 | 229 | $ hg merge 0 |
|
230 | 230 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
231 | 231 | (branch merge, don't forget to commit) |
|
232 | 232 | |
|
233 | 233 | $ cd .. |
|
234 | 234 | |
|
235 | 235 | ################################ |
|
236 | 236 | test for linear updates |
|
237 | 237 | ################################ |
|
238 | 238 | |
|
239 | 239 | test for rename awareness of case-folding collision check: |
|
240 | 240 | |
|
241 | 241 | (1) colliding file is one renamed from collided file |
|
242 | 242 | |
|
243 | 243 | $ hg init linearupdate_renameaware_1 |
|
244 | 244 | $ cd linearupdate_renameaware_1 |
|
245 | 245 | |
|
246 | 246 | $ echo a > a |
|
247 | 247 | $ hg add a |
|
248 | 248 | $ hg commit -m '#0' |
|
249 | 249 | $ hg rename a tmp |
|
250 | 250 | $ hg rename tmp A |
|
251 | 251 | $ hg commit -m '#1' |
|
252 | 252 | |
|
253 | 253 | $ hg update 0 |
|
254 | 254 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
255 | 255 | |
|
256 | 256 | $ echo 'this is added line' >> a |
|
257 | 257 | $ hg update 1 |
|
258 | 258 | merging a and A to A |
|
259 | 259 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
260 | 260 | $ hg status -A |
|
261 | 261 | M A |
|
262 | 262 | $ cat A |
|
263 | 263 | a |
|
264 | 264 | this is added line |
|
265 | 265 | |
|
266 | 266 | $ cd .. |
|
267 | 267 | |
|
268 | 268 | (2) colliding file is not related to collided file |
|
269 | 269 | |
|
270 | 270 | $ hg init linearupdate_renameaware_2 |
|
271 | 271 | $ cd linearupdate_renameaware_2 |
|
272 | 272 | |
|
273 | 273 | $ echo a > a |
|
274 | 274 | $ hg add a |
|
275 | 275 | $ hg commit -m '#0' |
|
276 | 276 | $ hg remove a |
|
277 | 277 | $ hg commit -m '#1' |
|
278 | 278 | $ echo A > A |
|
279 | 279 | $ hg add A |
|
280 | 280 | $ hg commit -m '#2' |
|
281 | 281 | |
|
282 | 282 | $ hg update 0 |
|
283 | 283 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
284 | 284 | $ hg parents --template '{rev}\n' |
|
285 | 285 | 0 |
|
286 | 286 | $ hg status -A |
|
287 | 287 | C a |
|
288 | 288 | $ cat A |
|
289 | 289 | a |
|
290 | 290 | $ hg up -qC 2 |
|
291 | 291 | |
|
292 | 292 | $ hg update --check 0 |
|
293 | 293 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
294 | 294 | $ hg parents --template '{rev}\n' |
|
295 | 295 | 0 |
|
296 | 296 | $ hg status -A |
|
297 | 297 | C a |
|
298 | 298 | $ cat a |
|
299 | 299 | a |
|
300 | 300 | |
|
301 | 301 | $ hg update --clean 2 |
|
302 | 302 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
303 | 303 | $ hg parents --template '{rev}\n' |
|
304 | 304 | 2 |
|
305 | 305 | $ hg status -A |
|
306 | 306 | C A |
|
307 | 307 | $ cat A |
|
308 | 308 | A |
|
309 | 309 | |
|
310 | 310 | $ cd .. |
|
311 | 311 | |
|
312 | 312 | (3) colliding file is not related to collided file: added in working dir |
|
313 | 313 | |
|
314 | 314 | $ hg init linearupdate_renameaware_3 |
|
315 | 315 | $ cd linearupdate_renameaware_3 |
|
316 | 316 | |
|
317 | 317 | $ echo a > a |
|
318 | 318 | $ hg add a |
|
319 | 319 | $ hg commit -m '#0' |
|
320 | 320 | $ hg rename a b |
|
321 | 321 | $ hg commit -m '#1' |
|
322 | 322 | $ hg update 0 |
|
323 | 323 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
324 | 324 | |
|
325 | 325 | $ echo B > B |
|
326 | 326 | $ hg add B |
|
327 | 327 | $ hg status |
|
328 | 328 | A B |
|
329 | 329 | $ hg update |
|
330 | 330 | abort: case-folding collision between [bB] and [Bb] (re) |
|
331 | 331 | [255] |
|
332 | 332 | |
|
333 | 333 | $ hg update --check |
|
334 | 334 | abort: uncommitted changes |
|
335 |
[2 |
|
|
335 | [20] | |
|
336 | 336 | |
|
337 | 337 | $ hg update --clean |
|
338 | 338 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
339 | 339 | $ hg parents --template '{rev}\n' |
|
340 | 340 | 1 |
|
341 | 341 | $ hg status -A |
|
342 | 342 | C b |
|
343 | 343 | $ cat b |
|
344 | 344 | a |
|
345 | 345 | |
|
346 | 346 | $ cd .. |
@@ -1,1309 +1,1309 b'' | |||
|
1 | 1 | #testcases sshv1 sshv2 |
|
2 | 2 | |
|
3 | 3 | #if sshv2 |
|
4 | 4 | $ cat >> $HGRCPATH << EOF |
|
5 | 5 | > [experimental] |
|
6 | 6 | > sshpeer.advertise-v2 = true |
|
7 | 7 | > sshserver.support-v2 = true |
|
8 | 8 | > EOF |
|
9 | 9 | #endif |
|
10 | 10 | |
|
11 | 11 | Prepare repo a: |
|
12 | 12 | |
|
13 | 13 | $ hg init a |
|
14 | 14 | $ cd a |
|
15 | 15 | $ echo a > a |
|
16 | 16 | $ hg add a |
|
17 | 17 | $ hg commit -m test |
|
18 | 18 | $ echo first line > b |
|
19 | 19 | $ hg add b |
|
20 | 20 | |
|
21 | 21 | Create a non-inlined filelog: |
|
22 | 22 | |
|
23 | 23 | $ "$PYTHON" -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))' |
|
24 | 24 | $ for j in 0 1 2 3 4 5 6 7 8 9; do |
|
25 | 25 | > cat data1 >> b |
|
26 | 26 | > hg commit -m test |
|
27 | 27 | > done |
|
28 | 28 | |
|
29 | 29 | List files in store/data (should show a 'b.d'): |
|
30 | 30 | |
|
31 | 31 | #if reporevlogstore |
|
32 | 32 | $ for i in .hg/store/data/*; do |
|
33 | 33 | > echo $i |
|
34 | 34 | > done |
|
35 | 35 | .hg/store/data/a.i |
|
36 | 36 | .hg/store/data/b.d |
|
37 | 37 | .hg/store/data/b.i |
|
38 | 38 | #endif |
|
39 | 39 | |
|
40 | 40 | Trigger branchcache creation: |
|
41 | 41 | |
|
42 | 42 | $ hg branches |
|
43 | 43 | default 10:a7949464abda |
|
44 | 44 | $ ls .hg/cache |
|
45 | 45 | branch2-served |
|
46 | 46 | rbc-names-v1 |
|
47 | 47 | rbc-revs-v1 |
|
48 | 48 | |
|
49 | 49 | Default operation: |
|
50 | 50 | |
|
51 | 51 | $ hg clone . ../b |
|
52 | 52 | updating to branch default |
|
53 | 53 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
54 | 54 | $ cd ../b |
|
55 | 55 | |
|
56 | 56 | Ensure branchcache got copied over: |
|
57 | 57 | |
|
58 | 58 | $ ls .hg/cache |
|
59 | 59 | branch2-served |
|
60 | 60 | rbc-names-v1 |
|
61 | 61 | rbc-revs-v1 |
|
62 | 62 | |
|
63 | 63 | $ cat a |
|
64 | 64 | a |
|
65 | 65 | $ hg verify |
|
66 | 66 | checking changesets |
|
67 | 67 | checking manifests |
|
68 | 68 | crosschecking files in changesets and manifests |
|
69 | 69 | checking files |
|
70 | 70 | checked 11 changesets with 11 changes to 2 files |
|
71 | 71 | |
|
72 | 72 | Invalid dest '' must abort: |
|
73 | 73 | |
|
74 | 74 | $ hg clone . '' |
|
75 | 75 | abort: empty destination path is not valid |
|
76 | 76 | [10] |
|
77 | 77 | |
|
78 | 78 | No update, with debug option: |
|
79 | 79 | |
|
80 | 80 | #if hardlink |
|
81 | 81 | $ hg --debug clone -U . ../c --config progress.debug=true |
|
82 | 82 | linking: 1 files |
|
83 | 83 | linking: 2 files |
|
84 | 84 | linking: 3 files |
|
85 | 85 | linking: 4 files |
|
86 | 86 | linking: 5 files |
|
87 | 87 | linking: 6 files |
|
88 | 88 | linking: 7 files |
|
89 | 89 | linking: 8 files |
|
90 | 90 | linked 8 files (reporevlogstore !) |
|
91 | 91 | linking: 9 files (reposimplestore !) |
|
92 | 92 | linking: 10 files (reposimplestore !) |
|
93 | 93 | linking: 11 files (reposimplestore !) |
|
94 | 94 | linking: 12 files (reposimplestore !) |
|
95 | 95 | linking: 13 files (reposimplestore !) |
|
96 | 96 | linking: 14 files (reposimplestore !) |
|
97 | 97 | linking: 15 files (reposimplestore !) |
|
98 | 98 | linking: 16 files (reposimplestore !) |
|
99 | 99 | linking: 17 files (reposimplestore !) |
|
100 | 100 | linking: 18 files (reposimplestore !) |
|
101 | 101 | linked 18 files (reposimplestore !) |
|
102 | 102 | #else |
|
103 | 103 | $ hg --debug clone -U . ../c --config progress.debug=true |
|
104 | 104 | linking: 1 files |
|
105 | 105 | copying: 2 files |
|
106 | 106 | copying: 3 files |
|
107 | 107 | copying: 4 files |
|
108 | 108 | copying: 5 files |
|
109 | 109 | copying: 6 files |
|
110 | 110 | copying: 7 files |
|
111 | 111 | copying: 8 files |
|
112 | 112 | copied 8 files (reporevlogstore !) |
|
113 | 113 | copying: 9 files (reposimplestore !) |
|
114 | 114 | copying: 10 files (reposimplestore !) |
|
115 | 115 | copying: 11 files (reposimplestore !) |
|
116 | 116 | copying: 12 files (reposimplestore !) |
|
117 | 117 | copying: 13 files (reposimplestore !) |
|
118 | 118 | copying: 14 files (reposimplestore !) |
|
119 | 119 | copying: 15 files (reposimplestore !) |
|
120 | 120 | copying: 16 files (reposimplestore !) |
|
121 | 121 | copying: 17 files (reposimplestore !) |
|
122 | 122 | copying: 18 files (reposimplestore !) |
|
123 | 123 | copied 18 files (reposimplestore !) |
|
124 | 124 | #endif |
|
125 | 125 | $ cd ../c |
|
126 | 126 | |
|
127 | 127 | Ensure branchcache got copied over: |
|
128 | 128 | |
|
129 | 129 | $ ls .hg/cache |
|
130 | 130 | branch2-served |
|
131 | 131 | rbc-names-v1 |
|
132 | 132 | rbc-revs-v1 |
|
133 | 133 | |
|
134 | 134 | $ cat a 2>/dev/null || echo "a not present" |
|
135 | 135 | a not present |
|
136 | 136 | $ hg verify |
|
137 | 137 | checking changesets |
|
138 | 138 | checking manifests |
|
139 | 139 | crosschecking files in changesets and manifests |
|
140 | 140 | checking files |
|
141 | 141 | checked 11 changesets with 11 changes to 2 files |
|
142 | 142 | |
|
143 | 143 | Default destination: |
|
144 | 144 | |
|
145 | 145 | $ mkdir ../d |
|
146 | 146 | $ cd ../d |
|
147 | 147 | $ hg clone ../a |
|
148 | 148 | destination directory: a |
|
149 | 149 | updating to branch default |
|
150 | 150 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
151 | 151 | $ cd a |
|
152 | 152 | $ hg cat a |
|
153 | 153 | a |
|
154 | 154 | $ cd ../.. |
|
155 | 155 | |
|
156 | 156 | Check that we drop the 'file:' from the path before writing the .hgrc: |
|
157 | 157 | |
|
158 | 158 | $ hg clone file:a e |
|
159 | 159 | updating to branch default |
|
160 | 160 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
161 | 161 | $ grep 'file:' e/.hg/hgrc |
|
162 | 162 | [1] |
|
163 | 163 | |
|
164 | 164 | Check that path aliases are expanded: |
|
165 | 165 | |
|
166 | 166 | $ hg clone -q -U --config 'paths.foobar=a#0' foobar f |
|
167 | 167 | $ hg -R f showconfig paths.default |
|
168 | 168 | $TESTTMP/a#0 |
|
169 | 169 | |
|
170 | 170 | Use --pull: |
|
171 | 171 | |
|
172 | 172 | $ hg clone --pull a g |
|
173 | 173 | requesting all changes |
|
174 | 174 | adding changesets |
|
175 | 175 | adding manifests |
|
176 | 176 | adding file changes |
|
177 | 177 | added 11 changesets with 11 changes to 2 files |
|
178 | 178 | new changesets acb14030fe0a:a7949464abda |
|
179 | 179 | updating to branch default |
|
180 | 180 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
181 | 181 | $ hg -R g verify |
|
182 | 182 | checking changesets |
|
183 | 183 | checking manifests |
|
184 | 184 | crosschecking files in changesets and manifests |
|
185 | 185 | checking files |
|
186 | 186 | checked 11 changesets with 11 changes to 2 files |
|
187 | 187 | |
|
188 | 188 | Invalid dest '' with --pull must abort (issue2528): |
|
189 | 189 | |
|
190 | 190 | $ hg clone --pull a '' |
|
191 | 191 | abort: empty destination path is not valid |
|
192 | 192 | [10] |
|
193 | 193 | |
|
194 | 194 | Clone to '.': |
|
195 | 195 | |
|
196 | 196 | $ mkdir h |
|
197 | 197 | $ cd h |
|
198 | 198 | $ hg clone ../a . |
|
199 | 199 | updating to branch default |
|
200 | 200 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
201 | 201 | $ cd .. |
|
202 | 202 | |
|
203 | 203 | |
|
204 | 204 | *** Tests for option -u *** |
|
205 | 205 | |
|
206 | 206 | Adding some more history to repo a: |
|
207 | 207 | |
|
208 | 208 | $ cd a |
|
209 | 209 | $ hg tag ref1 |
|
210 | 210 | $ echo the quick brown fox >a |
|
211 | 211 | $ hg ci -m "hacked default" |
|
212 | 212 | $ hg up ref1 |
|
213 | 213 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
214 | 214 | $ hg branch stable |
|
215 | 215 | marked working directory as branch stable |
|
216 | 216 | (branches are permanent and global, did you want a bookmark?) |
|
217 | 217 | $ echo some text >a |
|
218 | 218 | $ hg ci -m "starting branch stable" |
|
219 | 219 | $ hg tag ref2 |
|
220 | 220 | $ echo some more text >a |
|
221 | 221 | $ hg ci -m "another change for branch stable" |
|
222 | 222 | $ hg up ref2 |
|
223 | 223 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
224 | 224 | $ hg parents |
|
225 | 225 | changeset: 13:e8ece76546a6 |
|
226 | 226 | branch: stable |
|
227 | 227 | tag: ref2 |
|
228 | 228 | parent: 10:a7949464abda |
|
229 | 229 | user: test |
|
230 | 230 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
231 | 231 | summary: starting branch stable |
|
232 | 232 | |
|
233 | 233 | |
|
234 | 234 | Repo a has two heads: |
|
235 | 235 | |
|
236 | 236 | $ hg heads |
|
237 | 237 | changeset: 15:0aae7cf88f0d |
|
238 | 238 | branch: stable |
|
239 | 239 | tag: tip |
|
240 | 240 | user: test |
|
241 | 241 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
242 | 242 | summary: another change for branch stable |
|
243 | 243 | |
|
244 | 244 | changeset: 12:f21241060d6a |
|
245 | 245 | user: test |
|
246 | 246 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
247 | 247 | summary: hacked default |
|
248 | 248 | |
|
249 | 249 | |
|
250 | 250 | $ cd .. |
|
251 | 251 | |
|
252 | 252 | |
|
253 | 253 | Testing --noupdate with --updaterev (must abort): |
|
254 | 254 | |
|
255 | 255 | $ hg clone --noupdate --updaterev 1 a ua |
|
256 | 256 | abort: cannot specify both --noupdate and --updaterev |
|
257 | 257 | [10] |
|
258 | 258 | |
|
259 | 259 | |
|
260 | 260 | Testing clone -u: |
|
261 | 261 | |
|
262 | 262 | $ hg clone -u . a ua |
|
263 | 263 | updating to branch stable |
|
264 | 264 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
265 | 265 | |
|
266 | 266 | Repo ua has both heads: |
|
267 | 267 | |
|
268 | 268 | $ hg -R ua heads |
|
269 | 269 | changeset: 15:0aae7cf88f0d |
|
270 | 270 | branch: stable |
|
271 | 271 | tag: tip |
|
272 | 272 | user: test |
|
273 | 273 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
274 | 274 | summary: another change for branch stable |
|
275 | 275 | |
|
276 | 276 | changeset: 12:f21241060d6a |
|
277 | 277 | user: test |
|
278 | 278 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
279 | 279 | summary: hacked default |
|
280 | 280 | |
|
281 | 281 | |
|
282 | 282 | Same revision checked out in repo a and ua: |
|
283 | 283 | |
|
284 | 284 | $ hg -R a parents --template "{node|short}\n" |
|
285 | 285 | e8ece76546a6 |
|
286 | 286 | $ hg -R ua parents --template "{node|short}\n" |
|
287 | 287 | e8ece76546a6 |
|
288 | 288 | |
|
289 | 289 | $ rm -r ua |
|
290 | 290 | |
|
291 | 291 | |
|
292 | 292 | Testing clone --pull -u: |
|
293 | 293 | |
|
294 | 294 | $ hg clone --pull -u . a ua |
|
295 | 295 | requesting all changes |
|
296 | 296 | adding changesets |
|
297 | 297 | adding manifests |
|
298 | 298 | adding file changes |
|
299 | 299 | added 16 changesets with 16 changes to 3 files (+1 heads) |
|
300 | 300 | new changesets acb14030fe0a:0aae7cf88f0d |
|
301 | 301 | updating to branch stable |
|
302 | 302 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
303 | 303 | |
|
304 | 304 | Repo ua has both heads: |
|
305 | 305 | |
|
306 | 306 | $ hg -R ua heads |
|
307 | 307 | changeset: 15:0aae7cf88f0d |
|
308 | 308 | branch: stable |
|
309 | 309 | tag: tip |
|
310 | 310 | user: test |
|
311 | 311 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
312 | 312 | summary: another change for branch stable |
|
313 | 313 | |
|
314 | 314 | changeset: 12:f21241060d6a |
|
315 | 315 | user: test |
|
316 | 316 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
317 | 317 | summary: hacked default |
|
318 | 318 | |
|
319 | 319 | |
|
320 | 320 | Same revision checked out in repo a and ua: |
|
321 | 321 | |
|
322 | 322 | $ hg -R a parents --template "{node|short}\n" |
|
323 | 323 | e8ece76546a6 |
|
324 | 324 | $ hg -R ua parents --template "{node|short}\n" |
|
325 | 325 | e8ece76546a6 |
|
326 | 326 | |
|
327 | 327 | $ rm -r ua |
|
328 | 328 | |
|
329 | 329 | |
|
330 | 330 | Testing clone -u <branch>: |
|
331 | 331 | |
|
332 | 332 | $ hg clone -u stable a ua |
|
333 | 333 | updating to branch stable |
|
334 | 334 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
335 | 335 | |
|
336 | 336 | Repo ua has both heads: |
|
337 | 337 | |
|
338 | 338 | $ hg -R ua heads |
|
339 | 339 | changeset: 15:0aae7cf88f0d |
|
340 | 340 | branch: stable |
|
341 | 341 | tag: tip |
|
342 | 342 | user: test |
|
343 | 343 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
344 | 344 | summary: another change for branch stable |
|
345 | 345 | |
|
346 | 346 | changeset: 12:f21241060d6a |
|
347 | 347 | user: test |
|
348 | 348 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
349 | 349 | summary: hacked default |
|
350 | 350 | |
|
351 | 351 | |
|
352 | 352 | Branch 'stable' is checked out: |
|
353 | 353 | |
|
354 | 354 | $ hg -R ua parents |
|
355 | 355 | changeset: 15:0aae7cf88f0d |
|
356 | 356 | branch: stable |
|
357 | 357 | tag: tip |
|
358 | 358 | user: test |
|
359 | 359 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
360 | 360 | summary: another change for branch stable |
|
361 | 361 | |
|
362 | 362 | |
|
363 | 363 | $ rm -r ua |
|
364 | 364 | |
|
365 | 365 | |
|
366 | 366 | Testing default checkout: |
|
367 | 367 | |
|
368 | 368 | $ hg clone a ua |
|
369 | 369 | updating to branch default |
|
370 | 370 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
371 | 371 | |
|
372 | 372 | Repo ua has both heads: |
|
373 | 373 | |
|
374 | 374 | $ hg -R ua heads |
|
375 | 375 | changeset: 15:0aae7cf88f0d |
|
376 | 376 | branch: stable |
|
377 | 377 | tag: tip |
|
378 | 378 | user: test |
|
379 | 379 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
380 | 380 | summary: another change for branch stable |
|
381 | 381 | |
|
382 | 382 | changeset: 12:f21241060d6a |
|
383 | 383 | user: test |
|
384 | 384 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
385 | 385 | summary: hacked default |
|
386 | 386 | |
|
387 | 387 | |
|
388 | 388 | Branch 'default' is checked out: |
|
389 | 389 | |
|
390 | 390 | $ hg -R ua parents |
|
391 | 391 | changeset: 12:f21241060d6a |
|
392 | 392 | user: test |
|
393 | 393 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
394 | 394 | summary: hacked default |
|
395 | 395 | |
|
396 | 396 | Test clone with a branch named "@" (issue3677) |
|
397 | 397 | |
|
398 | 398 | $ hg -R ua branch @ |
|
399 | 399 | marked working directory as branch @ |
|
400 | 400 | $ hg -R ua commit -m 'created branch @' |
|
401 | 401 | $ hg clone ua atbranch |
|
402 | 402 | updating to branch default |
|
403 | 403 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
404 | 404 | $ hg -R atbranch heads |
|
405 | 405 | changeset: 16:798b6d97153e |
|
406 | 406 | branch: @ |
|
407 | 407 | tag: tip |
|
408 | 408 | parent: 12:f21241060d6a |
|
409 | 409 | user: test |
|
410 | 410 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
411 | 411 | summary: created branch @ |
|
412 | 412 | |
|
413 | 413 | changeset: 15:0aae7cf88f0d |
|
414 | 414 | branch: stable |
|
415 | 415 | user: test |
|
416 | 416 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
417 | 417 | summary: another change for branch stable |
|
418 | 418 | |
|
419 | 419 | changeset: 12:f21241060d6a |
|
420 | 420 | user: test |
|
421 | 421 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
422 | 422 | summary: hacked default |
|
423 | 423 | |
|
424 | 424 | $ hg -R atbranch parents |
|
425 | 425 | changeset: 12:f21241060d6a |
|
426 | 426 | user: test |
|
427 | 427 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
428 | 428 | summary: hacked default |
|
429 | 429 | |
|
430 | 430 | |
|
431 | 431 | $ rm -r ua atbranch |
|
432 | 432 | |
|
433 | 433 | |
|
434 | 434 | Testing #<branch>: |
|
435 | 435 | |
|
436 | 436 | $ hg clone -u . a#stable ua |
|
437 | 437 | adding changesets |
|
438 | 438 | adding manifests |
|
439 | 439 | adding file changes |
|
440 | 440 | added 14 changesets with 14 changes to 3 files |
|
441 | 441 | new changesets acb14030fe0a:0aae7cf88f0d |
|
442 | 442 | updating to branch stable |
|
443 | 443 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
444 | 444 | |
|
445 | 445 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): |
|
446 | 446 | |
|
447 | 447 | $ hg -R ua heads |
|
448 | 448 | changeset: 13:0aae7cf88f0d |
|
449 | 449 | branch: stable |
|
450 | 450 | tag: tip |
|
451 | 451 | user: test |
|
452 | 452 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
453 | 453 | summary: another change for branch stable |
|
454 | 454 | |
|
455 | 455 | changeset: 10:a7949464abda |
|
456 | 456 | user: test |
|
457 | 457 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
458 | 458 | summary: test |
|
459 | 459 | |
|
460 | 460 | |
|
461 | 461 | Same revision checked out in repo a and ua: |
|
462 | 462 | |
|
463 | 463 | $ hg -R a parents --template "{node|short}\n" |
|
464 | 464 | e8ece76546a6 |
|
465 | 465 | $ hg -R ua parents --template "{node|short}\n" |
|
466 | 466 | e8ece76546a6 |
|
467 | 467 | |
|
468 | 468 | $ rm -r ua |
|
469 | 469 | |
|
470 | 470 | |
|
471 | 471 | Testing -u -r <branch>: |
|
472 | 472 | |
|
473 | 473 | $ hg clone -u . -r stable a ua |
|
474 | 474 | adding changesets |
|
475 | 475 | adding manifests |
|
476 | 476 | adding file changes |
|
477 | 477 | added 14 changesets with 14 changes to 3 files |
|
478 | 478 | new changesets acb14030fe0a:0aae7cf88f0d |
|
479 | 479 | updating to branch stable |
|
480 | 480 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
481 | 481 | |
|
482 | 482 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): |
|
483 | 483 | |
|
484 | 484 | $ hg -R ua heads |
|
485 | 485 | changeset: 13:0aae7cf88f0d |
|
486 | 486 | branch: stable |
|
487 | 487 | tag: tip |
|
488 | 488 | user: test |
|
489 | 489 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
490 | 490 | summary: another change for branch stable |
|
491 | 491 | |
|
492 | 492 | changeset: 10:a7949464abda |
|
493 | 493 | user: test |
|
494 | 494 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
495 | 495 | summary: test |
|
496 | 496 | |
|
497 | 497 | |
|
498 | 498 | Same revision checked out in repo a and ua: |
|
499 | 499 | |
|
500 | 500 | $ hg -R a parents --template "{node|short}\n" |
|
501 | 501 | e8ece76546a6 |
|
502 | 502 | $ hg -R ua parents --template "{node|short}\n" |
|
503 | 503 | e8ece76546a6 |
|
504 | 504 | |
|
505 | 505 | $ rm -r ua |
|
506 | 506 | |
|
507 | 507 | |
|
508 | 508 | Testing -r <branch>: |
|
509 | 509 | |
|
510 | 510 | $ hg clone -r stable a ua |
|
511 | 511 | adding changesets |
|
512 | 512 | adding manifests |
|
513 | 513 | adding file changes |
|
514 | 514 | added 14 changesets with 14 changes to 3 files |
|
515 | 515 | new changesets acb14030fe0a:0aae7cf88f0d |
|
516 | 516 | updating to branch stable |
|
517 | 517 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
518 | 518 | |
|
519 | 519 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): |
|
520 | 520 | |
|
521 | 521 | $ hg -R ua heads |
|
522 | 522 | changeset: 13:0aae7cf88f0d |
|
523 | 523 | branch: stable |
|
524 | 524 | tag: tip |
|
525 | 525 | user: test |
|
526 | 526 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
527 | 527 | summary: another change for branch stable |
|
528 | 528 | |
|
529 | 529 | changeset: 10:a7949464abda |
|
530 | 530 | user: test |
|
531 | 531 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
532 | 532 | summary: test |
|
533 | 533 | |
|
534 | 534 | |
|
535 | 535 | Branch 'stable' is checked out: |
|
536 | 536 | |
|
537 | 537 | $ hg -R ua parents |
|
538 | 538 | changeset: 13:0aae7cf88f0d |
|
539 | 539 | branch: stable |
|
540 | 540 | tag: tip |
|
541 | 541 | user: test |
|
542 | 542 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
543 | 543 | summary: another change for branch stable |
|
544 | 544 | |
|
545 | 545 | |
|
546 | 546 | $ rm -r ua |
|
547 | 547 | |
|
548 | 548 | |
|
549 | 549 | Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not |
|
550 | 550 | iterable in addbranchrevs() |
|
551 | 551 | |
|
552 | 552 | $ cat <<EOF > simpleclone.py |
|
553 | 553 | > from mercurial import hg, ui as uimod |
|
554 | 554 | > myui = uimod.ui.load() |
|
555 | 555 | > repo = hg.repository(myui, b'a') |
|
556 | 556 | > hg.clone(myui, {}, repo, dest=b"ua") |
|
557 | 557 | > EOF |
|
558 | 558 | |
|
559 | 559 | $ "$PYTHON" simpleclone.py |
|
560 | 560 | updating to branch default |
|
561 | 561 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
562 | 562 | |
|
563 | 563 | $ rm -r ua |
|
564 | 564 | |
|
565 | 565 | $ cat <<EOF > branchclone.py |
|
566 | 566 | > from mercurial import extensions, hg, ui as uimod |
|
567 | 567 | > myui = uimod.ui.load() |
|
568 | 568 | > extensions.loadall(myui) |
|
569 | 569 | > extensions.populateui(myui) |
|
570 | 570 | > repo = hg.repository(myui, b'a') |
|
571 | 571 | > hg.clone(myui, {}, repo, dest=b"ua", branch=[b"stable"]) |
|
572 | 572 | > EOF |
|
573 | 573 | |
|
574 | 574 | $ "$PYTHON" branchclone.py |
|
575 | 575 | adding changesets |
|
576 | 576 | adding manifests |
|
577 | 577 | adding file changes |
|
578 | 578 | added 14 changesets with 14 changes to 3 files |
|
579 | 579 | new changesets acb14030fe0a:0aae7cf88f0d |
|
580 | 580 | updating to branch stable |
|
581 | 581 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
582 | 582 | $ rm -r ua |
|
583 | 583 | |
|
584 | 584 | |
|
585 | 585 | Test clone with special '@' bookmark: |
|
586 | 586 | $ cd a |
|
587 | 587 | $ hg bookmark -r a7949464abda @ # branch point of stable from default |
|
588 | 588 | $ hg clone . ../i |
|
589 | 589 | updating to bookmark @ |
|
590 | 590 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
591 | 591 | $ hg id -i ../i |
|
592 | 592 | a7949464abda |
|
593 | 593 | $ rm -r ../i |
|
594 | 594 | |
|
595 | 595 | $ hg bookmark -f -r stable @ |
|
596 | 596 | $ hg bookmarks |
|
597 | 597 | @ 15:0aae7cf88f0d |
|
598 | 598 | $ hg clone . ../i |
|
599 | 599 | updating to bookmark @ on branch stable |
|
600 | 600 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
601 | 601 | $ hg id -i ../i |
|
602 | 602 | 0aae7cf88f0d |
|
603 | 603 | $ cd "$TESTTMP" |
|
604 | 604 | |
|
605 | 605 | |
|
606 | 606 | Testing failures: |
|
607 | 607 | |
|
608 | 608 | $ mkdir fail |
|
609 | 609 | $ cd fail |
|
610 | 610 | |
|
611 | 611 | No local source |
|
612 | 612 | |
|
613 | 613 | $ hg clone a b |
|
614 | 614 | abort: repository a not found |
|
615 | 615 | [255] |
|
616 | 616 | |
|
617 | 617 | Invalid URL |
|
618 | 618 | |
|
619 | 619 | $ hg clone http://invalid:url/a b |
|
620 | 620 | abort: error: nonnumeric port: 'url' |
|
621 | 621 | [100] |
|
622 | 622 | |
|
623 | 623 | No remote source |
|
624 | 624 | |
|
625 | 625 | #if windows |
|
626 | 626 | $ hg clone http://$LOCALIP:3121/a b |
|
627 | 627 | abort: error: * (glob) |
|
628 | [255] | |
|
628 | [100] | |
|
629 | 629 | #else |
|
630 | 630 | $ hg clone http://$LOCALIP:3121/a b |
|
631 | 631 | abort: error: *refused* (glob) |
|
632 | 632 | [100] |
|
633 | 633 | #endif |
|
634 | 634 | $ rm -rf b # work around bug with http clone |
|
635 | 635 | |
|
636 | 636 | |
|
637 | 637 | #if unix-permissions no-root |
|
638 | 638 | |
|
639 | 639 | Inaccessible source |
|
640 | 640 | |
|
641 | 641 | $ mkdir a |
|
642 | 642 | $ chmod 000 a |
|
643 | 643 | $ hg clone a b |
|
644 | 644 | abort: Permission denied: *$TESTTMP/fail/a/.hg* (glob) |
|
645 | 645 | [255] |
|
646 | 646 | |
|
647 | 647 | Inaccessible destination |
|
648 | 648 | |
|
649 | 649 | $ hg init b |
|
650 | 650 | $ cd b |
|
651 | 651 | $ hg clone . ../a |
|
652 | 652 | abort: Permission denied: *../a* (glob) |
|
653 | 653 | [255] |
|
654 | 654 | $ cd .. |
|
655 | 655 | $ chmod 700 a |
|
656 | 656 | $ rm -r a b |
|
657 | 657 | |
|
658 | 658 | #endif |
|
659 | 659 | |
|
660 | 660 | |
|
661 | 661 | #if fifo |
|
662 | 662 | |
|
663 | 663 | Source of wrong type |
|
664 | 664 | |
|
665 | 665 | $ mkfifo a |
|
666 | 666 | $ hg clone a b |
|
667 | 667 | abort: $ENOTDIR$: *$TESTTMP/fail/a/.hg* (glob) |
|
668 | 668 | [255] |
|
669 | 669 | $ rm a |
|
670 | 670 | |
|
671 | 671 | #endif |
|
672 | 672 | |
|
673 | 673 | Default destination, same directory |
|
674 | 674 | |
|
675 | 675 | $ hg init q |
|
676 | 676 | $ hg clone q |
|
677 | 677 | destination directory: q |
|
678 | 678 | abort: destination 'q' is not empty |
|
679 | 679 | [10] |
|
680 | 680 | |
|
681 | 681 | destination directory not empty |
|
682 | 682 | |
|
683 | 683 | $ mkdir a |
|
684 | 684 | $ echo stuff > a/a |
|
685 | 685 | $ hg clone q a |
|
686 | 686 | abort: destination 'a' is not empty |
|
687 | 687 | [10] |
|
688 | 688 | |
|
689 | 689 | |
|
690 | 690 | #if unix-permissions no-root |
|
691 | 691 | |
|
692 | 692 | leave existing directory in place after clone failure |
|
693 | 693 | |
|
694 | 694 | $ hg init c |
|
695 | 695 | $ cd c |
|
696 | 696 | $ echo c > c |
|
697 | 697 | $ hg commit -A -m test |
|
698 | 698 | adding c |
|
699 | 699 | $ chmod -rx .hg/store/data |
|
700 | 700 | $ cd .. |
|
701 | 701 | $ mkdir d |
|
702 | 702 | $ hg clone c d 2> err |
|
703 | 703 | [255] |
|
704 | 704 | $ test -d d |
|
705 | 705 | $ test -d d/.hg |
|
706 | 706 | [1] |
|
707 | 707 | |
|
708 | 708 | re-enable perm to allow deletion |
|
709 | 709 | |
|
710 | 710 | $ chmod +rx c/.hg/store/data |
|
711 | 711 | |
|
712 | 712 | #endif |
|
713 | 713 | |
|
714 | 714 | $ cd .. |
|
715 | 715 | |
|
716 | 716 | Test clone from the repository in (emulated) revlog format 0 (issue4203): |
|
717 | 717 | |
|
718 | 718 | $ mkdir issue4203 |
|
719 | 719 | $ mkdir -p src/.hg |
|
720 | 720 | $ echo foo > src/foo |
|
721 | 721 | $ hg -R src add src/foo |
|
722 | 722 | $ hg -R src commit -m '#0' |
|
723 | 723 | $ hg -R src log -q |
|
724 | 724 | 0:e1bab28bca43 |
|
725 | 725 | $ hg -R src debugrevlog -c | egrep 'format|flags' |
|
726 | 726 | format : 0 |
|
727 | 727 | flags : (none) |
|
728 | 728 | $ hg root -R src -T json | sed 's|\\\\|\\|g' |
|
729 | 729 | [ |
|
730 | 730 | { |
|
731 | 731 | "hgpath": "$TESTTMP/src/.hg", |
|
732 | 732 | "reporoot": "$TESTTMP/src", |
|
733 | 733 | "storepath": "$TESTTMP/src/.hg" |
|
734 | 734 | } |
|
735 | 735 | ] |
|
736 | 736 | $ hg clone -U -q src dst |
|
737 | 737 | $ hg -R dst log -q |
|
738 | 738 | 0:e1bab28bca43 |
|
739 | 739 | |
|
740 | 740 | Create repositories to test auto sharing functionality |
|
741 | 741 | |
|
742 | 742 | $ cat >> $HGRCPATH << EOF |
|
743 | 743 | > [extensions] |
|
744 | 744 | > share= |
|
745 | 745 | > EOF |
|
746 | 746 | |
|
747 | 747 | $ hg init empty |
|
748 | 748 | $ hg init source1a |
|
749 | 749 | $ cd source1a |
|
750 | 750 | $ echo initial1 > foo |
|
751 | 751 | $ hg -q commit -A -m initial |
|
752 | 752 | $ echo second > foo |
|
753 | 753 | $ hg commit -m second |
|
754 | 754 | $ cd .. |
|
755 | 755 | |
|
756 | 756 | $ hg init filteredrev0 |
|
757 | 757 | $ cd filteredrev0 |
|
758 | 758 | $ cat >> .hg/hgrc << EOF |
|
759 | 759 | > [experimental] |
|
760 | 760 | > evolution.createmarkers=True |
|
761 | 761 | > EOF |
|
762 | 762 | $ echo initial1 > foo |
|
763 | 763 | $ hg -q commit -A -m initial0 |
|
764 | 764 | $ hg -q up -r null |
|
765 | 765 | $ echo initial2 > foo |
|
766 | 766 | $ hg -q commit -A -m initial1 |
|
767 | 767 | $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8 |
|
768 | 768 | 1 new obsolescence markers |
|
769 | 769 | obsoleted 1 changesets |
|
770 | 770 | $ cd .. |
|
771 | 771 | |
|
772 | 772 | $ hg -q clone --pull source1a source1b |
|
773 | 773 | $ cd source1a |
|
774 | 774 | $ hg bookmark bookA |
|
775 | 775 | $ echo 1a > foo |
|
776 | 776 | $ hg commit -m 1a |
|
777 | 777 | $ cd ../source1b |
|
778 | 778 | $ hg -q up -r 0 |
|
779 | 779 | $ echo head1 > foo |
|
780 | 780 | $ hg commit -m head1 |
|
781 | 781 | created new head |
|
782 | 782 | $ hg bookmark head1 |
|
783 | 783 | $ hg -q up -r 0 |
|
784 | 784 | $ echo head2 > foo |
|
785 | 785 | $ hg commit -m head2 |
|
786 | 786 | created new head |
|
787 | 787 | $ hg bookmark head2 |
|
788 | 788 | $ hg -q up -r 0 |
|
789 | 789 | $ hg branch branch1 |
|
790 | 790 | marked working directory as branch branch1 |
|
791 | 791 | (branches are permanent and global, did you want a bookmark?) |
|
792 | 792 | $ echo branch1 > foo |
|
793 | 793 | $ hg commit -m branch1 |
|
794 | 794 | $ hg -q up -r 0 |
|
795 | 795 | $ hg branch branch2 |
|
796 | 796 | marked working directory as branch branch2 |
|
797 | 797 | $ echo branch2 > foo |
|
798 | 798 | $ hg commit -m branch2 |
|
799 | 799 | $ cd .. |
|
800 | 800 | $ hg init source2 |
|
801 | 801 | $ cd source2 |
|
802 | 802 | $ echo initial2 > foo |
|
803 | 803 | $ hg -q commit -A -m initial2 |
|
804 | 804 | $ echo second > foo |
|
805 | 805 | $ hg commit -m second |
|
806 | 806 | $ cd .. |
|
807 | 807 | |
|
808 | 808 | Clone with auto share from an empty repo should not result in share |
|
809 | 809 | |
|
810 | 810 | $ mkdir share |
|
811 | 811 | $ hg --config share.pool=share clone empty share-empty |
|
812 | 812 | (not using pooled storage: remote appears to be empty) |
|
813 | 813 | updating to branch default |
|
814 | 814 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
815 | 815 | $ ls share |
|
816 | 816 | $ test -d share-empty/.hg/store |
|
817 | 817 | $ test -f share-empty/.hg/sharedpath |
|
818 | 818 | [1] |
|
819 | 819 | |
|
820 | 820 | Clone with auto share from a repo with filtered revision 0 should not result in share |
|
821 | 821 | |
|
822 | 822 | $ hg --config share.pool=share clone filteredrev0 share-filtered |
|
823 | 823 | (not using pooled storage: unable to resolve identity of remote) |
|
824 | 824 | requesting all changes |
|
825 | 825 | adding changesets |
|
826 | 826 | adding manifests |
|
827 | 827 | adding file changes |
|
828 | 828 | added 1 changesets with 1 changes to 1 files |
|
829 | 829 | new changesets e082c1832e09 |
|
830 | 830 | updating to branch default |
|
831 | 831 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
832 | 832 | |
|
833 | 833 | Clone from repo with content should result in shared store being created |
|
834 | 834 | |
|
835 | 835 | $ hg --config share.pool=share clone source1a share-dest1a |
|
836 | 836 | (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
837 | 837 | requesting all changes |
|
838 | 838 | adding changesets |
|
839 | 839 | adding manifests |
|
840 | 840 | adding file changes |
|
841 | 841 | added 3 changesets with 3 changes to 1 files |
|
842 | 842 | new changesets b5f04eac9d8f:e5bfe23c0b47 |
|
843 | 843 | searching for changes |
|
844 | 844 | no changes found |
|
845 | 845 | adding remote bookmark bookA |
|
846 | 846 | updating working directory |
|
847 | 847 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
848 | 848 | |
|
849 | 849 | The shared repo should have been created |
|
850 | 850 | |
|
851 | 851 | $ ls share |
|
852 | 852 | b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 |
|
853 | 853 | |
|
854 | 854 | The destination should point to it |
|
855 | 855 | |
|
856 | 856 | $ cat share-dest1a/.hg/sharedpath; echo |
|
857 | 857 | $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg |
|
858 | 858 | |
|
859 | 859 | The destination should have bookmarks |
|
860 | 860 | |
|
861 | 861 | $ hg -R share-dest1a bookmarks |
|
862 | 862 | bookA 2:e5bfe23c0b47 |
|
863 | 863 | |
|
864 | 864 | The default path should be the remote, not the share |
|
865 | 865 | |
|
866 | 866 | $ hg -R share-dest1a config paths.default |
|
867 | 867 | $TESTTMP/source1a |
|
868 | 868 | |
|
869 | 869 | Clone with existing share dir should result in pull + share |
|
870 | 870 | |
|
871 | 871 | $ hg --config share.pool=share clone source1b share-dest1b |
|
872 | 872 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
873 | 873 | searching for changes |
|
874 | 874 | adding changesets |
|
875 | 875 | adding manifests |
|
876 | 876 | adding file changes |
|
877 | 877 | adding remote bookmark head1 |
|
878 | 878 | adding remote bookmark head2 |
|
879 | 879 | added 4 changesets with 4 changes to 1 files (+4 heads) |
|
880 | 880 | new changesets 4a8dc1ab4c13:6bacf4683960 |
|
881 | 881 | updating working directory |
|
882 | 882 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
883 | 883 | |
|
884 | 884 | $ ls share |
|
885 | 885 | b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 |
|
886 | 886 | |
|
887 | 887 | $ cat share-dest1b/.hg/sharedpath; echo |
|
888 | 888 | $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg |
|
889 | 889 | |
|
890 | 890 | We only get bookmarks from the remote, not everything in the share |
|
891 | 891 | |
|
892 | 892 | $ hg -R share-dest1b bookmarks |
|
893 | 893 | head1 3:4a8dc1ab4c13 |
|
894 | 894 | head2 4:99f71071f117 |
|
895 | 895 | |
|
896 | 896 | Default path should be source, not share. |
|
897 | 897 | |
|
898 | 898 | $ hg -R share-dest1b config paths.default |
|
899 | 899 | $TESTTMP/source1b |
|
900 | 900 | |
|
901 | 901 | Checked out revision should be head of default branch |
|
902 | 902 | |
|
903 | 903 | $ hg -R share-dest1b log -r . |
|
904 | 904 | changeset: 4:99f71071f117 |
|
905 | 905 | bookmark: head2 |
|
906 | 906 | parent: 0:b5f04eac9d8f |
|
907 | 907 | user: test |
|
908 | 908 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
909 | 909 | summary: head2 |
|
910 | 910 | |
|
911 | 911 | |
|
912 | 912 | Clone from unrelated repo should result in new share |
|
913 | 913 | |
|
914 | 914 | $ hg --config share.pool=share clone source2 share-dest2 |
|
915 | 915 | (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e) |
|
916 | 916 | requesting all changes |
|
917 | 917 | adding changesets |
|
918 | 918 | adding manifests |
|
919 | 919 | adding file changes |
|
920 | 920 | added 2 changesets with 2 changes to 1 files |
|
921 | 921 | new changesets 22aeff664783:63cf6c3dba4a |
|
922 | 922 | searching for changes |
|
923 | 923 | no changes found |
|
924 | 924 | updating working directory |
|
925 | 925 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
926 | 926 | |
|
927 | 927 | $ ls share |
|
928 | 928 | 22aeff664783fd44c6d9b435618173c118c3448e |
|
929 | 929 | b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 |
|
930 | 930 | |
|
931 | 931 | remote naming mode works as advertised |
|
932 | 932 | |
|
933 | 933 | $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a |
|
934 | 934 | (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde) |
|
935 | 935 | requesting all changes |
|
936 | 936 | adding changesets |
|
937 | 937 | adding manifests |
|
938 | 938 | adding file changes |
|
939 | 939 | added 3 changesets with 3 changes to 1 files |
|
940 | 940 | new changesets b5f04eac9d8f:e5bfe23c0b47 |
|
941 | 941 | searching for changes |
|
942 | 942 | no changes found |
|
943 | 943 | adding remote bookmark bookA |
|
944 | 944 | updating working directory |
|
945 | 945 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
946 | 946 | |
|
947 | 947 | $ ls shareremote |
|
948 | 948 | 195bb1fcdb595c14a6c13e0269129ed78f6debde |
|
949 | 949 | |
|
950 | 950 | $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b |
|
951 | 951 | (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46) |
|
952 | 952 | requesting all changes |
|
953 | 953 | adding changesets |
|
954 | 954 | adding manifests |
|
955 | 955 | adding file changes |
|
956 | 956 | added 6 changesets with 6 changes to 1 files (+4 heads) |
|
957 | 957 | new changesets b5f04eac9d8f:6bacf4683960 |
|
958 | 958 | searching for changes |
|
959 | 959 | no changes found |
|
960 | 960 | adding remote bookmark head1 |
|
961 | 961 | adding remote bookmark head2 |
|
962 | 962 | updating working directory |
|
963 | 963 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
964 | 964 | |
|
965 | 965 | $ ls shareremote |
|
966 | 966 | 195bb1fcdb595c14a6c13e0269129ed78f6debde |
|
967 | 967 | c0d4f83847ca2a873741feb7048a45085fd47c46 |
|
968 | 968 | |
|
969 | 969 | request to clone a single revision is respected in sharing mode |
|
970 | 970 | |
|
971 | 971 | $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev |
|
972 | 972 | (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
973 | 973 | adding changesets |
|
974 | 974 | adding manifests |
|
975 | 975 | adding file changes |
|
976 | 976 | added 2 changesets with 2 changes to 1 files |
|
977 | 977 | new changesets b5f04eac9d8f:4a8dc1ab4c13 |
|
978 | 978 | no changes found |
|
979 | 979 | adding remote bookmark head1 |
|
980 | 980 | updating working directory |
|
981 | 981 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
982 | 982 | |
|
983 | 983 | $ hg -R share-1arev log -G |
|
984 | 984 | @ changeset: 1:4a8dc1ab4c13 |
|
985 | 985 | | bookmark: head1 |
|
986 | 986 | | tag: tip |
|
987 | 987 | | user: test |
|
988 | 988 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
989 | 989 | | summary: head1 |
|
990 | 990 | | |
|
991 | 991 | o changeset: 0:b5f04eac9d8f |
|
992 | 992 | user: test |
|
993 | 993 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
994 | 994 | summary: initial |
|
995 | 995 | |
|
996 | 996 | |
|
997 | 997 | making another clone should only pull down requested rev |
|
998 | 998 | |
|
999 | 999 | $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev |
|
1000 | 1000 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
1001 | 1001 | searching for changes |
|
1002 | 1002 | adding changesets |
|
1003 | 1003 | adding manifests |
|
1004 | 1004 | adding file changes |
|
1005 | 1005 | adding remote bookmark head1 |
|
1006 | 1006 | adding remote bookmark head2 |
|
1007 | 1007 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
1008 | 1008 | new changesets 99f71071f117 |
|
1009 | 1009 | updating working directory |
|
1010 | 1010 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1011 | 1011 | |
|
1012 | 1012 | $ hg -R share-1brev log -G |
|
1013 | 1013 | @ changeset: 2:99f71071f117 |
|
1014 | 1014 | | bookmark: head2 |
|
1015 | 1015 | | tag: tip |
|
1016 | 1016 | | parent: 0:b5f04eac9d8f |
|
1017 | 1017 | | user: test |
|
1018 | 1018 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1019 | 1019 | | summary: head2 |
|
1020 | 1020 | | |
|
1021 | 1021 | | o changeset: 1:4a8dc1ab4c13 |
|
1022 | 1022 | |/ bookmark: head1 |
|
1023 | 1023 | | user: test |
|
1024 | 1024 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1025 | 1025 | | summary: head1 |
|
1026 | 1026 | | |
|
1027 | 1027 | o changeset: 0:b5f04eac9d8f |
|
1028 | 1028 | user: test |
|
1029 | 1029 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1030 | 1030 | summary: initial |
|
1031 | 1031 | |
|
1032 | 1032 | |
|
1033 | 1033 | Request to clone a single branch is respected in sharing mode |
|
1034 | 1034 | |
|
1035 | 1035 | $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1 |
|
1036 | 1036 | (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
1037 | 1037 | adding changesets |
|
1038 | 1038 | adding manifests |
|
1039 | 1039 | adding file changes |
|
1040 | 1040 | added 2 changesets with 2 changes to 1 files |
|
1041 | 1041 | new changesets b5f04eac9d8f:5f92a6c1a1b1 |
|
1042 | 1042 | no changes found |
|
1043 | 1043 | updating working directory |
|
1044 | 1044 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1045 | 1045 | |
|
1046 | 1046 | $ hg -R share-1bbranch1 log -G |
|
1047 | 1047 | o changeset: 1:5f92a6c1a1b1 |
|
1048 | 1048 | | branch: branch1 |
|
1049 | 1049 | | tag: tip |
|
1050 | 1050 | | user: test |
|
1051 | 1051 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1052 | 1052 | | summary: branch1 |
|
1053 | 1053 | | |
|
1054 | 1054 | @ changeset: 0:b5f04eac9d8f |
|
1055 | 1055 | user: test |
|
1056 | 1056 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1057 | 1057 | summary: initial |
|
1058 | 1058 | |
|
1059 | 1059 | |
|
1060 | 1060 | $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2 |
|
1061 | 1061 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
1062 | 1062 | searching for changes |
|
1063 | 1063 | adding changesets |
|
1064 | 1064 | adding manifests |
|
1065 | 1065 | adding file changes |
|
1066 | 1066 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
1067 | 1067 | new changesets 6bacf4683960 |
|
1068 | 1068 | updating working directory |
|
1069 | 1069 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1070 | 1070 | |
|
1071 | 1071 | $ hg -R share-1bbranch2 log -G |
|
1072 | 1072 | o changeset: 2:6bacf4683960 |
|
1073 | 1073 | | branch: branch2 |
|
1074 | 1074 | | tag: tip |
|
1075 | 1075 | | parent: 0:b5f04eac9d8f |
|
1076 | 1076 | | user: test |
|
1077 | 1077 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1078 | 1078 | | summary: branch2 |
|
1079 | 1079 | | |
|
1080 | 1080 | | o changeset: 1:5f92a6c1a1b1 |
|
1081 | 1081 | |/ branch: branch1 |
|
1082 | 1082 | | user: test |
|
1083 | 1083 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1084 | 1084 | | summary: branch1 |
|
1085 | 1085 | | |
|
1086 | 1086 | @ changeset: 0:b5f04eac9d8f |
|
1087 | 1087 | user: test |
|
1088 | 1088 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1089 | 1089 | summary: initial |
|
1090 | 1090 | |
|
1091 | 1091 | |
|
1092 | 1092 | -U is respected in share clone mode |
|
1093 | 1093 | |
|
1094 | 1094 | $ hg --config share.pool=share clone -U source1a share-1anowc |
|
1095 | 1095 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
1096 | 1096 | searching for changes |
|
1097 | 1097 | no changes found |
|
1098 | 1098 | adding remote bookmark bookA |
|
1099 | 1099 | |
|
1100 | 1100 | $ ls -A share-1anowc |
|
1101 | 1101 | .hg |
|
1102 | 1102 | |
|
1103 | 1103 | Test that auto sharing doesn't cause failure of "hg clone local remote" |
|
1104 | 1104 | |
|
1105 | 1105 | $ cd $TESTTMP |
|
1106 | 1106 | $ hg -R a id -r 0 |
|
1107 | 1107 | acb14030fe0a |
|
1108 | 1108 | $ hg id -R remote -r 0 |
|
1109 | 1109 | abort: repository remote not found |
|
1110 | 1110 | [255] |
|
1111 | 1111 | $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote |
|
1112 | 1112 | $ hg -R remote id -r 0 |
|
1113 | 1113 | acb14030fe0a |
|
1114 | 1114 | |
|
1115 | 1115 | Cloning into pooled storage doesn't race (issue5104) |
|
1116 | 1116 | |
|
1117 | 1117 | $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 & |
|
1118 | 1118 | $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1 |
|
1119 | 1119 | $ wait |
|
1120 | 1120 | |
|
1121 | 1121 | $ hg -R share-destrace1 log -r tip |
|
1122 | 1122 | changeset: 2:e5bfe23c0b47 |
|
1123 | 1123 | bookmark: bookA |
|
1124 | 1124 | tag: tip |
|
1125 | 1125 | user: test |
|
1126 | 1126 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1127 | 1127 | summary: 1a |
|
1128 | 1128 | |
|
1129 | 1129 | |
|
1130 | 1130 | $ hg -R share-destrace2 log -r tip |
|
1131 | 1131 | changeset: 2:e5bfe23c0b47 |
|
1132 | 1132 | bookmark: bookA |
|
1133 | 1133 | tag: tip |
|
1134 | 1134 | user: test |
|
1135 | 1135 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1136 | 1136 | summary: 1a |
|
1137 | 1137 | |
|
1138 | 1138 | One repo should be new, the other should be shared from the pool. We |
|
1139 | 1139 | don't care which is which, so we just make sure we always print the |
|
1140 | 1140 | one containing "new pooled" first, then one one containing "existing |
|
1141 | 1141 | pooled". |
|
1142 | 1142 | |
|
1143 | 1143 | $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock |
|
1144 | 1144 | (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
1145 | 1145 | requesting all changes |
|
1146 | 1146 | adding changesets |
|
1147 | 1147 | adding manifests |
|
1148 | 1148 | adding file changes |
|
1149 | 1149 | added 3 changesets with 3 changes to 1 files |
|
1150 | 1150 | new changesets b5f04eac9d8f:e5bfe23c0b47 |
|
1151 | 1151 | searching for changes |
|
1152 | 1152 | no changes found |
|
1153 | 1153 | adding remote bookmark bookA |
|
1154 | 1154 | updating working directory |
|
1155 | 1155 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1156 | 1156 | |
|
1157 | 1157 | $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock |
|
1158 | 1158 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
1159 | 1159 | searching for changes |
|
1160 | 1160 | no changes found |
|
1161 | 1161 | adding remote bookmark bookA |
|
1162 | 1162 | updating working directory |
|
1163 | 1163 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1164 | 1164 | |
|
1165 | 1165 | SEC: check for unsafe ssh url |
|
1166 | 1166 | |
|
1167 | 1167 | $ cat >> $HGRCPATH << EOF |
|
1168 | 1168 | > [ui] |
|
1169 | 1169 | > ssh = sh -c "read l; read l; read l" |
|
1170 | 1170 | > EOF |
|
1171 | 1171 | |
|
1172 | 1172 | $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path' |
|
1173 | 1173 | abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' |
|
1174 | 1174 | [255] |
|
1175 | 1175 | $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path' |
|
1176 | 1176 | abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' |
|
1177 | 1177 | [255] |
|
1178 | 1178 | $ hg clone 'ssh://fakehost|touch%20owned/path' |
|
1179 | 1179 | abort: no suitable response from remote hg |
|
1180 | 1180 | [255] |
|
1181 | 1181 | $ hg clone 'ssh://fakehost%7Ctouch%20owned/path' |
|
1182 | 1182 | abort: no suitable response from remote hg |
|
1183 | 1183 | [255] |
|
1184 | 1184 | |
|
1185 | 1185 | $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path' |
|
1186 | 1186 | abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path' |
|
1187 | 1187 | [255] |
|
1188 | 1188 | |
|
1189 | 1189 | #if windows |
|
1190 | 1190 | $ hg clone "ssh://%26touch%20owned%20/" --debug |
|
1191 | 1191 | running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio" |
|
1192 | 1192 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) |
|
1193 | 1193 | sending hello command |
|
1194 | 1194 | sending between command |
|
1195 | 1195 | abort: no suitable response from remote hg |
|
1196 | 1196 | [255] |
|
1197 | 1197 | $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug |
|
1198 | 1198 | running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio" |
|
1199 | 1199 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) |
|
1200 | 1200 | sending hello command |
|
1201 | 1201 | sending between command |
|
1202 | 1202 | abort: no suitable response from remote hg |
|
1203 | 1203 | [255] |
|
1204 | 1204 | #else |
|
1205 | 1205 | $ hg clone "ssh://%3btouch%20owned%20/" --debug |
|
1206 | 1206 | running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio' |
|
1207 | 1207 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) |
|
1208 | 1208 | sending hello command |
|
1209 | 1209 | sending between command |
|
1210 | 1210 | abort: no suitable response from remote hg |
|
1211 | 1211 | [255] |
|
1212 | 1212 | $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug |
|
1213 | 1213 | running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio' |
|
1214 | 1214 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) |
|
1215 | 1215 | sending hello command |
|
1216 | 1216 | sending between command |
|
1217 | 1217 | abort: no suitable response from remote hg |
|
1218 | 1218 | [255] |
|
1219 | 1219 | #endif |
|
1220 | 1220 | |
|
1221 | 1221 | $ hg clone "ssh://v-alid.example.com/" --debug |
|
1222 | 1222 | running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re) |
|
1223 | 1223 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) |
|
1224 | 1224 | sending hello command |
|
1225 | 1225 | sending between command |
|
1226 | 1226 | abort: no suitable response from remote hg |
|
1227 | 1227 | [255] |
|
1228 | 1228 | |
|
1229 | 1229 | We should not have created a file named owned - if it exists, the |
|
1230 | 1230 | attack succeeded. |
|
1231 | 1231 | $ if test -f owned; then echo 'you got owned'; fi |
|
1232 | 1232 | |
|
1233 | 1233 | Cloning without fsmonitor enabled does not print a warning for small repos |
|
1234 | 1234 | |
|
1235 | 1235 | $ hg clone a fsmonitor-default |
|
1236 | 1236 | updating to bookmark @ on branch stable |
|
1237 | 1237 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1238 | 1238 | |
|
1239 | 1239 | Lower the warning threshold to simulate a large repo |
|
1240 | 1240 | |
|
1241 | 1241 | $ cat >> $HGRCPATH << EOF |
|
1242 | 1242 | > [fsmonitor] |
|
1243 | 1243 | > warn_update_file_count = 2 |
|
1244 | 1244 | > warn_update_file_count_rust = 2 |
|
1245 | 1245 | > EOF |
|
1246 | 1246 | |
|
1247 | 1247 | We should see a warning about no fsmonitor on supported platforms |
|
1248 | 1248 | |
|
1249 | 1249 | #if linuxormacos no-fsmonitor |
|
1250 | 1250 | $ hg clone a nofsmonitor |
|
1251 | 1251 | updating to bookmark @ on branch stable |
|
1252 | 1252 | (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") |
|
1253 | 1253 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1254 | 1254 | #else |
|
1255 | 1255 | $ hg clone a nofsmonitor |
|
1256 | 1256 | updating to bookmark @ on branch stable |
|
1257 | 1257 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1258 | 1258 | #endif |
|
1259 | 1259 | |
|
1260 | 1260 | We should not see warning about fsmonitor when it is enabled |
|
1261 | 1261 | |
|
1262 | 1262 | #if fsmonitor |
|
1263 | 1263 | $ hg clone a fsmonitor-enabled |
|
1264 | 1264 | updating to bookmark @ on branch stable |
|
1265 | 1265 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1266 | 1266 | #endif |
|
1267 | 1267 | |
|
1268 | 1268 | We can disable the fsmonitor warning |
|
1269 | 1269 | |
|
1270 | 1270 | $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning |
|
1271 | 1271 | updating to bookmark @ on branch stable |
|
1272 | 1272 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1273 | 1273 | |
|
1274 | 1274 | Loaded fsmonitor but disabled in config should still print warning |
|
1275 | 1275 | |
|
1276 | 1276 | #if linuxormacos fsmonitor |
|
1277 | 1277 | $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off |
|
1278 | 1278 | updating to bookmark @ on branch stable |
|
1279 | 1279 | (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !) |
|
1280 | 1280 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1281 | 1281 | #endif |
|
1282 | 1282 | |
|
1283 | 1283 | Warning not printed if working directory isn't empty |
|
1284 | 1284 | |
|
1285 | 1285 | $ hg -q clone a fsmonitor-update |
|
1286 | 1286 | (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?) |
|
1287 | 1287 | $ cd fsmonitor-update |
|
1288 | 1288 | $ hg up acb14030fe0a |
|
1289 | 1289 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
1290 | 1290 | (leaving bookmark @) |
|
1291 | 1291 | $ hg up cf0fe1914066 |
|
1292 | 1292 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1293 | 1293 | |
|
1294 | 1294 | `hg update` from null revision also prints |
|
1295 | 1295 | |
|
1296 | 1296 | $ hg up null |
|
1297 | 1297 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
1298 | 1298 | |
|
1299 | 1299 | #if linuxormacos no-fsmonitor |
|
1300 | 1300 | $ hg up cf0fe1914066 |
|
1301 | 1301 | (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") |
|
1302 | 1302 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1303 | 1303 | #else |
|
1304 | 1304 | $ hg up cf0fe1914066 |
|
1305 | 1305 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1306 | 1306 | #endif |
|
1307 | 1307 | |
|
1308 | 1308 | $ cd .. |
|
1309 | 1309 |
@@ -1,1048 +1,1048 b'' | |||
|
1 | 1 | #testcases obsstore-on obsstore-off |
|
2 | 2 | |
|
3 | 3 | $ cat > $TESTTMP/editor.py <<EOF |
|
4 | 4 | > #!"$PYTHON" |
|
5 | 5 | > import os |
|
6 | 6 | > import sys |
|
7 | 7 | > path = os.path.join(os.environ['TESTTMP'], 'messages') |
|
8 | 8 | > messages = open(path).read().split('--\n') |
|
9 | 9 | > prompt = open(sys.argv[1]).read() |
|
10 | 10 | > sys.stdout.write(''.join('EDITOR: %s' % l for l in prompt.splitlines(True))) |
|
11 | 11 | > sys.stdout.flush() |
|
12 | 12 | > with open(sys.argv[1], 'w') as f: |
|
13 | 13 | > f.write(messages[0]) |
|
14 | 14 | > with open(path, 'w') as f: |
|
15 | 15 | > f.write('--\n'.join(messages[1:])) |
|
16 | 16 | > EOF |
|
17 | 17 | |
|
18 | 18 | $ cat >> $HGRCPATH <<EOF |
|
19 | 19 | > [extensions] |
|
20 | 20 | > drawdag=$TESTDIR/drawdag.py |
|
21 | 21 | > split= |
|
22 | 22 | > [ui] |
|
23 | 23 | > interactive=1 |
|
24 | 24 | > color=no |
|
25 | 25 | > paginate=never |
|
26 | 26 | > [diff] |
|
27 | 27 | > git=1 |
|
28 | 28 | > unified=0 |
|
29 | 29 | > [commands] |
|
30 | 30 | > commit.interactive.unified=0 |
|
31 | 31 | > [alias] |
|
32 | 32 | > glog=log -G -T '{rev}:{node|short} {desc} {bookmarks}\n' |
|
33 | 33 | > EOF |
|
34 | 34 | |
|
35 | 35 | #if obsstore-on |
|
36 | 36 | $ cat >> $HGRCPATH <<EOF |
|
37 | 37 | > [experimental] |
|
38 | 38 | > evolution=all |
|
39 | 39 | > EOF |
|
40 | 40 | #endif |
|
41 | 41 | |
|
42 | 42 | $ hg init a |
|
43 | 43 | $ cd a |
|
44 | 44 | |
|
45 | 45 | Nothing to split |
|
46 | 46 | |
|
47 | 47 | $ hg split |
|
48 | 48 | nothing to split |
|
49 | 49 | [1] |
|
50 | 50 | |
|
51 | 51 | $ hg commit -m empty --config ui.allowemptycommit=1 |
|
52 | 52 | $ hg split |
|
53 | 53 | abort: cannot split an empty revision |
|
54 | 54 | [10] |
|
55 | 55 | |
|
56 | 56 | $ rm -rf .hg |
|
57 | 57 | $ hg init |
|
58 | 58 | |
|
59 | 59 | Cannot split working directory |
|
60 | 60 | |
|
61 | 61 | $ hg split -r 'wdir()' |
|
62 | 62 | abort: cannot split working directory |
|
63 | 63 | [10] |
|
64 | 64 | |
|
65 | 65 | Generate some content. The sed filter drop CR on Windows, which is dropped in |
|
66 | 66 | the a > b line. |
|
67 | 67 | |
|
68 | 68 | $ $TESTDIR/seq.py 1 5 | sed 's/\r$//' >> a |
|
69 | 69 | $ hg ci -m a1 -A a -q |
|
70 | 70 | $ hg bookmark -i r1 |
|
71 | 71 | $ sed 's/1/11/;s/3/33/;s/5/55/' a > b |
|
72 | 72 | $ mv b a |
|
73 | 73 | $ hg ci -m a2 -q |
|
74 | 74 | $ hg bookmark -i r2 |
|
75 | 75 | |
|
76 | 76 | Cannot split a public changeset |
|
77 | 77 | |
|
78 | 78 | $ hg phase --public -r 'all()' |
|
79 | 79 | $ hg split . |
|
80 | 80 | abort: cannot split public changesets |
|
81 | 81 | (see 'hg help phases' for details) |
|
82 | 82 | [10] |
|
83 | 83 | |
|
84 | 84 | $ hg phase --draft -f -r 'all()' |
|
85 | 85 | |
|
86 | 86 | Cannot split while working directory is dirty |
|
87 | 87 | |
|
88 | 88 | $ touch dirty |
|
89 | 89 | $ hg add dirty |
|
90 | 90 | $ hg split . |
|
91 | 91 | abort: uncommitted changes |
|
92 | 92 | [20] |
|
93 | 93 | $ hg forget dirty |
|
94 | 94 | $ rm dirty |
|
95 | 95 | |
|
96 | 96 | Make a clean directory for future tests to build off of |
|
97 | 97 | |
|
98 | 98 | $ cp -R . ../clean |
|
99 | 99 | |
|
100 | 100 | Split a head |
|
101 | 101 | |
|
102 | 102 | $ hg bookmark r3 |
|
103 | 103 | |
|
104 | 104 | $ hg split 'all()' |
|
105 | 105 | abort: cannot split multiple revisions |
|
106 | 106 | [10] |
|
107 | 107 | |
|
108 | 108 | This function splits a bit strangely primarily to avoid changing the behavior of |
|
109 | 109 | the test after a bug was fixed with how split/commit --interactive handled |
|
110 | 110 | `commands.commit.interactive.unified=0`: when there were no context lines, |
|
111 | 111 | it kept only the last diff hunk. When running split, this meant that runsplit |
|
112 | 112 | was always recording three commits, one for each diff hunk, in reverse order |
|
113 | 113 | (the base commit was the last diff hunk in the file). |
|
114 | 114 | $ runsplit() { |
|
115 | 115 | > cat > $TESTTMP/messages <<EOF |
|
116 | 116 | > split 1 |
|
117 | 117 | > -- |
|
118 | 118 | > split 2 |
|
119 | 119 | > -- |
|
120 | 120 | > split 3 |
|
121 | 121 | > EOF |
|
122 | 122 | > cat <<EOF | hg split "$@" |
|
123 | 123 | > y |
|
124 | 124 | > n |
|
125 | 125 | > n |
|
126 | 126 | > y |
|
127 | 127 | > y |
|
128 | 128 | > n |
|
129 | 129 | > y |
|
130 | 130 | > y |
|
131 | 131 | > y |
|
132 | 132 | > EOF |
|
133 | 133 | > } |
|
134 | 134 | |
|
135 | 135 | $ HGEDITOR=false runsplit |
|
136 | 136 | diff --git a/a b/a |
|
137 | 137 | 3 hunks, 3 lines changed |
|
138 | 138 | examine changes to 'a'? |
|
139 | 139 | (enter ? for help) [Ynesfdaq?] y |
|
140 | 140 | |
|
141 | 141 | @@ -1,1 +1,1 @@ |
|
142 | 142 | -1 |
|
143 | 143 | +11 |
|
144 | 144 | record change 1/3 to 'a'? |
|
145 | 145 | (enter ? for help) [Ynesfdaq?] n |
|
146 | 146 | |
|
147 | 147 | @@ -3,1 +3,1 @@ 2 |
|
148 | 148 | -3 |
|
149 | 149 | +33 |
|
150 | 150 | record change 2/3 to 'a'? |
|
151 | 151 | (enter ? for help) [Ynesfdaq?] n |
|
152 | 152 | |
|
153 | 153 | @@ -5,1 +5,1 @@ 4 |
|
154 | 154 | -5 |
|
155 | 155 | +55 |
|
156 | 156 | record change 3/3 to 'a'? |
|
157 | 157 | (enter ? for help) [Ynesfdaq?] y |
|
158 | 158 | |
|
159 | 159 | transaction abort! |
|
160 | 160 | rollback completed |
|
161 | 161 | abort: edit failed: false exited with status 1 |
|
162 | 162 | [250] |
|
163 | 163 | $ hg status |
|
164 | 164 | |
|
165 | 165 | $ HGEDITOR="\"$PYTHON\" $TESTTMP/editor.py" |
|
166 | 166 | $ runsplit |
|
167 | 167 | diff --git a/a b/a |
|
168 | 168 | 3 hunks, 3 lines changed |
|
169 | 169 | examine changes to 'a'? |
|
170 | 170 | (enter ? for help) [Ynesfdaq?] y |
|
171 | 171 | |
|
172 | 172 | @@ -1,1 +1,1 @@ |
|
173 | 173 | -1 |
|
174 | 174 | +11 |
|
175 | 175 | record change 1/3 to 'a'? |
|
176 | 176 | (enter ? for help) [Ynesfdaq?] n |
|
177 | 177 | |
|
178 | 178 | @@ -3,1 +3,1 @@ 2 |
|
179 | 179 | -3 |
|
180 | 180 | +33 |
|
181 | 181 | record change 2/3 to 'a'? |
|
182 | 182 | (enter ? for help) [Ynesfdaq?] n |
|
183 | 183 | |
|
184 | 184 | @@ -5,1 +5,1 @@ 4 |
|
185 | 185 | -5 |
|
186 | 186 | +55 |
|
187 | 187 | record change 3/3 to 'a'? |
|
188 | 188 | (enter ? for help) [Ynesfdaq?] y |
|
189 | 189 | |
|
190 | 190 | EDITOR: HG: Splitting 1df0d5c5a3ab. Write commit message for the first split changeset. |
|
191 | 191 | EDITOR: a2 |
|
192 | 192 | EDITOR: |
|
193 | 193 | EDITOR: |
|
194 | 194 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
195 | 195 | EDITOR: HG: Leave message empty to abort commit. |
|
196 | 196 | EDITOR: HG: -- |
|
197 | 197 | EDITOR: HG: user: test |
|
198 | 198 | EDITOR: HG: branch 'default' |
|
199 | 199 | EDITOR: HG: changed a |
|
200 | 200 | created new head |
|
201 | 201 | diff --git a/a b/a |
|
202 | 202 | 2 hunks, 2 lines changed |
|
203 | 203 | examine changes to 'a'? |
|
204 | 204 | (enter ? for help) [Ynesfdaq?] y |
|
205 | 205 | |
|
206 | 206 | @@ -1,1 +1,1 @@ |
|
207 | 207 | -1 |
|
208 | 208 | +11 |
|
209 | 209 | record change 1/2 to 'a'? |
|
210 | 210 | (enter ? for help) [Ynesfdaq?] n |
|
211 | 211 | |
|
212 | 212 | @@ -3,1 +3,1 @@ 2 |
|
213 | 213 | -3 |
|
214 | 214 | +33 |
|
215 | 215 | record change 2/2 to 'a'? |
|
216 | 216 | (enter ? for help) [Ynesfdaq?] y |
|
217 | 217 | |
|
218 | 218 | EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into: |
|
219 | 219 | EDITOR: HG: - 2:e704349bd21b tip "split 1" |
|
220 | 220 | EDITOR: HG: Write commit message for the next split changeset. |
|
221 | 221 | EDITOR: a2 |
|
222 | 222 | EDITOR: |
|
223 | 223 | EDITOR: |
|
224 | 224 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
225 | 225 | EDITOR: HG: Leave message empty to abort commit. |
|
226 | 226 | EDITOR: HG: -- |
|
227 | 227 | EDITOR: HG: user: test |
|
228 | 228 | EDITOR: HG: branch 'default' |
|
229 | 229 | EDITOR: HG: changed a |
|
230 | 230 | diff --git a/a b/a |
|
231 | 231 | 1 hunks, 1 lines changed |
|
232 | 232 | examine changes to 'a'? |
|
233 | 233 | (enter ? for help) [Ynesfdaq?] y |
|
234 | 234 | |
|
235 | 235 | @@ -1,1 +1,1 @@ |
|
236 | 236 | -1 |
|
237 | 237 | +11 |
|
238 | 238 | record this change to 'a'? |
|
239 | 239 | (enter ? for help) [Ynesfdaq?] y |
|
240 | 240 | |
|
241 | 241 | EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into: |
|
242 | 242 | EDITOR: HG: - 2:e704349bd21b tip "split 1" |
|
243 | 243 | EDITOR: HG: - 3:a09ad58faae3 "split 2" |
|
244 | 244 | EDITOR: HG: Write commit message for the next split changeset. |
|
245 | 245 | EDITOR: a2 |
|
246 | 246 | EDITOR: |
|
247 | 247 | EDITOR: |
|
248 | 248 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
249 | 249 | EDITOR: HG: Leave message empty to abort commit. |
|
250 | 250 | EDITOR: HG: -- |
|
251 | 251 | EDITOR: HG: user: test |
|
252 | 252 | EDITOR: HG: branch 'default' |
|
253 | 253 | EDITOR: HG: changed a |
|
254 | 254 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/1df0d5c5a3ab-8341b760-split.hg (obsstore-off !) |
|
255 | 255 | |
|
256 | 256 | #if obsstore-off |
|
257 | 257 | $ hg bookmark |
|
258 | 258 | r1 0:a61bcde8c529 |
|
259 | 259 | r2 3:00eebaf8d2e2 |
|
260 | 260 | * r3 3:00eebaf8d2e2 |
|
261 | 261 | $ hg glog -p |
|
262 | 262 | @ 3:00eebaf8d2e2 split 3 r2 r3 |
|
263 | 263 | | diff --git a/a b/a |
|
264 | 264 | | --- a/a |
|
265 | 265 | | +++ b/a |
|
266 | 266 | | @@ -1,1 +1,1 @@ |
|
267 | 267 | | -1 |
|
268 | 268 | | +11 |
|
269 | 269 | | |
|
270 | 270 | o 2:a09ad58faae3 split 2 |
|
271 | 271 | | diff --git a/a b/a |
|
272 | 272 | | --- a/a |
|
273 | 273 | | +++ b/a |
|
274 | 274 | | @@ -3,1 +3,1 @@ |
|
275 | 275 | | -3 |
|
276 | 276 | | +33 |
|
277 | 277 | | |
|
278 | 278 | o 1:e704349bd21b split 1 |
|
279 | 279 | | diff --git a/a b/a |
|
280 | 280 | | --- a/a |
|
281 | 281 | | +++ b/a |
|
282 | 282 | | @@ -5,1 +5,1 @@ |
|
283 | 283 | | -5 |
|
284 | 284 | | +55 |
|
285 | 285 | | |
|
286 | 286 | o 0:a61bcde8c529 a1 r1 |
|
287 | 287 | diff --git a/a b/a |
|
288 | 288 | new file mode 100644 |
|
289 | 289 | --- /dev/null |
|
290 | 290 | +++ b/a |
|
291 | 291 | @@ -0,0 +1,5 @@ |
|
292 | 292 | +1 |
|
293 | 293 | +2 |
|
294 | 294 | +3 |
|
295 | 295 | +4 |
|
296 | 296 | +5 |
|
297 | 297 | |
|
298 | 298 | #else |
|
299 | 299 | $ hg bookmark |
|
300 | 300 | r1 0:a61bcde8c529 |
|
301 | 301 | r2 4:00eebaf8d2e2 |
|
302 | 302 | * r3 4:00eebaf8d2e2 |
|
303 | 303 | $ hg glog |
|
304 | 304 | @ 4:00eebaf8d2e2 split 3 r2 r3 |
|
305 | 305 | | |
|
306 | 306 | o 3:a09ad58faae3 split 2 |
|
307 | 307 | | |
|
308 | 308 | o 2:e704349bd21b split 1 |
|
309 | 309 | | |
|
310 | 310 | o 0:a61bcde8c529 a1 r1 |
|
311 | 311 | |
|
312 | 312 | #endif |
|
313 | 313 | |
|
314 | 314 | Split a head while working parent is not that head |
|
315 | 315 | |
|
316 | 316 | $ cp -R $TESTTMP/clean $TESTTMP/b |
|
317 | 317 | $ cd $TESTTMP/b |
|
318 | 318 | |
|
319 | 319 | $ hg up 0 -q |
|
320 | 320 | $ hg bookmark r3 |
|
321 | 321 | |
|
322 | 322 | $ runsplit tip >/dev/null |
|
323 | 323 | |
|
324 | 324 | #if obsstore-off |
|
325 | 325 | $ hg bookmark |
|
326 | 326 | r1 0:a61bcde8c529 |
|
327 | 327 | r2 3:00eebaf8d2e2 |
|
328 | 328 | * r3 0:a61bcde8c529 |
|
329 | 329 | $ hg glog |
|
330 | 330 | o 3:00eebaf8d2e2 split 3 r2 |
|
331 | 331 | | |
|
332 | 332 | o 2:a09ad58faae3 split 2 |
|
333 | 333 | | |
|
334 | 334 | o 1:e704349bd21b split 1 |
|
335 | 335 | | |
|
336 | 336 | @ 0:a61bcde8c529 a1 r1 r3 |
|
337 | 337 | |
|
338 | 338 | #else |
|
339 | 339 | $ hg bookmark |
|
340 | 340 | r1 0:a61bcde8c529 |
|
341 | 341 | r2 4:00eebaf8d2e2 |
|
342 | 342 | * r3 0:a61bcde8c529 |
|
343 | 343 | $ hg glog |
|
344 | 344 | o 4:00eebaf8d2e2 split 3 r2 |
|
345 | 345 | | |
|
346 | 346 | o 3:a09ad58faae3 split 2 |
|
347 | 347 | | |
|
348 | 348 | o 2:e704349bd21b split 1 |
|
349 | 349 | | |
|
350 | 350 | @ 0:a61bcde8c529 a1 r1 r3 |
|
351 | 351 | |
|
352 | 352 | #endif |
|
353 | 353 | |
|
354 | 354 | Split a non-head |
|
355 | 355 | |
|
356 | 356 | $ cp -R $TESTTMP/clean $TESTTMP/c |
|
357 | 357 | $ cd $TESTTMP/c |
|
358 | 358 | $ echo d > d |
|
359 | 359 | $ hg ci -m d1 -A d |
|
360 | 360 | $ hg bookmark -i d1 |
|
361 | 361 | $ echo 2 >> d |
|
362 | 362 | $ hg ci -m d2 |
|
363 | 363 | $ echo 3 >> d |
|
364 | 364 | $ hg ci -m d3 |
|
365 | 365 | $ hg bookmark -i d3 |
|
366 | 366 | $ hg up '.^' -q |
|
367 | 367 | $ hg bookmark d2 |
|
368 | 368 | $ cp -R . ../d |
|
369 | 369 | |
|
370 | 370 | $ runsplit -r 1 | grep rebasing |
|
371 | 371 | rebasing 2:b5c5ea414030 d1 "d1" |
|
372 | 372 | rebasing 3:f4a0a8d004cc d2 "d2" |
|
373 | 373 | rebasing 4:777940761eba d3 "d3" |
|
374 | 374 | #if obsstore-off |
|
375 | 375 | $ hg bookmark |
|
376 | 376 | d1 4:c4b449ef030e |
|
377 | 377 | * d2 5:c9dd00ab36a3 |
|
378 | 378 | d3 6:19f476bc865c |
|
379 | 379 | r1 0:a61bcde8c529 |
|
380 | 380 | r2 3:00eebaf8d2e2 |
|
381 | 381 | $ hg glog -p |
|
382 | 382 | o 6:19f476bc865c d3 d3 |
|
383 | 383 | | diff --git a/d b/d |
|
384 | 384 | | --- a/d |
|
385 | 385 | | +++ b/d |
|
386 | 386 | | @@ -2,0 +3,1 @@ |
|
387 | 387 | | +3 |
|
388 | 388 | | |
|
389 | 389 | @ 5:c9dd00ab36a3 d2 d2 |
|
390 | 390 | | diff --git a/d b/d |
|
391 | 391 | | --- a/d |
|
392 | 392 | | +++ b/d |
|
393 | 393 | | @@ -1,0 +2,1 @@ |
|
394 | 394 | | +2 |
|
395 | 395 | | |
|
396 | 396 | o 4:c4b449ef030e d1 d1 |
|
397 | 397 | | diff --git a/d b/d |
|
398 | 398 | | new file mode 100644 |
|
399 | 399 | | --- /dev/null |
|
400 | 400 | | +++ b/d |
|
401 | 401 | | @@ -0,0 +1,1 @@ |
|
402 | 402 | | +d |
|
403 | 403 | | |
|
404 | 404 | o 3:00eebaf8d2e2 split 3 r2 |
|
405 | 405 | | diff --git a/a b/a |
|
406 | 406 | | --- a/a |
|
407 | 407 | | +++ b/a |
|
408 | 408 | | @@ -1,1 +1,1 @@ |
|
409 | 409 | | -1 |
|
410 | 410 | | +11 |
|
411 | 411 | | |
|
412 | 412 | o 2:a09ad58faae3 split 2 |
|
413 | 413 | | diff --git a/a b/a |
|
414 | 414 | | --- a/a |
|
415 | 415 | | +++ b/a |
|
416 | 416 | | @@ -3,1 +3,1 @@ |
|
417 | 417 | | -3 |
|
418 | 418 | | +33 |
|
419 | 419 | | |
|
420 | 420 | o 1:e704349bd21b split 1 |
|
421 | 421 | | diff --git a/a b/a |
|
422 | 422 | | --- a/a |
|
423 | 423 | | +++ b/a |
|
424 | 424 | | @@ -5,1 +5,1 @@ |
|
425 | 425 | | -5 |
|
426 | 426 | | +55 |
|
427 | 427 | | |
|
428 | 428 | o 0:a61bcde8c529 a1 r1 |
|
429 | 429 | diff --git a/a b/a |
|
430 | 430 | new file mode 100644 |
|
431 | 431 | --- /dev/null |
|
432 | 432 | +++ b/a |
|
433 | 433 | @@ -0,0 +1,5 @@ |
|
434 | 434 | +1 |
|
435 | 435 | +2 |
|
436 | 436 | +3 |
|
437 | 437 | +4 |
|
438 | 438 | +5 |
|
439 | 439 | |
|
440 | 440 | #else |
|
441 | 441 | $ hg bookmark |
|
442 | 442 | d1 8:c4b449ef030e |
|
443 | 443 | * d2 9:c9dd00ab36a3 |
|
444 | 444 | d3 10:19f476bc865c |
|
445 | 445 | r1 0:a61bcde8c529 |
|
446 | 446 | r2 7:00eebaf8d2e2 |
|
447 | 447 | $ hg glog |
|
448 | 448 | o 10:19f476bc865c d3 d3 |
|
449 | 449 | | |
|
450 | 450 | @ 9:c9dd00ab36a3 d2 d2 |
|
451 | 451 | | |
|
452 | 452 | o 8:c4b449ef030e d1 d1 |
|
453 | 453 | | |
|
454 | 454 | o 7:00eebaf8d2e2 split 3 r2 |
|
455 | 455 | | |
|
456 | 456 | o 6:a09ad58faae3 split 2 |
|
457 | 457 | | |
|
458 | 458 | o 5:e704349bd21b split 1 |
|
459 | 459 | | |
|
460 | 460 | o 0:a61bcde8c529 a1 r1 |
|
461 | 461 | |
|
462 | 462 | #endif |
|
463 | 463 | |
|
464 | 464 | Split a non-head without rebase |
|
465 | 465 | |
|
466 | 466 | $ cd $TESTTMP/d |
|
467 | 467 | #if obsstore-off |
|
468 | 468 | $ runsplit -r 1 --no-rebase |
|
469 | 469 | abort: cannot split changeset with children |
|
470 | 470 | [10] |
|
471 | 471 | #else |
|
472 | 472 | $ runsplit -r 1 --no-rebase >/dev/null |
|
473 | 473 | 3 new orphan changesets |
|
474 | 474 | $ hg bookmark |
|
475 | 475 | d1 2:b5c5ea414030 |
|
476 | 476 | * d2 3:f4a0a8d004cc |
|
477 | 477 | d3 4:777940761eba |
|
478 | 478 | r1 0:a61bcde8c529 |
|
479 | 479 | r2 7:00eebaf8d2e2 |
|
480 | 480 | |
|
481 | 481 | $ hg glog |
|
482 | 482 | o 7:00eebaf8d2e2 split 3 r2 |
|
483 | 483 | | |
|
484 | 484 | o 6:a09ad58faae3 split 2 |
|
485 | 485 | | |
|
486 | 486 | o 5:e704349bd21b split 1 |
|
487 | 487 | | |
|
488 | 488 | | * 4:777940761eba d3 d3 |
|
489 | 489 | | | |
|
490 | 490 | | @ 3:f4a0a8d004cc d2 d2 |
|
491 | 491 | | | |
|
492 | 492 | | * 2:b5c5ea414030 d1 d1 |
|
493 | 493 | | | |
|
494 | 494 | | x 1:1df0d5c5a3ab a2 |
|
495 | 495 | |/ |
|
496 | 496 | o 0:a61bcde8c529 a1 r1 |
|
497 | 497 | |
|
498 | 498 | #endif |
|
499 | 499 | |
|
500 | 500 | Split a non-head with obsoleted descendants |
|
501 | 501 | |
|
502 | 502 | #if obsstore-on |
|
503 | 503 | $ hg init $TESTTMP/e |
|
504 | 504 | $ cd $TESTTMP/e |
|
505 | 505 | $ hg debugdrawdag <<'EOS' |
|
506 | 506 | > H I J |
|
507 | 507 | > | | | |
|
508 | 508 | > F G1 G2 # amend: G1 -> G2 |
|
509 | 509 | > | | / # prune: F |
|
510 | 510 | > C D E |
|
511 | 511 | > \|/ |
|
512 | 512 | > B |
|
513 | 513 | > | |
|
514 | 514 | > A |
|
515 | 515 | > EOS |
|
516 | 516 | 2 new orphan changesets |
|
517 | 517 | $ eval `hg tags -T '{tag}={node}\n'` |
|
518 | 518 | $ rm .hg/localtags |
|
519 | 519 | $ hg split $B --config experimental.evolution=createmarkers |
|
520 | 520 | abort: cannot split changeset with children |
|
521 | 521 | [10] |
|
522 | 522 | $ cat > $TESTTMP/messages <<EOF |
|
523 | 523 | > Split B |
|
524 | 524 | > EOF |
|
525 | 525 | $ cat <<EOF | hg split $B |
|
526 | 526 | > y |
|
527 | 527 | > y |
|
528 | 528 | > EOF |
|
529 | 529 | diff --git a/B b/B |
|
530 | 530 | new file mode 100644 |
|
531 | 531 | examine changes to 'B'? |
|
532 | 532 | (enter ? for help) [Ynesfdaq?] y |
|
533 | 533 | |
|
534 | 534 | @@ -0,0 +1,1 @@ |
|
535 | 535 | +B |
|
536 | 536 | \ No newline at end of file |
|
537 | 537 | record this change to 'B'? |
|
538 | 538 | (enter ? for help) [Ynesfdaq?] y |
|
539 | 539 | |
|
540 | 540 | EDITOR: HG: Splitting 112478962961. Write commit message for the first split changeset. |
|
541 | 541 | EDITOR: B |
|
542 | 542 | EDITOR: |
|
543 | 543 | EDITOR: |
|
544 | 544 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
545 | 545 | EDITOR: HG: Leave message empty to abort commit. |
|
546 | 546 | EDITOR: HG: -- |
|
547 | 547 | EDITOR: HG: user: test |
|
548 | 548 | EDITOR: HG: branch 'default' |
|
549 | 549 | EDITOR: HG: added B |
|
550 | 550 | created new head |
|
551 | 551 | rebasing 2:26805aba1e60 "C" |
|
552 | 552 | rebasing 3:be0ef73c17ad "D" |
|
553 | 553 | rebasing 4:49cb92066bfd "E" |
|
554 | 554 | rebasing 7:97a6268cc7ef "G2" |
|
555 | 555 | rebasing 10:e2f1e425c0db "J" |
|
556 | 556 | $ hg glog -r 'sort(all(), topo)' |
|
557 | 557 | o 16:556c085f8b52 J |
|
558 | 558 | | |
|
559 | 559 | o 15:8761f6c9123f G2 |
|
560 | 560 | | |
|
561 | 561 | o 14:a7aeffe59b65 E |
|
562 | 562 | | |
|
563 | 563 | | o 13:e1e914ede9ab D |
|
564 | 564 | |/ |
|
565 | 565 | | o 12:01947e9b98aa C |
|
566 | 566 | |/ |
|
567 | 567 | o 11:0947baa74d47 Split B |
|
568 | 568 | | |
|
569 | 569 | | * 9:88ede1d5ee13 I |
|
570 | 570 | | | |
|
571 | 571 | | x 6:af8cbf225b7b G1 |
|
572 | 572 | | | |
|
573 | 573 | | x 3:be0ef73c17ad D |
|
574 | 574 | | | |
|
575 | 575 | | | * 8:74863e5b5074 H |
|
576 | 576 | | | | |
|
577 | 577 | | | x 5:ee481a2a1e69 F |
|
578 | 578 | | | | |
|
579 | 579 | | | x 2:26805aba1e60 C |
|
580 | 580 | | |/ |
|
581 | 581 | | x 1:112478962961 B |
|
582 | 582 | |/ |
|
583 | 583 | o 0:426bada5c675 A |
|
584 | 584 | |
|
585 | 585 | #endif |
|
586 | 586 | |
|
587 | 587 | Preserve secret phase in split |
|
588 | 588 | |
|
589 | 589 | $ cp -R $TESTTMP/clean $TESTTMP/phases1 |
|
590 | 590 | $ cd $TESTTMP/phases1 |
|
591 | 591 | $ hg phase --secret -fr tip |
|
592 | 592 | $ hg log -T '{short(node)} {phase}\n' |
|
593 | 593 | 1df0d5c5a3ab secret |
|
594 | 594 | a61bcde8c529 draft |
|
595 | 595 | $ runsplit tip >/dev/null |
|
596 | 596 | $ hg log -T '{short(node)} {phase}\n' |
|
597 | 597 | 00eebaf8d2e2 secret |
|
598 | 598 | a09ad58faae3 secret |
|
599 | 599 | e704349bd21b secret |
|
600 | 600 | a61bcde8c529 draft |
|
601 | 601 | |
|
602 | 602 | Do not move things to secret even if phases.new-commit=secret |
|
603 | 603 | |
|
604 | 604 | $ cp -R $TESTTMP/clean $TESTTMP/phases2 |
|
605 | 605 | $ cd $TESTTMP/phases2 |
|
606 | 606 | $ cat >> .hg/hgrc <<EOF |
|
607 | 607 | > [phases] |
|
608 | 608 | > new-commit=secret |
|
609 | 609 | > EOF |
|
610 | 610 | $ hg log -T '{short(node)} {phase}\n' |
|
611 | 611 | 1df0d5c5a3ab draft |
|
612 | 612 | a61bcde8c529 draft |
|
613 | 613 | $ runsplit tip >/dev/null |
|
614 | 614 | $ hg log -T '{short(node)} {phase}\n' |
|
615 | 615 | 00eebaf8d2e2 draft |
|
616 | 616 | a09ad58faae3 draft |
|
617 | 617 | e704349bd21b draft |
|
618 | 618 | a61bcde8c529 draft |
|
619 | 619 | |
|
620 | 620 | `hg split` with ignoreblanklines=1 does not infinite loop |
|
621 | 621 | |
|
622 | 622 | $ mkdir $TESTTMP/f |
|
623 | 623 | $ hg init $TESTTMP/f/a |
|
624 | 624 | $ cd $TESTTMP/f/a |
|
625 | 625 | $ printf '1\n2\n3\n4\n5\n' > foo |
|
626 | 626 | $ cp foo bar |
|
627 | 627 | $ hg ci -qAm initial |
|
628 | 628 | $ printf '1\n\n2\n3\ntest\n4\n5\n' > bar |
|
629 | 629 | $ printf '1\n2\n3\ntest\n4\n5\n' > foo |
|
630 | 630 | $ hg ci -qm splitme |
|
631 | 631 | $ cat > $TESTTMP/messages <<EOF |
|
632 | 632 | > split 1 |
|
633 | 633 | > -- |
|
634 | 634 | > split 2 |
|
635 | 635 | > EOF |
|
636 | 636 | $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split |
|
637 | 637 | diff --git a/bar b/bar |
|
638 | 638 | 2 hunks, 2 lines changed |
|
639 | 639 | examine changes to 'bar'? |
|
640 | 640 | (enter ? for help) [Ynesfdaq?] f |
|
641 | 641 | |
|
642 | 642 | diff --git a/foo b/foo |
|
643 | 643 | 1 hunks, 1 lines changed |
|
644 | 644 | examine changes to 'foo'? |
|
645 | 645 | (enter ? for help) [Ynesfdaq?] n |
|
646 | 646 | |
|
647 | 647 | EDITOR: HG: Splitting dd3c45017cbf. Write commit message for the first split changeset. |
|
648 | 648 | EDITOR: splitme |
|
649 | 649 | EDITOR: |
|
650 | 650 | EDITOR: |
|
651 | 651 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
652 | 652 | EDITOR: HG: Leave message empty to abort commit. |
|
653 | 653 | EDITOR: HG: -- |
|
654 | 654 | EDITOR: HG: user: test |
|
655 | 655 | EDITOR: HG: branch 'default' |
|
656 | 656 | EDITOR: HG: changed bar |
|
657 | 657 | created new head |
|
658 | 658 | diff --git a/foo b/foo |
|
659 | 659 | 1 hunks, 1 lines changed |
|
660 | 660 | examine changes to 'foo'? |
|
661 | 661 | (enter ? for help) [Ynesfdaq?] f |
|
662 | 662 | |
|
663 | 663 | EDITOR: HG: Splitting dd3c45017cbf. So far it has been split into: |
|
664 | 664 | EDITOR: HG: - 2:f205aea1c624 tip "split 1" |
|
665 | 665 | EDITOR: HG: Write commit message for the next split changeset. |
|
666 | 666 | EDITOR: splitme |
|
667 | 667 | EDITOR: |
|
668 | 668 | EDITOR: |
|
669 | 669 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
670 | 670 | EDITOR: HG: Leave message empty to abort commit. |
|
671 | 671 | EDITOR: HG: -- |
|
672 | 672 | EDITOR: HG: user: test |
|
673 | 673 | EDITOR: HG: branch 'default' |
|
674 | 674 | EDITOR: HG: changed foo |
|
675 | 675 | saved backup bundle to $TESTTMP/f/a/.hg/strip-backup/dd3c45017cbf-463441b5-split.hg (obsstore-off !) |
|
676 | 676 | |
|
677 | 677 | Let's try that again, with a slightly different set of patches, to ensure that |
|
678 | 678 | the ignoreblanklines thing isn't somehow position dependent. |
|
679 | 679 | |
|
680 | 680 | $ hg init $TESTTMP/f/b |
|
681 | 681 | $ cd $TESTTMP/f/b |
|
682 | 682 | $ printf '1\n2\n3\n4\n5\n' > foo |
|
683 | 683 | $ cp foo bar |
|
684 | 684 | $ hg ci -qAm initial |
|
685 | 685 | $ printf '1\n2\n3\ntest\n4\n5\n' > bar |
|
686 | 686 | $ printf '1\n2\n3\ntest\n4\n\n5\n' > foo |
|
687 | 687 | $ hg ci -qm splitme |
|
688 | 688 | $ cat > $TESTTMP/messages <<EOF |
|
689 | 689 | > split 1 |
|
690 | 690 | > -- |
|
691 | 691 | > split 2 |
|
692 | 692 | > EOF |
|
693 | 693 | $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split |
|
694 | 694 | diff --git a/bar b/bar |
|
695 | 695 | 1 hunks, 1 lines changed |
|
696 | 696 | examine changes to 'bar'? |
|
697 | 697 | (enter ? for help) [Ynesfdaq?] f |
|
698 | 698 | |
|
699 | 699 | diff --git a/foo b/foo |
|
700 | 700 | 2 hunks, 2 lines changed |
|
701 | 701 | examine changes to 'foo'? |
|
702 | 702 | (enter ? for help) [Ynesfdaq?] n |
|
703 | 703 | |
|
704 | 704 | EDITOR: HG: Splitting 904c80b40a4a. Write commit message for the first split changeset. |
|
705 | 705 | EDITOR: splitme |
|
706 | 706 | EDITOR: |
|
707 | 707 | EDITOR: |
|
708 | 708 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
709 | 709 | EDITOR: HG: Leave message empty to abort commit. |
|
710 | 710 | EDITOR: HG: -- |
|
711 | 711 | EDITOR: HG: user: test |
|
712 | 712 | EDITOR: HG: branch 'default' |
|
713 | 713 | EDITOR: HG: changed bar |
|
714 | 714 | created new head |
|
715 | 715 | diff --git a/foo b/foo |
|
716 | 716 | 2 hunks, 2 lines changed |
|
717 | 717 | examine changes to 'foo'? |
|
718 | 718 | (enter ? for help) [Ynesfdaq?] f |
|
719 | 719 | |
|
720 | 720 | EDITOR: HG: Splitting 904c80b40a4a. So far it has been split into: |
|
721 | 721 | EDITOR: HG: - 2:ffecf40fa954 tip "split 1" |
|
722 | 722 | EDITOR: HG: Write commit message for the next split changeset. |
|
723 | 723 | EDITOR: splitme |
|
724 | 724 | EDITOR: |
|
725 | 725 | EDITOR: |
|
726 | 726 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
727 | 727 | EDITOR: HG: Leave message empty to abort commit. |
|
728 | 728 | EDITOR: HG: -- |
|
729 | 729 | EDITOR: HG: user: test |
|
730 | 730 | EDITOR: HG: branch 'default' |
|
731 | 731 | EDITOR: HG: changed foo |
|
732 | 732 | saved backup bundle to $TESTTMP/f/b/.hg/strip-backup/904c80b40a4a-47fb907f-split.hg (obsstore-off !) |
|
733 | 733 | |
|
734 | 734 | |
|
735 | 735 | Testing the case in split when commiting flag-only file changes (issue5864) |
|
736 | 736 | --------------------------------------------------------------------------- |
|
737 | 737 | $ hg init $TESTTMP/issue5864 |
|
738 | 738 | $ cd $TESTTMP/issue5864 |
|
739 | 739 | $ echo foo > foo |
|
740 | 740 | $ hg add foo |
|
741 | 741 | $ hg ci -m "initial" |
|
742 | 742 | $ hg import -q --bypass -m "make executable" - <<EOF |
|
743 | 743 | > diff --git a/foo b/foo |
|
744 | 744 | > old mode 100644 |
|
745 | 745 | > new mode 100755 |
|
746 | 746 | > EOF |
|
747 | 747 | $ hg up -q |
|
748 | 748 | |
|
749 | 749 | $ hg glog |
|
750 | 750 | @ 1:3a2125f0f4cb make executable |
|
751 | 751 | | |
|
752 | 752 | o 0:51f273a58d82 initial |
|
753 | 753 | |
|
754 | 754 | |
|
755 | 755 | #if no-windows |
|
756 | 756 | $ cat > $TESTTMP/messages <<EOF |
|
757 | 757 | > split 1 |
|
758 | 758 | > EOF |
|
759 | 759 | $ printf 'y\n' | hg split |
|
760 | 760 | diff --git a/foo b/foo |
|
761 | 761 | old mode 100644 |
|
762 | 762 | new mode 100755 |
|
763 | 763 | examine changes to 'foo'? |
|
764 | 764 | (enter ? for help) [Ynesfdaq?] y |
|
765 | 765 | |
|
766 | 766 | EDITOR: HG: Splitting 3a2125f0f4cb. Write commit message for the first split changeset. |
|
767 | 767 | EDITOR: make executable |
|
768 | 768 | EDITOR: |
|
769 | 769 | EDITOR: |
|
770 | 770 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
771 | 771 | EDITOR: HG: Leave message empty to abort commit. |
|
772 | 772 | EDITOR: HG: -- |
|
773 | 773 | EDITOR: HG: user: test |
|
774 | 774 | EDITOR: HG: branch 'default' |
|
775 | 775 | EDITOR: HG: changed foo |
|
776 | 776 | created new head |
|
777 | 777 | saved backup bundle to $TESTTMP/issue5864/.hg/strip-backup/3a2125f0f4cb-629e4432-split.hg (obsstore-off !) |
|
778 | 778 | |
|
779 | 779 | $ hg log -G -T "{node|short} {desc}\n" |
|
780 | 780 | @ b154670c87da split 1 |
|
781 | 781 | | |
|
782 | 782 | o 51f273a58d82 initial |
|
783 | 783 | |
|
784 | 784 | #else |
|
785 | 785 | |
|
786 | 786 | TODO: Fix this on Windows. See issue 2020 and 5883 |
|
787 | 787 | |
|
788 | 788 | $ printf 'y\ny\ny\n' | hg split |
|
789 | 789 | abort: cannot split an empty revision |
|
790 |
[ |
|
|
790 | [10] | |
|
791 | 791 | #endif |
|
792 | 792 | |
|
793 | 793 | Test that splitting moves works properly (issue5723) |
|
794 | 794 | ---------------------------------------------------- |
|
795 | 795 | |
|
796 | 796 | $ hg init $TESTTMP/issue5723-mv |
|
797 | 797 | $ cd $TESTTMP/issue5723-mv |
|
798 | 798 | $ printf '1\n2\n' > file |
|
799 | 799 | $ hg ci -qAm initial |
|
800 | 800 | $ hg mv file file2 |
|
801 | 801 | $ printf 'a\nb\n1\n2\n3\n4\n' > file2 |
|
802 | 802 | $ cat > $TESTTMP/messages <<EOF |
|
803 | 803 | > split1, keeping only the numbered lines |
|
804 | 804 | > -- |
|
805 | 805 | > split2, keeping the lettered lines |
|
806 | 806 | > EOF |
|
807 | 807 | $ hg ci -m 'move and modify' |
|
808 | 808 | $ printf 'y\nn\na\na\n' | hg split |
|
809 | 809 | diff --git a/file b/file2 |
|
810 | 810 | rename from file |
|
811 | 811 | rename to file2 |
|
812 | 812 | 2 hunks, 4 lines changed |
|
813 | 813 | examine changes to 'file' and 'file2'? |
|
814 | 814 | (enter ? for help) [Ynesfdaq?] y |
|
815 | 815 | |
|
816 | 816 | @@ -0,0 +1,2 @@ |
|
817 | 817 | +a |
|
818 | 818 | +b |
|
819 | 819 | record change 1/2 to 'file2'? |
|
820 | 820 | (enter ? for help) [Ynesfdaq?] n |
|
821 | 821 | |
|
822 | 822 | @@ -2,0 +5,2 @@ 2 |
|
823 | 823 | +3 |
|
824 | 824 | +4 |
|
825 | 825 | record change 2/2 to 'file2'? |
|
826 | 826 | (enter ? for help) [Ynesfdaq?] a |
|
827 | 827 | |
|
828 | 828 | EDITOR: HG: Splitting 8c42fa635116. Write commit message for the first split changeset. |
|
829 | 829 | EDITOR: move and modify |
|
830 | 830 | EDITOR: |
|
831 | 831 | EDITOR: |
|
832 | 832 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
833 | 833 | EDITOR: HG: Leave message empty to abort commit. |
|
834 | 834 | EDITOR: HG: -- |
|
835 | 835 | EDITOR: HG: user: test |
|
836 | 836 | EDITOR: HG: branch 'default' |
|
837 | 837 | EDITOR: HG: added file2 |
|
838 | 838 | EDITOR: HG: removed file |
|
839 | 839 | created new head |
|
840 | 840 | diff --git a/file2 b/file2 |
|
841 | 841 | 1 hunks, 2 lines changed |
|
842 | 842 | examine changes to 'file2'? |
|
843 | 843 | (enter ? for help) [Ynesfdaq?] a |
|
844 | 844 | |
|
845 | 845 | EDITOR: HG: Splitting 8c42fa635116. So far it has been split into: |
|
846 | 846 | EDITOR: HG: - 2:478be2a70c27 tip "split1, keeping only the numbered lines" |
|
847 | 847 | EDITOR: HG: Write commit message for the next split changeset. |
|
848 | 848 | EDITOR: move and modify |
|
849 | 849 | EDITOR: |
|
850 | 850 | EDITOR: |
|
851 | 851 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
852 | 852 | EDITOR: HG: Leave message empty to abort commit. |
|
853 | 853 | EDITOR: HG: -- |
|
854 | 854 | EDITOR: HG: user: test |
|
855 | 855 | EDITOR: HG: branch 'default' |
|
856 | 856 | EDITOR: HG: changed file2 |
|
857 | 857 | saved backup bundle to $TESTTMP/issue5723-mv/.hg/strip-backup/8c42fa635116-a38044d4-split.hg (obsstore-off !) |
|
858 | 858 | $ hg log -T '{desc}: {files%"{file} "}\n' |
|
859 | 859 | split2, keeping the lettered lines: file2 |
|
860 | 860 | split1, keeping only the numbered lines: file file2 |
|
861 | 861 | initial: file |
|
862 | 862 | $ cat file2 |
|
863 | 863 | a |
|
864 | 864 | b |
|
865 | 865 | 1 |
|
866 | 866 | 2 |
|
867 | 867 | 3 |
|
868 | 868 | 4 |
|
869 | 869 | $ hg cat -r ".^" file2 |
|
870 | 870 | 1 |
|
871 | 871 | 2 |
|
872 | 872 | 3 |
|
873 | 873 | 4 |
|
874 | 874 | $ hg cat -r . file2 |
|
875 | 875 | a |
|
876 | 876 | b |
|
877 | 877 | 1 |
|
878 | 878 | 2 |
|
879 | 879 | 3 |
|
880 | 880 | 4 |
|
881 | 881 | |
|
882 | 882 | |
|
883 | 883 | Test that splitting copies works properly (issue5723) |
|
884 | 884 | ---------------------------------------------------- |
|
885 | 885 | |
|
886 | 886 | $ hg init $TESTTMP/issue5723-cp |
|
887 | 887 | $ cd $TESTTMP/issue5723-cp |
|
888 | 888 | $ printf '1\n2\n' > file |
|
889 | 889 | $ hg ci -qAm initial |
|
890 | 890 | $ hg cp file file2 |
|
891 | 891 | $ printf 'a\nb\n1\n2\n3\n4\n' > file2 |
|
892 | 892 | Also modify 'file' to prove that the changes aren't being pulled in |
|
893 | 893 | accidentally. |
|
894 | 894 | $ printf 'this is the new contents of "file"' > file |
|
895 | 895 | $ cat > $TESTTMP/messages <<EOF |
|
896 | 896 | > split1, keeping "file" and only the numbered lines in file2 |
|
897 | 897 | > -- |
|
898 | 898 | > split2, keeping the lettered lines in file2 |
|
899 | 899 | > EOF |
|
900 | 900 | $ hg ci -m 'copy file->file2, modify both' |
|
901 | 901 | $ printf 'f\ny\nn\na\na\n' | hg split |
|
902 | 902 | diff --git a/file b/file |
|
903 | 903 | 1 hunks, 2 lines changed |
|
904 | 904 | examine changes to 'file'? |
|
905 | 905 | (enter ? for help) [Ynesfdaq?] f |
|
906 | 906 | |
|
907 | 907 | diff --git a/file b/file2 |
|
908 | 908 | copy from file |
|
909 | 909 | copy to file2 |
|
910 | 910 | 2 hunks, 4 lines changed |
|
911 | 911 | examine changes to 'file' and 'file2'? |
|
912 | 912 | (enter ? for help) [Ynesfdaq?] y |
|
913 | 913 | |
|
914 | 914 | @@ -0,0 +1,2 @@ |
|
915 | 915 | +a |
|
916 | 916 | +b |
|
917 | 917 | record change 2/3 to 'file2'? |
|
918 | 918 | (enter ? for help) [Ynesfdaq?] n |
|
919 | 919 | |
|
920 | 920 | @@ -2,0 +5,2 @@ 2 |
|
921 | 921 | +3 |
|
922 | 922 | +4 |
|
923 | 923 | record change 3/3 to 'file2'? |
|
924 | 924 | (enter ? for help) [Ynesfdaq?] a |
|
925 | 925 | |
|
926 | 926 | EDITOR: HG: Splitting 41c861dfa61e. Write commit message for the first split changeset. |
|
927 | 927 | EDITOR: copy file->file2, modify both |
|
928 | 928 | EDITOR: |
|
929 | 929 | EDITOR: |
|
930 | 930 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
931 | 931 | EDITOR: HG: Leave message empty to abort commit. |
|
932 | 932 | EDITOR: HG: -- |
|
933 | 933 | EDITOR: HG: user: test |
|
934 | 934 | EDITOR: HG: branch 'default' |
|
935 | 935 | EDITOR: HG: added file2 |
|
936 | 936 | EDITOR: HG: changed file |
|
937 | 937 | created new head |
|
938 | 938 | diff --git a/file2 b/file2 |
|
939 | 939 | 1 hunks, 2 lines changed |
|
940 | 940 | examine changes to 'file2'? |
|
941 | 941 | (enter ? for help) [Ynesfdaq?] a |
|
942 | 942 | |
|
943 | 943 | EDITOR: HG: Splitting 41c861dfa61e. So far it has been split into: |
|
944 | 944 | EDITOR: HG: - 2:4b19e06610eb tip "split1, keeping "file" and only the numbered lines in file2" |
|
945 | 945 | EDITOR: HG: Write commit message for the next split changeset. |
|
946 | 946 | EDITOR: copy file->file2, modify both |
|
947 | 947 | EDITOR: |
|
948 | 948 | EDITOR: |
|
949 | 949 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
950 | 950 | EDITOR: HG: Leave message empty to abort commit. |
|
951 | 951 | EDITOR: HG: -- |
|
952 | 952 | EDITOR: HG: user: test |
|
953 | 953 | EDITOR: HG: branch 'default' |
|
954 | 954 | EDITOR: HG: changed file2 |
|
955 | 955 | saved backup bundle to $TESTTMP/issue5723-cp/.hg/strip-backup/41c861dfa61e-467e8d3c-split.hg (obsstore-off !) |
|
956 | 956 | $ hg log -T '{desc}: {files%"{file} "}\n' |
|
957 | 957 | split2, keeping the lettered lines in file2: file2 |
|
958 | 958 | split1, keeping "file" and only the numbered lines in file2: file file2 |
|
959 | 959 | initial: file |
|
960 | 960 | $ cat file2 |
|
961 | 961 | a |
|
962 | 962 | b |
|
963 | 963 | 1 |
|
964 | 964 | 2 |
|
965 | 965 | 3 |
|
966 | 966 | 4 |
|
967 | 967 | $ hg cat -r ".^" file2 |
|
968 | 968 | 1 |
|
969 | 969 | 2 |
|
970 | 970 | 3 |
|
971 | 971 | 4 |
|
972 | 972 | $ hg cat -r . file2 |
|
973 | 973 | a |
|
974 | 974 | b |
|
975 | 975 | 1 |
|
976 | 976 | 2 |
|
977 | 977 | 3 |
|
978 | 978 | 4 |
|
979 | 979 | |
|
980 | 980 | Test that color codes don't end up in the commit message template |
|
981 | 981 | ---------------------------------------------------- |
|
982 | 982 | |
|
983 | 983 | $ hg init $TESTTMP/colorless |
|
984 | 984 | $ cd $TESTTMP/colorless |
|
985 | 985 | $ echo 1 > file1 |
|
986 | 986 | $ echo 1 > file2 |
|
987 | 987 | $ hg ci -qAm initial |
|
988 | 988 | $ echo 2 > file1 |
|
989 | 989 | $ echo 2 > file2 |
|
990 | 990 | $ cat > $TESTTMP/messages <<EOF |
|
991 | 991 | > split1, modifying file1 |
|
992 | 992 | > -- |
|
993 | 993 | > split2, modifying file2 |
|
994 | 994 | > EOF |
|
995 | 995 | $ hg ci |
|
996 | 996 | EDITOR: |
|
997 | 997 | EDITOR: |
|
998 | 998 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
999 | 999 | EDITOR: HG: Leave message empty to abort commit. |
|
1000 | 1000 | EDITOR: HG: -- |
|
1001 | 1001 | EDITOR: HG: user: test |
|
1002 | 1002 | EDITOR: HG: branch 'default' |
|
1003 | 1003 | EDITOR: HG: changed file1 |
|
1004 | 1004 | EDITOR: HG: changed file2 |
|
1005 | 1005 | $ printf 'f\nn\na\n' | hg split --color=debug \ |
|
1006 | 1006 | > --config command-templates.oneline-summary='{label("rev", rev)} {desc}' |
|
1007 | 1007 | [diff.diffline|diff --git a/file1 b/file1] |
|
1008 | 1008 | 1 hunks, 1 lines changed |
|
1009 | 1009 | [ ui.prompt|examine changes to 'file1'? |
|
1010 | 1010 | (enter ? for help) [Ynesfdaq?]] [ ui.promptecho|f] |
|
1011 | 1011 | |
|
1012 | 1012 | [diff.diffline|diff --git a/file2 b/file2] |
|
1013 | 1013 | 1 hunks, 1 lines changed |
|
1014 | 1014 | [ ui.prompt|examine changes to 'file2'? |
|
1015 | 1015 | (enter ? for help) [Ynesfdaq?]] [ ui.promptecho|n] |
|
1016 | 1016 | |
|
1017 | 1017 | EDITOR: HG: Splitting 6432c65c3078. Write commit message for the first split changeset. |
|
1018 | 1018 | EDITOR: split1, modifying file1 |
|
1019 | 1019 | EDITOR: |
|
1020 | 1020 | EDITOR: |
|
1021 | 1021 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
1022 | 1022 | EDITOR: HG: Leave message empty to abort commit. |
|
1023 | 1023 | EDITOR: HG: -- |
|
1024 | 1024 | EDITOR: HG: user: test |
|
1025 | 1025 | EDITOR: HG: branch 'default' |
|
1026 | 1026 | EDITOR: HG: changed file1 |
|
1027 | 1027 | [ ui.status|created new head] |
|
1028 | 1028 | [diff.diffline|diff --git a/file2 b/file2] |
|
1029 | 1029 | 1 hunks, 1 lines changed |
|
1030 | 1030 | [ ui.prompt|examine changes to 'file2'? |
|
1031 | 1031 | (enter ? for help) [Ynesfdaq?]] [ ui.promptecho|a] |
|
1032 | 1032 | |
|
1033 | 1033 | EDITOR: HG: Splitting 6432c65c3078. So far it has been split into: |
|
1034 | 1034 | EDITOR: HG: - 2 split2, modifying file2 |
|
1035 | 1035 | EDITOR: HG: Write commit message for the next split changeset. |
|
1036 | 1036 | EDITOR: split1, modifying file1 |
|
1037 | 1037 | EDITOR: |
|
1038 | 1038 | EDITOR: |
|
1039 | 1039 | EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
1040 | 1040 | EDITOR: HG: Leave message empty to abort commit. |
|
1041 | 1041 | EDITOR: HG: -- |
|
1042 | 1042 | EDITOR: HG: user: test |
|
1043 | 1043 | EDITOR: HG: branch 'default' |
|
1044 | 1044 | EDITOR: HG: changed file2 |
|
1045 | 1045 | [ ui.warning|transaction abort!] |
|
1046 | 1046 | [ ui.warning|rollback completed] |
|
1047 | 1047 | [ ui.error|abort: empty commit message] |
|
1048 | 1048 | [10] |
General Comments 0
You need to be logged in to leave comments.
Login now