Show More
@@ -1,771 +1,775 b'' | |||
|
1 | 1 | #require killdaemons |
|
2 | 2 | |
|
3 | 3 | $ cat <<EOF >> $HGRCPATH |
|
4 | 4 | > [extensions] |
|
5 | 5 | > transplant= |
|
6 | 6 | > EOF |
|
7 | 7 | |
|
8 | 8 | $ hg init t |
|
9 | 9 | $ cd t |
|
10 | 10 | $ echo r1 > r1 |
|
11 | 11 | $ hg ci -Amr1 -d'0 0' |
|
12 | 12 | adding r1 |
|
13 | 13 | $ echo r2 > r2 |
|
14 | 14 | $ hg ci -Amr2 -d'1 0' |
|
15 | 15 | adding r2 |
|
16 | 16 | $ hg up 0 |
|
17 | 17 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
18 | 18 | |
|
19 | 19 | $ echo b1 > b1 |
|
20 | 20 | $ hg ci -Amb1 -d '0 0' |
|
21 | 21 | adding b1 |
|
22 | 22 | created new head |
|
23 | 23 | $ echo b2 > b2 |
|
24 | 24 | $ hg ci -Amb2 -d '1 0' |
|
25 | 25 | adding b2 |
|
26 | 26 | $ echo b3 > b3 |
|
27 | 27 | $ hg ci -Amb3 -d '2 0' |
|
28 | 28 | adding b3 |
|
29 | 29 | |
|
30 | 30 | $ hg log --template '{rev} {parents} {desc}\n' |
|
31 | 31 | 4 b3 |
|
32 | 32 | 3 b2 |
|
33 | 33 | 2 0:17ab29e464c6 b1 |
|
34 | 34 | 1 r2 |
|
35 | 35 | 0 r1 |
|
36 | 36 | |
|
37 | 37 | $ hg clone . ../rebase |
|
38 | 38 | updating to branch default |
|
39 | 39 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
40 | 40 | $ cd ../rebase |
|
41 | 41 | |
|
42 | 42 | $ hg up -C 1 |
|
43 | 43 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
44 | 44 | |
|
45 | 45 | rebase b onto r1 |
|
46 | 46 | (this also tests that editor is not invoked if '--edit' is not specified) |
|
47 | 47 | |
|
48 | 48 | $ HGEDITOR=cat hg transplant -a -b tip |
|
49 | 49 | applying 37a1297eb21b |
|
50 | 50 | 37a1297eb21b transplanted to e234d668f844 |
|
51 | 51 | applying 722f4667af76 |
|
52 | 52 | 722f4667af76 transplanted to 539f377d78df |
|
53 | 53 | applying a53251cdf717 |
|
54 | 54 | a53251cdf717 transplanted to ffd6818a3975 |
|
55 | 55 | $ hg log --template '{rev} {parents} {desc}\n' |
|
56 | 56 | 7 b3 |
|
57 | 57 | 6 b2 |
|
58 | 58 | 5 1:d11e3596cc1a b1 |
|
59 | 59 | 4 b3 |
|
60 | 60 | 3 b2 |
|
61 | 61 | 2 0:17ab29e464c6 b1 |
|
62 | 62 | 1 r2 |
|
63 | 63 | 0 r1 |
|
64 | 64 | |
|
65 | 65 | test transplanted revset |
|
66 | 66 | |
|
67 | 67 | $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n' |
|
68 | 68 | 5 1:d11e3596cc1a b1 |
|
69 | 69 | 6 b2 |
|
70 | 70 | 7 b3 |
|
71 | 71 | $ hg help revsets | grep transplanted |
|
72 | 72 | "transplanted([set])" |
|
73 | 73 | Transplanted changesets in set, or all transplanted changesets. |
|
74 | 74 | |
|
75 | 75 | test transplanted keyword |
|
76 | 76 | |
|
77 | 77 | $ hg log --template '{rev} {transplanted}\n' |
|
78 | 78 | 7 a53251cdf717679d1907b289f991534be05c997a |
|
79 | 79 | 6 722f4667af767100cb15b6a79324bf8abbfe1ef4 |
|
80 | 80 | 5 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21 |
|
81 | 81 | 4 |
|
82 | 82 | 3 |
|
83 | 83 | 2 |
|
84 | 84 | 1 |
|
85 | 85 | 0 |
|
86 | 86 | |
|
87 | 87 | test destination() revset predicate with a transplant of a transplant; new |
|
88 | 88 | clone so subsequent rollback isn't affected |
|
89 | 89 | (this also tests that editor is invoked if '--edit' is specified) |
|
90 | 90 | |
|
91 | 91 | $ hg clone -q . ../destination |
|
92 | 92 | $ cd ../destination |
|
93 | 93 | $ hg up -Cq 0 |
|
94 | 94 | $ hg branch -q b4 |
|
95 | 95 | $ hg ci -qm "b4" |
|
96 | 96 | $ hg status --rev "7^1" --rev 7 |
|
97 | 97 | A b3 |
|
98 | 98 | $ cat > $TESTTMP/checkeditform.sh <<EOF |
|
99 | 99 | > env | grep HGEDITFORM |
|
100 | 100 | > true |
|
101 | 101 | > EOF |
|
102 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh; cat" hg transplant --edit 7 | |
|
102 | $ cat > $TESTTMP/checkeditform-n-cat.sh <<EOF | |
|
103 | > env | grep HGEDITFORM | |
|
104 | > cat \$* | |
|
105 | > EOF | |
|
106 | $ HGEDITOR="sh $TESTTMP/checkeditform-n-cat.sh" hg transplant --edit 7 | |
|
103 | 107 | applying ffd6818a3975 |
|
104 | 108 | HGEDITFORM=transplant.normal |
|
105 | 109 | b3 |
|
106 | 110 | |
|
107 | 111 | |
|
108 | 112 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
109 | 113 | HG: Leave message empty to abort commit. |
|
110 | 114 | HG: -- |
|
111 | 115 | HG: user: test |
|
112 | 116 | HG: branch 'b4' |
|
113 | 117 | HG: added b3 |
|
114 | 118 | ffd6818a3975 transplanted to 502236fa76bb |
|
115 | 119 | |
|
116 | 120 | |
|
117 | 121 | $ hg log -r 'destination()' |
|
118 | 122 | changeset: 5:e234d668f844 |
|
119 | 123 | parent: 1:d11e3596cc1a |
|
120 | 124 | user: test |
|
121 | 125 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
122 | 126 | summary: b1 |
|
123 | 127 | |
|
124 | 128 | changeset: 6:539f377d78df |
|
125 | 129 | user: test |
|
126 | 130 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
127 | 131 | summary: b2 |
|
128 | 132 | |
|
129 | 133 | changeset: 7:ffd6818a3975 |
|
130 | 134 | user: test |
|
131 | 135 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
132 | 136 | summary: b3 |
|
133 | 137 | |
|
134 | 138 | changeset: 9:502236fa76bb |
|
135 | 139 | branch: b4 |
|
136 | 140 | tag: tip |
|
137 | 141 | user: test |
|
138 | 142 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
139 | 143 | summary: b3 |
|
140 | 144 | |
|
141 | 145 | $ hg log -r 'destination(a53251cdf717)' |
|
142 | 146 | changeset: 7:ffd6818a3975 |
|
143 | 147 | user: test |
|
144 | 148 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
145 | 149 | summary: b3 |
|
146 | 150 | |
|
147 | 151 | changeset: 9:502236fa76bb |
|
148 | 152 | branch: b4 |
|
149 | 153 | tag: tip |
|
150 | 154 | user: test |
|
151 | 155 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
152 | 156 | summary: b3 |
|
153 | 157 | |
|
154 | 158 | |
|
155 | 159 | test subset parameter in reverse order |
|
156 | 160 | $ hg log -r 'reverse(all()) and destination(a53251cdf717)' |
|
157 | 161 | changeset: 9:502236fa76bb |
|
158 | 162 | branch: b4 |
|
159 | 163 | tag: tip |
|
160 | 164 | user: test |
|
161 | 165 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
162 | 166 | summary: b3 |
|
163 | 167 | |
|
164 | 168 | changeset: 7:ffd6818a3975 |
|
165 | 169 | user: test |
|
166 | 170 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
167 | 171 | summary: b3 |
|
168 | 172 | |
|
169 | 173 | |
|
170 | 174 | back to the original dir |
|
171 | 175 | $ cd ../rebase |
|
172 | 176 | |
|
173 | 177 | rollback the transplant |
|
174 | 178 | $ hg rollback |
|
175 | 179 | repository tip rolled back to revision 4 (undo transplant) |
|
176 | 180 | working directory now based on revision 1 |
|
177 | 181 | $ hg tip -q |
|
178 | 182 | 4:a53251cdf717 |
|
179 | 183 | $ hg parents -q |
|
180 | 184 | 1:d11e3596cc1a |
|
181 | 185 | $ hg status |
|
182 | 186 | ? b1 |
|
183 | 187 | ? b2 |
|
184 | 188 | ? b3 |
|
185 | 189 | |
|
186 | 190 | $ hg clone ../t ../prune |
|
187 | 191 | updating to branch default |
|
188 | 192 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
189 | 193 | $ cd ../prune |
|
190 | 194 | |
|
191 | 195 | $ hg up -C 1 |
|
192 | 196 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
193 | 197 | |
|
194 | 198 | rebase b onto r1, skipping b2 |
|
195 | 199 | |
|
196 | 200 | $ hg transplant -a -b tip -p 3 |
|
197 | 201 | applying 37a1297eb21b |
|
198 | 202 | 37a1297eb21b transplanted to e234d668f844 |
|
199 | 203 | applying a53251cdf717 |
|
200 | 204 | a53251cdf717 transplanted to 7275fda4d04f |
|
201 | 205 | $ hg log --template '{rev} {parents} {desc}\n' |
|
202 | 206 | 6 b3 |
|
203 | 207 | 5 1:d11e3596cc1a b1 |
|
204 | 208 | 4 b3 |
|
205 | 209 | 3 b2 |
|
206 | 210 | 2 0:17ab29e464c6 b1 |
|
207 | 211 | 1 r2 |
|
208 | 212 | 0 r1 |
|
209 | 213 | |
|
210 | 214 | test same-parent transplant with --log |
|
211 | 215 | |
|
212 | 216 | $ hg clone -r 1 ../t ../sameparent |
|
213 | 217 | adding changesets |
|
214 | 218 | adding manifests |
|
215 | 219 | adding file changes |
|
216 | 220 | added 2 changesets with 2 changes to 2 files |
|
217 | 221 | updating to branch default |
|
218 | 222 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
219 | 223 | $ cd ../sameparent |
|
220 | 224 | $ hg transplant --log -s ../prune 5 |
|
221 | 225 | searching for changes |
|
222 | 226 | applying e234d668f844 |
|
223 | 227 | e234d668f844 transplanted to e07aea8ecf9c |
|
224 | 228 | $ hg log --template '{rev} {parents} {desc}\n' |
|
225 | 229 | 2 b1 |
|
226 | 230 | (transplanted from e234d668f844e1b1a765f01db83a32c0c7bfa170) |
|
227 | 231 | 1 r2 |
|
228 | 232 | 0 r1 |
|
229 | 233 | remote transplant |
|
230 | 234 | |
|
231 | 235 | $ hg clone -r 1 ../t ../remote |
|
232 | 236 | adding changesets |
|
233 | 237 | adding manifests |
|
234 | 238 | adding file changes |
|
235 | 239 | added 2 changesets with 2 changes to 2 files |
|
236 | 240 | updating to branch default |
|
237 | 241 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
238 | 242 | $ cd ../remote |
|
239 | 243 | $ hg transplant --log -s ../t 2 4 |
|
240 | 244 | searching for changes |
|
241 | 245 | applying 37a1297eb21b |
|
242 | 246 | 37a1297eb21b transplanted to c19cf0ccb069 |
|
243 | 247 | applying a53251cdf717 |
|
244 | 248 | a53251cdf717 transplanted to f7fe5bf98525 |
|
245 | 249 | $ hg log --template '{rev} {parents} {desc}\n' |
|
246 | 250 | 3 b3 |
|
247 | 251 | (transplanted from a53251cdf717679d1907b289f991534be05c997a) |
|
248 | 252 | 2 b1 |
|
249 | 253 | (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21) |
|
250 | 254 | 1 r2 |
|
251 | 255 | 0 r1 |
|
252 | 256 | |
|
253 | 257 | skip previous transplants |
|
254 | 258 | |
|
255 | 259 | $ hg transplant -s ../t -a -b 4 |
|
256 | 260 | searching for changes |
|
257 | 261 | applying 722f4667af76 |
|
258 | 262 | 722f4667af76 transplanted to 47156cd86c0b |
|
259 | 263 | $ hg log --template '{rev} {parents} {desc}\n' |
|
260 | 264 | 4 b2 |
|
261 | 265 | 3 b3 |
|
262 | 266 | (transplanted from a53251cdf717679d1907b289f991534be05c997a) |
|
263 | 267 | 2 b1 |
|
264 | 268 | (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21) |
|
265 | 269 | 1 r2 |
|
266 | 270 | 0 r1 |
|
267 | 271 | |
|
268 | 272 | skip local changes transplanted to the source |
|
269 | 273 | |
|
270 | 274 | $ echo b4 > b4 |
|
271 | 275 | $ hg ci -Amb4 -d '3 0' |
|
272 | 276 | adding b4 |
|
273 | 277 | $ hg clone ../t ../pullback |
|
274 | 278 | updating to branch default |
|
275 | 279 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
276 | 280 | $ cd ../pullback |
|
277 | 281 | $ hg transplant -s ../remote -a -b tip |
|
278 | 282 | searching for changes |
|
279 | 283 | applying 4333daefcb15 |
|
280 | 284 | 4333daefcb15 transplanted to 5f42c04e07cc |
|
281 | 285 | |
|
282 | 286 | |
|
283 | 287 | remote transplant with pull |
|
284 | 288 | |
|
285 | 289 | $ hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid |
|
286 | 290 | $ cat ../t.pid >> $DAEMON_PIDS |
|
287 | 291 | |
|
288 | 292 | $ hg clone -r 0 ../t ../rp |
|
289 | 293 | adding changesets |
|
290 | 294 | adding manifests |
|
291 | 295 | adding file changes |
|
292 | 296 | added 1 changesets with 1 changes to 1 files |
|
293 | 297 | updating to branch default |
|
294 | 298 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
295 | 299 | $ cd ../rp |
|
296 | 300 | $ hg transplant -s http://localhost:$HGPORT/ 2 4 |
|
297 | 301 | searching for changes |
|
298 | 302 | searching for changes |
|
299 | 303 | adding changesets |
|
300 | 304 | adding manifests |
|
301 | 305 | adding file changes |
|
302 | 306 | added 1 changesets with 1 changes to 1 files |
|
303 | 307 | applying a53251cdf717 |
|
304 | 308 | a53251cdf717 transplanted to 8d9279348abb |
|
305 | 309 | $ hg log --template '{rev} {parents} {desc}\n' |
|
306 | 310 | 2 b3 |
|
307 | 311 | 1 b1 |
|
308 | 312 | 0 r1 |
|
309 | 313 | |
|
310 | 314 | remote transplant without pull |
|
311 | 315 | |
|
312 | 316 | $ hg pull -q http://localhost:$HGPORT/ |
|
313 | 317 | $ hg transplant -s http://localhost:$HGPORT/ 2 4 |
|
314 | 318 | searching for changes |
|
315 | 319 | skipping already applied revision 2:8d9279348abb |
|
316 | 320 | applying 722f4667af76 |
|
317 | 321 | 722f4667af76 transplanted to 76e321915884 |
|
318 | 322 | |
|
319 | 323 | transplant --continue |
|
320 | 324 | |
|
321 | 325 | $ hg init ../tc |
|
322 | 326 | $ cd ../tc |
|
323 | 327 | $ cat <<EOF > foo |
|
324 | 328 | > foo |
|
325 | 329 | > bar |
|
326 | 330 | > baz |
|
327 | 331 | > EOF |
|
328 | 332 | $ echo toremove > toremove |
|
329 | 333 | $ echo baz > baz |
|
330 | 334 | $ hg ci -Amfoo |
|
331 | 335 | adding baz |
|
332 | 336 | adding foo |
|
333 | 337 | adding toremove |
|
334 | 338 | $ cat <<EOF > foo |
|
335 | 339 | > foo2 |
|
336 | 340 | > bar2 |
|
337 | 341 | > baz2 |
|
338 | 342 | > EOF |
|
339 | 343 | $ rm toremove |
|
340 | 344 | $ echo added > added |
|
341 | 345 | $ hg ci -Amfoo2 |
|
342 | 346 | adding added |
|
343 | 347 | removing toremove |
|
344 | 348 | $ echo bar > bar |
|
345 | 349 | $ cat > baz <<EOF |
|
346 | 350 | > before baz |
|
347 | 351 | > baz |
|
348 | 352 | > after baz |
|
349 | 353 | > EOF |
|
350 | 354 | $ hg ci -Ambar |
|
351 | 355 | adding bar |
|
352 | 356 | $ echo bar2 >> bar |
|
353 | 357 | $ hg ci -mbar2 |
|
354 | 358 | $ hg up 0 |
|
355 | 359 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
356 | 360 | $ echo foobar > foo |
|
357 | 361 | $ hg ci -mfoobar |
|
358 | 362 | created new head |
|
359 | 363 | $ hg transplant 1:3 |
|
360 | 364 | applying 46ae92138f3c |
|
361 | 365 | patching file foo |
|
362 | 366 | Hunk #1 FAILED at 0 |
|
363 | 367 | 1 out of 1 hunks FAILED -- saving rejects to file foo.rej |
|
364 | 368 | patch failed to apply |
|
365 | 369 | abort: fix up the merge and run hg transplant --continue |
|
366 | 370 | [255] |
|
367 | 371 | |
|
368 | 372 | transplant -c shouldn't use an old changeset |
|
369 | 373 | |
|
370 | 374 | $ hg up -C |
|
371 | 375 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
372 | 376 | $ rm added |
|
373 | 377 | $ hg transplant 1 |
|
374 | 378 | applying 46ae92138f3c |
|
375 | 379 | patching file foo |
|
376 | 380 | Hunk #1 FAILED at 0 |
|
377 | 381 | 1 out of 1 hunks FAILED -- saving rejects to file foo.rej |
|
378 | 382 | patch failed to apply |
|
379 | 383 | abort: fix up the merge and run hg transplant --continue |
|
380 | 384 | [255] |
|
381 | 385 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e |
|
382 | 386 | HGEDITFORM=transplant.normal |
|
383 | 387 | 46ae92138f3c transplanted as 9159dada197d |
|
384 | 388 | $ hg transplant 1:3 |
|
385 | 389 | skipping already applied revision 1:46ae92138f3c |
|
386 | 390 | applying 9d6d6b5a8275 |
|
387 | 391 | 9d6d6b5a8275 transplanted to 2d17a10c922f |
|
388 | 392 | applying 1dab759070cf |
|
389 | 393 | 1dab759070cf transplanted to e06a69927eb0 |
|
390 | 394 | $ hg locate |
|
391 | 395 | added |
|
392 | 396 | bar |
|
393 | 397 | baz |
|
394 | 398 | foo |
|
395 | 399 | |
|
396 | 400 | test multiple revisions and --continue |
|
397 | 401 | |
|
398 | 402 | $ hg up -qC 0 |
|
399 | 403 | $ echo bazbaz > baz |
|
400 | 404 | $ hg ci -Am anotherbaz baz |
|
401 | 405 | created new head |
|
402 | 406 | $ hg transplant 1:3 |
|
403 | 407 | applying 46ae92138f3c |
|
404 | 408 | 46ae92138f3c transplanted to 1024233ea0ba |
|
405 | 409 | applying 9d6d6b5a8275 |
|
406 | 410 | patching file baz |
|
407 | 411 | Hunk #1 FAILED at 0 |
|
408 | 412 | 1 out of 1 hunks FAILED -- saving rejects to file baz.rej |
|
409 | 413 | patch failed to apply |
|
410 | 414 | abort: fix up the merge and run hg transplant --continue |
|
411 | 415 | [255] |
|
412 | 416 | $ echo fixed > baz |
|
413 | 417 | $ hg transplant --continue |
|
414 | 418 | 9d6d6b5a8275 transplanted as d80c49962290 |
|
415 | 419 | applying 1dab759070cf |
|
416 | 420 | 1dab759070cf transplanted to aa0ffe6bd5ae |
|
417 | 421 | |
|
418 | 422 | $ cd .. |
|
419 | 423 | |
|
420 | 424 | Issue1111: Test transplant --merge |
|
421 | 425 | |
|
422 | 426 | $ hg init t1111 |
|
423 | 427 | $ cd t1111 |
|
424 | 428 | $ echo a > a |
|
425 | 429 | $ hg ci -Am adda |
|
426 | 430 | adding a |
|
427 | 431 | $ echo b >> a |
|
428 | 432 | $ hg ci -m appendb |
|
429 | 433 | $ echo c >> a |
|
430 | 434 | $ hg ci -m appendc |
|
431 | 435 | $ hg up -C 0 |
|
432 | 436 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
433 | 437 | $ echo d >> a |
|
434 | 438 | $ hg ci -m appendd |
|
435 | 439 | created new head |
|
436 | 440 | |
|
437 | 441 | transplant |
|
438 | 442 | |
|
439 | 443 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant -m 1 -e |
|
440 | 444 | applying 42dc4432fd35 |
|
441 | 445 | HGEDITFORM=transplant.merge |
|
442 | 446 | 1:42dc4432fd35 merged at a9f4acbac129 |
|
443 | 447 | $ hg update -q -C 2 |
|
444 | 448 | $ cat > a <<EOF |
|
445 | 449 | > x |
|
446 | 450 | > y |
|
447 | 451 | > z |
|
448 | 452 | > EOF |
|
449 | 453 | $ hg commit -m replace |
|
450 | 454 | $ hg update -q -C 4 |
|
451 | 455 | $ hg transplant -m 5 |
|
452 | 456 | applying 600a3cdcb41d |
|
453 | 457 | patching file a |
|
454 | 458 | Hunk #1 FAILED at 0 |
|
455 | 459 | 1 out of 1 hunks FAILED -- saving rejects to file a.rej |
|
456 | 460 | patch failed to apply |
|
457 | 461 | abort: fix up the merge and run hg transplant --continue |
|
458 | 462 | [255] |
|
459 | 463 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e |
|
460 | 464 | HGEDITFORM=transplant.merge |
|
461 | 465 | 600a3cdcb41d transplanted as a3f88be652e0 |
|
462 | 466 | |
|
463 | 467 | $ cd .. |
|
464 | 468 | |
|
465 | 469 | test transplant into empty repository |
|
466 | 470 | |
|
467 | 471 | $ hg init empty |
|
468 | 472 | $ cd empty |
|
469 | 473 | $ hg transplant -s ../t -b tip -a |
|
470 | 474 | adding changesets |
|
471 | 475 | adding manifests |
|
472 | 476 | adding file changes |
|
473 | 477 | added 4 changesets with 4 changes to 4 files |
|
474 | 478 | |
|
475 | 479 | test "--merge" causing pull from source repository on local host |
|
476 | 480 | |
|
477 | 481 | $ hg --config extensions.mq= -q strip 2 |
|
478 | 482 | $ hg transplant -s ../t --merge tip |
|
479 | 483 | searching for changes |
|
480 | 484 | searching for changes |
|
481 | 485 | adding changesets |
|
482 | 486 | adding manifests |
|
483 | 487 | adding file changes |
|
484 | 488 | added 2 changesets with 2 changes to 2 files |
|
485 | 489 | applying a53251cdf717 |
|
486 | 490 | 4:a53251cdf717 merged at 4831f4dc831a |
|
487 | 491 | |
|
488 | 492 | test interactive transplant |
|
489 | 493 | |
|
490 | 494 | $ hg --config extensions.strip= -q strip 0 |
|
491 | 495 | $ hg -R ../t log -G --template "{rev}:{node|short}" |
|
492 | 496 | @ 4:a53251cdf717 |
|
493 | 497 | | |
|
494 | 498 | o 3:722f4667af76 |
|
495 | 499 | | |
|
496 | 500 | o 2:37a1297eb21b |
|
497 | 501 | | |
|
498 | 502 | | o 1:d11e3596cc1a |
|
499 | 503 | |/ |
|
500 | 504 | o 0:17ab29e464c6 |
|
501 | 505 | |
|
502 | 506 | $ hg transplant -q --config ui.interactive=true -s ../t <<EOF |
|
503 | 507 | > p |
|
504 | 508 | > y |
|
505 | 509 | > n |
|
506 | 510 | > n |
|
507 | 511 | > m |
|
508 | 512 | > c |
|
509 | 513 | > EOF |
|
510 | 514 | 0:17ab29e464c6 |
|
511 | 515 | apply changeset? [ynmpcq?]: p |
|
512 | 516 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
513 | 517 | +++ b/r1 Thu Jan 01 00:00:00 1970 +0000 |
|
514 | 518 | @@ -0,0 +1,1 @@ |
|
515 | 519 | +r1 |
|
516 | 520 | apply changeset? [ynmpcq?]: y |
|
517 | 521 | 1:d11e3596cc1a |
|
518 | 522 | apply changeset? [ynmpcq?]: n |
|
519 | 523 | 2:37a1297eb21b |
|
520 | 524 | apply changeset? [ynmpcq?]: n |
|
521 | 525 | 3:722f4667af76 |
|
522 | 526 | apply changeset? [ynmpcq?]: m |
|
523 | 527 | 4:a53251cdf717 |
|
524 | 528 | apply changeset? [ynmpcq?]: c |
|
525 | 529 | $ hg log -G --template "{node|short}" |
|
526 | 530 | @ 88be5dde5260 |
|
527 | 531 | |\ |
|
528 | 532 | | o 722f4667af76 |
|
529 | 533 | | | |
|
530 | 534 | | o 37a1297eb21b |
|
531 | 535 | |/ |
|
532 | 536 | o 17ab29e464c6 |
|
533 | 537 | |
|
534 | 538 | $ hg transplant -q --config ui.interactive=true -s ../t <<EOF |
|
535 | 539 | > x |
|
536 | 540 | > ? |
|
537 | 541 | > y |
|
538 | 542 | > q |
|
539 | 543 | > EOF |
|
540 | 544 | 1:d11e3596cc1a |
|
541 | 545 | apply changeset? [ynmpcq?]: x |
|
542 | 546 | unrecognized response |
|
543 | 547 | apply changeset? [ynmpcq?]: ? |
|
544 | 548 | y: yes, transplant this changeset |
|
545 | 549 | n: no, skip this changeset |
|
546 | 550 | m: merge at this changeset |
|
547 | 551 | p: show patch |
|
548 | 552 | c: commit selected changesets |
|
549 | 553 | q: quit and cancel transplant |
|
550 | 554 | ?: ? (show this help) |
|
551 | 555 | apply changeset? [ynmpcq?]: y |
|
552 | 556 | 4:a53251cdf717 |
|
553 | 557 | apply changeset? [ynmpcq?]: q |
|
554 | 558 | $ hg heads --template "{node|short}\n" |
|
555 | 559 | 88be5dde5260 |
|
556 | 560 | |
|
557 | 561 | $ cd .. |
|
558 | 562 | |
|
559 | 563 | |
|
560 | 564 | #if unix-permissions system-sh |
|
561 | 565 | |
|
562 | 566 | test filter |
|
563 | 567 | |
|
564 | 568 | $ hg init filter |
|
565 | 569 | $ cd filter |
|
566 | 570 | $ cat <<'EOF' >test-filter |
|
567 | 571 | > #!/bin/sh |
|
568 | 572 | > sed 's/r1/r2/' $1 > $1.new |
|
569 | 573 | > mv $1.new $1 |
|
570 | 574 | > EOF |
|
571 | 575 | $ chmod +x test-filter |
|
572 | 576 | $ hg transplant -s ../t -b tip -a --filter ./test-filter |
|
573 | 577 | filtering * (glob) |
|
574 | 578 | applying 17ab29e464c6 |
|
575 | 579 | 17ab29e464c6 transplanted to e9ffc54ea104 |
|
576 | 580 | filtering * (glob) |
|
577 | 581 | applying 37a1297eb21b |
|
578 | 582 | 37a1297eb21b transplanted to 348b36d0b6a5 |
|
579 | 583 | filtering * (glob) |
|
580 | 584 | applying 722f4667af76 |
|
581 | 585 | 722f4667af76 transplanted to 0aa6979afb95 |
|
582 | 586 | filtering * (glob) |
|
583 | 587 | applying a53251cdf717 |
|
584 | 588 | a53251cdf717 transplanted to 14f8512272b5 |
|
585 | 589 | $ hg log --template '{rev} {parents} {desc}\n' |
|
586 | 590 | 3 b3 |
|
587 | 591 | 2 b2 |
|
588 | 592 | 1 b1 |
|
589 | 593 | 0 r2 |
|
590 | 594 | $ cd .. |
|
591 | 595 | |
|
592 | 596 | |
|
593 | 597 | test filter with failed patch |
|
594 | 598 | |
|
595 | 599 | $ cd filter |
|
596 | 600 | $ hg up 0 |
|
597 | 601 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
598 | 602 | $ echo foo > b1 |
|
599 | 603 | $ hg ci -Am foo |
|
600 | 604 | adding b1 |
|
601 | 605 | adding test-filter |
|
602 | 606 | created new head |
|
603 | 607 | $ hg transplant 1 --filter ./test-filter |
|
604 | 608 | filtering * (glob) |
|
605 | 609 | applying 348b36d0b6a5 |
|
606 | 610 | file b1 already exists |
|
607 | 611 | 1 out of 1 hunks FAILED -- saving rejects to file b1.rej |
|
608 | 612 | patch failed to apply |
|
609 | 613 | abort: fix up the merge and run hg transplant --continue |
|
610 | 614 | [255] |
|
611 | 615 | $ cd .. |
|
612 | 616 | |
|
613 | 617 | test environment passed to filter |
|
614 | 618 | |
|
615 | 619 | $ hg init filter-environment |
|
616 | 620 | $ cd filter-environment |
|
617 | 621 | $ cat <<'EOF' >test-filter-environment |
|
618 | 622 | > #!/bin/sh |
|
619 | 623 | > echo "Transplant by $HGUSER" >> $1 |
|
620 | 624 | > echo "Transplant from rev $HGREVISION" >> $1 |
|
621 | 625 | > EOF |
|
622 | 626 | $ chmod +x test-filter-environment |
|
623 | 627 | $ hg transplant -s ../t --filter ./test-filter-environment 0 |
|
624 | 628 | filtering * (glob) |
|
625 | 629 | applying 17ab29e464c6 |
|
626 | 630 | 17ab29e464c6 transplanted to 5190e68026a0 |
|
627 | 631 | |
|
628 | 632 | $ hg log --template '{rev} {parents} {desc}\n' |
|
629 | 633 | 0 r1 |
|
630 | 634 | Transplant by test |
|
631 | 635 | Transplant from rev 17ab29e464c6ca53e329470efe2a9918ac617a6f |
|
632 | 636 | $ cd .. |
|
633 | 637 | |
|
634 | 638 | test transplant with filter handles invalid changelog |
|
635 | 639 | |
|
636 | 640 | $ hg init filter-invalid-log |
|
637 | 641 | $ cd filter-invalid-log |
|
638 | 642 | $ cat <<'EOF' >test-filter-invalid-log |
|
639 | 643 | > #!/bin/sh |
|
640 | 644 | > echo "" > $1 |
|
641 | 645 | > EOF |
|
642 | 646 | $ chmod +x test-filter-invalid-log |
|
643 | 647 | $ hg transplant -s ../t --filter ./test-filter-invalid-log 0 |
|
644 | 648 | filtering * (glob) |
|
645 | 649 | abort: filter corrupted changeset (no user or date) |
|
646 | 650 | [255] |
|
647 | 651 | $ cd .. |
|
648 | 652 | |
|
649 | 653 | #endif |
|
650 | 654 | |
|
651 | 655 | |
|
652 | 656 | test with a win32ext like setup (differing EOLs) |
|
653 | 657 | |
|
654 | 658 | $ hg init twin1 |
|
655 | 659 | $ cd twin1 |
|
656 | 660 | $ echo a > a |
|
657 | 661 | $ echo b > b |
|
658 | 662 | $ echo b >> b |
|
659 | 663 | $ hg ci -Am t |
|
660 | 664 | adding a |
|
661 | 665 | adding b |
|
662 | 666 | $ echo a > b |
|
663 | 667 | $ echo b >> b |
|
664 | 668 | $ hg ci -m changeb |
|
665 | 669 | $ cd .. |
|
666 | 670 | |
|
667 | 671 | $ hg init twin2 |
|
668 | 672 | $ cd twin2 |
|
669 | 673 | $ echo '[patch]' >> .hg/hgrc |
|
670 | 674 | $ echo 'eol = crlf' >> .hg/hgrc |
|
671 | 675 | $ $PYTHON -c "file('b', 'wb').write('b\r\nb\r\n')" |
|
672 | 676 | $ hg ci -Am addb |
|
673 | 677 | adding b |
|
674 | 678 | $ hg transplant -s ../twin1 tip |
|
675 | 679 | searching for changes |
|
676 | 680 | warning: repository is unrelated |
|
677 | 681 | applying 2e849d776c17 |
|
678 | 682 | 2e849d776c17 transplanted to 8e65bebc063e |
|
679 | 683 | $ cat b |
|
680 | 684 | a\r (esc) |
|
681 | 685 | b\r (esc) |
|
682 | 686 | $ cd .. |
|
683 | 687 | |
|
684 | 688 | test transplant with merge changeset is skipped |
|
685 | 689 | |
|
686 | 690 | $ hg init merge1a |
|
687 | 691 | $ cd merge1a |
|
688 | 692 | $ echo a > a |
|
689 | 693 | $ hg ci -Am a |
|
690 | 694 | adding a |
|
691 | 695 | $ hg branch b |
|
692 | 696 | marked working directory as branch b |
|
693 | 697 | (branches are permanent and global, did you want a bookmark?) |
|
694 | 698 | $ hg ci -m branchb |
|
695 | 699 | $ echo b > b |
|
696 | 700 | $ hg ci -Am b |
|
697 | 701 | adding b |
|
698 | 702 | $ hg update default |
|
699 | 703 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
700 | 704 | $ hg merge b |
|
701 | 705 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
702 | 706 | (branch merge, don't forget to commit) |
|
703 | 707 | $ hg ci -m mergeb |
|
704 | 708 | $ cd .. |
|
705 | 709 | |
|
706 | 710 | $ hg init merge1b |
|
707 | 711 | $ cd merge1b |
|
708 | 712 | $ hg transplant -s ../merge1a tip |
|
709 | 713 | $ cd .. |
|
710 | 714 | |
|
711 | 715 | test transplant with merge changeset accepts --parent |
|
712 | 716 | |
|
713 | 717 | $ hg init merge2a |
|
714 | 718 | $ cd merge2a |
|
715 | 719 | $ echo a > a |
|
716 | 720 | $ hg ci -Am a |
|
717 | 721 | adding a |
|
718 | 722 | $ hg branch b |
|
719 | 723 | marked working directory as branch b |
|
720 | 724 | (branches are permanent and global, did you want a bookmark?) |
|
721 | 725 | $ hg ci -m branchb |
|
722 | 726 | $ echo b > b |
|
723 | 727 | $ hg ci -Am b |
|
724 | 728 | adding b |
|
725 | 729 | $ hg update default |
|
726 | 730 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
727 | 731 | $ hg merge b |
|
728 | 732 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
729 | 733 | (branch merge, don't forget to commit) |
|
730 | 734 | $ hg ci -m mergeb |
|
731 | 735 | $ cd .. |
|
732 | 736 | |
|
733 | 737 | $ hg init merge2b |
|
734 | 738 | $ cd merge2b |
|
735 | 739 | $ hg transplant -s ../merge2a --parent 0 tip |
|
736 | 740 | applying be9f9b39483f |
|
737 | 741 | be9f9b39483f transplanted to 9959e51f94d1 |
|
738 | 742 | $ cd .. |
|
739 | 743 | |
|
740 | 744 | test transplanting a patch turning into a no-op |
|
741 | 745 | |
|
742 | 746 | $ hg init binarysource |
|
743 | 747 | $ cd binarysource |
|
744 | 748 | $ echo a > a |
|
745 | 749 | $ hg ci -Am adda a |
|
746 | 750 | >>> file('b', 'wb').write('\0b1') |
|
747 | 751 | $ hg ci -Am addb b |
|
748 | 752 | >>> file('b', 'wb').write('\0b2') |
|
749 | 753 | $ hg ci -m changeb b |
|
750 | 754 | $ cd .. |
|
751 | 755 | |
|
752 | 756 | $ hg clone -r0 binarysource binarydest |
|
753 | 757 | adding changesets |
|
754 | 758 | adding manifests |
|
755 | 759 | adding file changes |
|
756 | 760 | added 1 changesets with 1 changes to 1 files |
|
757 | 761 | updating to branch default |
|
758 | 762 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
759 | 763 | $ cd binarydest |
|
760 | 764 | $ cp ../binarysource/b b |
|
761 | 765 | $ hg ci -Am addb2 b |
|
762 | 766 | $ hg transplant -s ../binarysource 2 |
|
763 | 767 | searching for changes |
|
764 | 768 | applying 7a7d57e15850 |
|
765 | 769 | skipping emptied changeset 7a7d57e15850 |
|
766 | 770 | $ cd .. |
|
767 | 771 | |
|
768 | 772 | Explicitly kill daemons to let the test exit on Windows |
|
769 | 773 | |
|
770 | 774 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
771 | 775 |
General Comments 0
You need to be logged in to leave comments.
Login now