##// END OF EJS Templates
tests: demonstrate crash when rebasing across copy with --collapse...
Martin von Zweigbergk -
r42508:70845eb6 default
parent child Browse files
Show More
@@ -1,826 +1,845 b''
1 1 #require symlink execbit
2 2 $ cat << EOF >> $HGRCPATH
3 3 > [phases]
4 4 > publish=False
5 5 > [extensions]
6 6 > amend=
7 7 > rebase=
8 8 > debugdrawdag=$TESTDIR/drawdag.py
9 9 > strip=
10 10 > [rebase]
11 11 > experimental.inmemory=1
12 12 > [diff]
13 13 > git=1
14 14 > [alias]
15 15 > tglog = log -G --template "{rev}: {node|short} '{desc}'\n"
16 16 > EOF
17 17
18 18 Rebase a simple DAG:
19 19 $ hg init repo1
20 20 $ cd repo1
21 21 $ hg debugdrawdag <<'EOS'
22 22 > c b
23 23 > |/
24 24 > d
25 25 > |
26 26 > a
27 27 > EOS
28 28 $ hg up -C a
29 29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 30 $ hg tglog
31 31 o 3: 814f6bd05178 'c'
32 32 |
33 33 | o 2: db0e82a16a62 'b'
34 34 |/
35 35 o 1: 02952614a83d 'd'
36 36 |
37 37 @ 0: b173517d0057 'a'
38 38
39 39 $ hg cat -r 3 c
40 40 c (no-eol)
41 41 $ hg cat -r 2 b
42 42 b (no-eol)
43 43 $ hg rebase --debug -r b -d c | grep rebasing
44 44 rebasing in-memory
45 45 rebasing 2:db0e82a16a62 "b" (b)
46 46 $ hg tglog
47 47 o 3: ca58782ad1e4 'b'
48 48 |
49 49 o 2: 814f6bd05178 'c'
50 50 |
51 51 o 1: 02952614a83d 'd'
52 52 |
53 53 @ 0: b173517d0057 'a'
54 54
55 55 $ hg cat -r 3 b
56 56 b (no-eol)
57 57 $ hg cat -r 2 c
58 58 c (no-eol)
59 59 $ cd ..
60 60
61 61 Case 2:
62 62 $ hg init repo2
63 63 $ cd repo2
64 64 $ hg debugdrawdag <<'EOS'
65 65 > c b
66 66 > |/
67 67 > d
68 68 > |
69 69 > a
70 70 > EOS
71 71
72 72 Add a symlink and executable file:
73 73 $ hg up -C c
74 74 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 75 $ ln -s somefile e
76 76 $ echo f > f
77 77 $ chmod +x f
78 78 $ hg add e f
79 79 $ hg amend -q
80 80 $ hg up -Cq a
81 81
82 82 Write files to the working copy, and ensure they're still there after the rebase
83 83 $ echo "abc" > a
84 84 $ ln -s def b
85 85 $ echo "ghi" > c
86 86 $ echo "jkl" > d
87 87 $ echo "mno" > e
88 88 $ hg tglog
89 89 o 3: f56b71190a8f 'c'
90 90 |
91 91 | o 2: db0e82a16a62 'b'
92 92 |/
93 93 o 1: 02952614a83d 'd'
94 94 |
95 95 @ 0: b173517d0057 'a'
96 96
97 97 $ hg cat -r 3 c
98 98 c (no-eol)
99 99 $ hg cat -r 2 b
100 100 b (no-eol)
101 101 $ hg cat -r 3 e
102 102 somefile (no-eol)
103 103 $ hg rebase --debug -s b -d a | grep rebasing
104 104 rebasing in-memory
105 105 rebasing 2:db0e82a16a62 "b" (b)
106 106 $ hg tglog
107 107 o 3: fc055c3b4d33 'b'
108 108 |
109 109 | o 2: f56b71190a8f 'c'
110 110 | |
111 111 | o 1: 02952614a83d 'd'
112 112 |/
113 113 @ 0: b173517d0057 'a'
114 114
115 115 $ hg cat -r 2 c
116 116 c (no-eol)
117 117 $ hg cat -r 3 b
118 118 b (no-eol)
119 119 $ hg rebase --debug -s 1 -d 3 | grep rebasing
120 120 rebasing in-memory
121 121 rebasing 1:02952614a83d "d" (d)
122 122 rebasing 2:f56b71190a8f "c"
123 123 $ hg tglog
124 124 o 3: 753feb6fd12a 'c'
125 125 |
126 126 o 2: 09c044d2cb43 'd'
127 127 |
128 128 o 1: fc055c3b4d33 'b'
129 129 |
130 130 @ 0: b173517d0057 'a'
131 131
132 132 Ensure working copy files are still there:
133 133 $ cat a
134 134 abc
135 135 $ readlink.py b
136 136 b -> def
137 137 $ cat e
138 138 mno
139 139
140 140 Ensure symlink and executable files were rebased properly:
141 141 $ hg up -Cq 3
142 142 $ readlink.py e
143 143 e -> somefile
144 144 $ ls -l f | cut -c -10
145 145 -rwxr-xr-x
146 146
147 147 Rebase the working copy parent
148 148 $ hg up -C 3
149 149 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 150 $ hg rebase -r 3 -d 0 --debug | grep rebasing
151 151 rebasing in-memory
152 152 rebasing 3:753feb6fd12a "c" (tip)
153 153 $ hg tglog
154 154 @ 3: 844a7de3e617 'c'
155 155 |
156 156 | o 2: 09c044d2cb43 'd'
157 157 | |
158 158 | o 1: fc055c3b4d33 'b'
159 159 |/
160 160 o 0: b173517d0057 'a'
161 161
162 162
163 163 Test reporting of path conflicts
164 164
165 165 $ hg rm a
166 166 $ mkdir a
167 167 $ touch a/a
168 168 $ hg ci -Am "a/a"
169 169 adding a/a
170 170 $ hg tglog
171 171 @ 4: daf7dfc139cb 'a/a'
172 172 |
173 173 o 3: 844a7de3e617 'c'
174 174 |
175 175 | o 2: 09c044d2cb43 'd'
176 176 | |
177 177 | o 1: fc055c3b4d33 'b'
178 178 |/
179 179 o 0: b173517d0057 'a'
180 180
181 181 $ hg rebase -r . -d 2
182 182 rebasing 4:daf7dfc139cb "a/a" (tip)
183 183 saved backup bundle to $TESTTMP/repo2/.hg/strip-backup/daf7dfc139cb-fdbfcf4f-rebase.hg
184 184
185 185 $ hg tglog
186 186 @ 4: c6ad37a4f250 'a/a'
187 187 |
188 188 | o 3: 844a7de3e617 'c'
189 189 | |
190 190 o | 2: 09c044d2cb43 'd'
191 191 | |
192 192 o | 1: fc055c3b4d33 'b'
193 193 |/
194 194 o 0: b173517d0057 'a'
195 195
196 196 $ echo foo > foo
197 197 $ hg ci -Aqm "added foo"
198 198 $ hg up '.^'
199 199 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
200 200 $ echo bar > bar
201 201 $ hg ci -Aqm "added bar"
202 202 $ hg rm a/a
203 203 $ echo a > a
204 204 $ hg ci -Aqm "added a back!"
205 205 $ hg tglog
206 206 @ 7: 855e9797387e 'added a back!'
207 207 |
208 208 o 6: d14530e5e3e6 'added bar'
209 209 |
210 210 | o 5: 9b94b9373deb 'added foo'
211 211 |/
212 212 o 4: c6ad37a4f250 'a/a'
213 213 |
214 214 | o 3: 844a7de3e617 'c'
215 215 | |
216 216 o | 2: 09c044d2cb43 'd'
217 217 | |
218 218 o | 1: fc055c3b4d33 'b'
219 219 |/
220 220 o 0: b173517d0057 'a'
221 221
222 222 $ hg rebase -r . -d 5
223 223 rebasing 7:855e9797387e "added a back!" (tip)
224 224 saved backup bundle to $TESTTMP/repo2/.hg/strip-backup/855e9797387e-81ee4c5d-rebase.hg
225 225
226 226 $ hg tglog
227 227 @ 7: bb3f02be2688 'added a back!'
228 228 |
229 229 | o 6: d14530e5e3e6 'added bar'
230 230 | |
231 231 o | 5: 9b94b9373deb 'added foo'
232 232 |/
233 233 o 4: c6ad37a4f250 'a/a'
234 234 |
235 235 | o 3: 844a7de3e617 'c'
236 236 | |
237 237 o | 2: 09c044d2cb43 'd'
238 238 | |
239 239 o | 1: fc055c3b4d33 'b'
240 240 |/
241 241 o 0: b173517d0057 'a'
242 242
243 243 $ mkdir -p c/subdir
244 244 $ echo c > c/subdir/file.txt
245 245 $ hg add c/subdir/file.txt
246 246 $ hg ci -m 'c/subdir/file.txt'
247 247 $ hg rebase -r . -d 3 -n
248 248 starting dry-run rebase; repository will not be changed
249 249 rebasing 8:e147e6e3c490 "c/subdir/file.txt" (tip)
250 250 abort: error: 'c/subdir/file.txt' conflicts with file 'c' in 3.
251 251 [255]
252 252 $ hg rebase -r 3 -d . -n
253 253 starting dry-run rebase; repository will not be changed
254 254 rebasing 3:844a7de3e617 "c"
255 255 abort: error: file 'c' cannot be written because 'c/' is a directory in e147e6e3c490 (containing 1 entries: c/subdir/file.txt)
256 256 [255]
257 257
258 258 $ cd ..
259 259
260 260 Test path auditing (issue5818)
261 261
262 262 $ mkdir lib_
263 263 $ ln -s lib_ lib
264 264 $ hg init repo
265 265 $ cd repo
266 266 $ mkdir -p ".$TESTTMP/lib"
267 267 $ touch ".$TESTTMP/lib/a"
268 268 $ hg add ".$TESTTMP/lib/a"
269 269 $ hg ci -m 'a'
270 270
271 271 $ touch ".$TESTTMP/lib/b"
272 272 $ hg add ".$TESTTMP/lib/b"
273 273 $ hg ci -m 'b'
274 274
275 275 $ hg up -q '.^'
276 276 $ touch ".$TESTTMP/lib/c"
277 277 $ hg add ".$TESTTMP/lib/c"
278 278 $ hg ci -m 'c'
279 279 created new head
280 280 $ hg rebase -s 1 -d .
281 281 rebasing 1:* "b" (glob)
282 282 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-rebase.hg (glob)
283 283 $ cd ..
284 284
285 285 Test dry-run rebasing
286 286
287 287 $ hg init repo3
288 288 $ cd repo3
289 289 $ echo a>a
290 290 $ hg ci -Aqma
291 291 $ echo b>b
292 292 $ hg ci -Aqmb
293 293 $ echo c>c
294 294 $ hg ci -Aqmc
295 295 $ echo d>d
296 296 $ hg ci -Aqmd
297 297 $ echo e>e
298 298 $ hg ci -Aqme
299 299
300 300 $ hg up 1 -q
301 301 $ echo f>f
302 302 $ hg ci -Amf
303 303 adding f
304 304 created new head
305 305 $ echo g>g
306 306 $ hg ci -Aqmg
307 307 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
308 308 @ 6:baf10c5166d4 test
309 309 | g
310 310 |
311 311 o 5:6343ca3eff20 test
312 312 | f
313 313 |
314 314 | o 4:e860deea161a test
315 315 | | e
316 316 | |
317 317 | o 3:055a42cdd887 test
318 318 | | d
319 319 | |
320 320 | o 2:177f92b77385 test
321 321 |/ c
322 322 |
323 323 o 1:d2ae7f538514 test
324 324 | b
325 325 |
326 326 o 0:cb9a9f314b8b test
327 327 a
328 328
329 329 Make sure it throws error while passing --continue or --abort with --dry-run
330 330 $ hg rebase -s 2 -d 6 -n --continue
331 331 abort: cannot specify both --dry-run and --continue
332 332 [255]
333 333 $ hg rebase -s 2 -d 6 -n --abort
334 334 abort: cannot specify both --dry-run and --abort
335 335 [255]
336 336
337 337 Check dryrun gives correct results when there is no conflict in rebasing
338 338 $ hg rebase -s 2 -d 6 -n
339 339 starting dry-run rebase; repository will not be changed
340 340 rebasing 2:177f92b77385 "c"
341 341 rebasing 3:055a42cdd887 "d"
342 342 rebasing 4:e860deea161a "e"
343 343 dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase
344 344
345 345 $ hg diff
346 346 $ hg status
347 347
348 348 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
349 349 @ 6:baf10c5166d4 test
350 350 | g
351 351 |
352 352 o 5:6343ca3eff20 test
353 353 | f
354 354 |
355 355 | o 4:e860deea161a test
356 356 | | e
357 357 | |
358 358 | o 3:055a42cdd887 test
359 359 | | d
360 360 | |
361 361 | o 2:177f92b77385 test
362 362 |/ c
363 363 |
364 364 o 1:d2ae7f538514 test
365 365 | b
366 366 |
367 367 o 0:cb9a9f314b8b test
368 368 a
369 369
370 370 Check dryrun working with --collapse when there is no conflict
371 371 $ hg rebase -s 2 -d 6 -n --collapse
372 372 starting dry-run rebase; repository will not be changed
373 373 rebasing 2:177f92b77385 "c"
374 374 rebasing 3:055a42cdd887 "d"
375 375 rebasing 4:e860deea161a "e"
376 376 dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase
377 377
378 378 Check dryrun gives correct results when there is conflict in rebasing
379 379 Make a conflict:
380 380 $ hg up 6 -q
381 381 $ echo conflict>e
382 382 $ hg ci -Aqm "conflict with e"
383 383 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
384 384 @ 7:d2c195b28050 test
385 385 | conflict with e
386 386 |
387 387 o 6:baf10c5166d4 test
388 388 | g
389 389 |
390 390 o 5:6343ca3eff20 test
391 391 | f
392 392 |
393 393 | o 4:e860deea161a test
394 394 | | e
395 395 | |
396 396 | o 3:055a42cdd887 test
397 397 | | d
398 398 | |
399 399 | o 2:177f92b77385 test
400 400 |/ c
401 401 |
402 402 o 1:d2ae7f538514 test
403 403 | b
404 404 |
405 405 o 0:cb9a9f314b8b test
406 406 a
407 407
408 408 $ hg rebase -s 2 -d 7 -n
409 409 starting dry-run rebase; repository will not be changed
410 410 rebasing 2:177f92b77385 "c"
411 411 rebasing 3:055a42cdd887 "d"
412 412 rebasing 4:e860deea161a "e"
413 413 merging e
414 414 transaction abort!
415 415 rollback completed
416 416 hit a merge conflict
417 417 [1]
418 418 $ hg diff
419 419 $ hg status
420 420 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
421 421 @ 7:d2c195b28050 test
422 422 | conflict with e
423 423 |
424 424 o 6:baf10c5166d4 test
425 425 | g
426 426 |
427 427 o 5:6343ca3eff20 test
428 428 | f
429 429 |
430 430 | o 4:e860deea161a test
431 431 | | e
432 432 | |
433 433 | o 3:055a42cdd887 test
434 434 | | d
435 435 | |
436 436 | o 2:177f92b77385 test
437 437 |/ c
438 438 |
439 439 o 1:d2ae7f538514 test
440 440 | b
441 441 |
442 442 o 0:cb9a9f314b8b test
443 443 a
444 444
445 445 Check dryrun working with --collapse when there is conflicts
446 446 $ hg rebase -s 2 -d 7 -n --collapse
447 447 starting dry-run rebase; repository will not be changed
448 448 rebasing 2:177f92b77385 "c"
449 449 rebasing 3:055a42cdd887 "d"
450 450 rebasing 4:e860deea161a "e"
451 451 merging e
452 452 hit a merge conflict
453 453 [1]
454 454
455 455 In-memory rebase that fails due to merge conflicts
456 456
457 457 $ hg rebase -s 2 -d 7
458 458 rebasing 2:177f92b77385 "c"
459 459 rebasing 3:055a42cdd887 "d"
460 460 rebasing 4:e860deea161a "e"
461 461 merging e
462 462 transaction abort!
463 463 rollback completed
464 464 hit merge conflicts; re-running rebase without in-memory merge
465 465 rebasing 2:177f92b77385 "c"
466 466 rebasing 3:055a42cdd887 "d"
467 467 rebasing 4:e860deea161a "e"
468 468 merging e
469 469 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
470 470 unresolved conflicts (see hg resolve, then hg rebase --continue)
471 471 [1]
472 472 $ hg rebase --abort
473 473 saved backup bundle to $TESTTMP/repo3/.hg/strip-backup/c1e524d4287c-f91f82e1-backup.hg
474 474 rebase aborted
475 475
476 476 Retrying without in-memory merge won't lose working copy changes
477 477 $ cd ..
478 478 $ hg clone repo3 repo3-dirty -q
479 479 $ cd repo3-dirty
480 480 $ echo dirty > a
481 481 $ hg rebase -s 2 -d 7
482 482 rebasing 2:177f92b77385 "c"
483 483 rebasing 3:055a42cdd887 "d"
484 484 rebasing 4:e860deea161a "e"
485 485 merging e
486 486 transaction abort!
487 487 rollback completed
488 488 hit merge conflicts; re-running rebase without in-memory merge
489 489 abort: uncommitted changes
490 490 [255]
491 491 $ cat a
492 492 dirty
493 493
494 494 Retrying without in-memory merge won't lose merge state
495 495 $ cd ..
496 496 $ hg clone repo3 repo3-merge-state -q
497 497 $ cd repo3-merge-state
498 498 $ hg merge 4
499 499 merging e
500 500 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
501 501 2 files updated, 0 files merged, 0 files removed, 1 files unresolved
502 502 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
503 503 [1]
504 504 $ hg resolve -l
505 505 U e
506 506 $ hg rebase -s 2 -d 7
507 507 rebasing 2:177f92b77385 "c"
508 508 abort: outstanding merge conflicts
509 509 [255]
510 510 $ hg resolve -l
511 511 U e
512 512
513 513 ==========================
514 514 Test for --confirm option|
515 515 ==========================
516 516 $ cd ..
517 517 $ hg clone repo3 repo4 -q
518 518 $ cd repo4
519 519 $ hg strip 7 -q
520 520 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
521 521 @ 6:baf10c5166d4 test
522 522 | g
523 523 |
524 524 o 5:6343ca3eff20 test
525 525 | f
526 526 |
527 527 | o 4:e860deea161a test
528 528 | | e
529 529 | |
530 530 | o 3:055a42cdd887 test
531 531 | | d
532 532 | |
533 533 | o 2:177f92b77385 test
534 534 |/ c
535 535 |
536 536 o 1:d2ae7f538514 test
537 537 | b
538 538 |
539 539 o 0:cb9a9f314b8b test
540 540 a
541 541
542 542 Check it gives error when both --dryrun and --confirm is used:
543 543 $ hg rebase -s 2 -d . --confirm --dry-run
544 544 abort: cannot specify both --confirm and --dry-run
545 545 [255]
546 546 $ hg rebase -s 2 -d . --confirm --abort
547 547 abort: cannot specify both --confirm and --abort
548 548 [255]
549 549 $ hg rebase -s 2 -d . --confirm --continue
550 550 abort: cannot specify both --confirm and --continue
551 551 [255]
552 552
553 553 Test --confirm option when there are no conflicts:
554 554 $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF
555 555 > n
556 556 > EOF
557 557 starting in-memory rebase
558 558 rebasing 2:177f92b77385 "c"
559 559 rebasing 3:055a42cdd887 "d"
560 560 rebasing 4:e860deea161a "e"
561 561 rebase completed successfully
562 562 apply changes (yn)? n
563 563 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
564 564 @ 6:baf10c5166d4 test
565 565 | g
566 566 |
567 567 o 5:6343ca3eff20 test
568 568 | f
569 569 |
570 570 | o 4:e860deea161a test
571 571 | | e
572 572 | |
573 573 | o 3:055a42cdd887 test
574 574 | | d
575 575 | |
576 576 | o 2:177f92b77385 test
577 577 |/ c
578 578 |
579 579 o 1:d2ae7f538514 test
580 580 | b
581 581 |
582 582 o 0:cb9a9f314b8b test
583 583 a
584 584
585 585 $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF
586 586 > y
587 587 > EOF
588 588 starting in-memory rebase
589 589 rebasing 2:177f92b77385 "c"
590 590 rebasing 3:055a42cdd887 "d"
591 591 rebasing 4:e860deea161a "e"
592 592 rebase completed successfully
593 593 apply changes (yn)? y
594 594 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
595 595 o 9:9fd28f55f6dc test
596 596 | e
597 597 |
598 598 o 8:12cbf031f469 test
599 599 | d
600 600 |
601 601 o 7:c83b1da5b1ae test
602 602 | c
603 603 |
604 604 @ 6:baf10c5166d4 test
605 605 | g
606 606 |
607 607 o 5:6343ca3eff20 test
608 608 | f
609 609 |
610 610 | o 4:e860deea161a test
611 611 | | e
612 612 | |
613 613 | o 3:055a42cdd887 test
614 614 | | d
615 615 | |
616 616 | o 2:177f92b77385 test
617 617 |/ c
618 618 |
619 619 o 1:d2ae7f538514 test
620 620 | b
621 621 |
622 622 o 0:cb9a9f314b8b test
623 623 a
624 624
625 625 Test --confirm option when there is a conflict
626 626 $ hg up tip -q
627 627 $ echo ee>e
628 628 $ hg ci --amend -m "conflict with e" -q
629 629 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
630 630 @ 9:906d72f66a59 test
631 631 | conflict with e
632 632 |
633 633 o 8:12cbf031f469 test
634 634 | d
635 635 |
636 636 o 7:c83b1da5b1ae test
637 637 | c
638 638 |
639 639 o 6:baf10c5166d4 test
640 640 | g
641 641 |
642 642 o 5:6343ca3eff20 test
643 643 | f
644 644 |
645 645 | o 4:e860deea161a test
646 646 | | e
647 647 | |
648 648 | o 3:055a42cdd887 test
649 649 | | d
650 650 | |
651 651 | o 2:177f92b77385 test
652 652 |/ c
653 653 |
654 654 o 1:d2ae7f538514 test
655 655 | b
656 656 |
657 657 o 0:cb9a9f314b8b test
658 658 a
659 659
660 660 $ hg rebase -s 4 -d . --keep --confirm
661 661 starting in-memory rebase
662 662 rebasing 4:e860deea161a "e"
663 663 merging e
664 664 hit a merge conflict
665 665 [1]
666 666 $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n"
667 667 @ 9:906d72f66a59 test
668 668 | conflict with e
669 669 |
670 670 o 8:12cbf031f469 test
671 671 | d
672 672 |
673 673 o 7:c83b1da5b1ae test
674 674 | c
675 675 |
676 676 o 6:baf10c5166d4 test
677 677 | g
678 678 |
679 679 o 5:6343ca3eff20 test
680 680 | f
681 681 |
682 682 | o 4:e860deea161a test
683 683 | | e
684 684 | |
685 685 | o 3:055a42cdd887 test
686 686 | | d
687 687 | |
688 688 | o 2:177f92b77385 test
689 689 |/ c
690 690 |
691 691 o 1:d2ae7f538514 test
692 692 | b
693 693 |
694 694 o 0:cb9a9f314b8b test
695 695 a
696 696
697 697 Test a metadata-only in-memory merge
698 698 $ cd $TESTTMP
699 699 $ hg init no_exception
700 700 $ cd no_exception
701 701 # Produce the following graph:
702 702 # o 'add +x to foo.txt'
703 703 # | o r1 (adds bar.txt, just for something to rebase to)
704 704 # |/
705 705 # o r0 (adds foo.txt, no +x)
706 706 $ echo hi > foo.txt
707 707 $ hg ci -qAm r0
708 708 $ echo hi > bar.txt
709 709 $ hg ci -qAm r1
710 710 $ hg co -qr ".^"
711 711 $ chmod +x foo.txt
712 712 $ hg ci -qAm 'add +x to foo.txt'
713 713 issue5960: this was raising an AttributeError exception
714 714 $ hg rebase -r . -d 1
715 715 rebasing 2:539b93e77479 "add +x to foo.txt" (tip)
716 716 saved backup bundle to $TESTTMP/no_exception/.hg/strip-backup/*.hg (glob)
717 717 $ hg diff -c tip
718 718 diff --git a/foo.txt b/foo.txt
719 719 old mode 100644
720 720 new mode 100755
721 721
722 722 Test rebasing a commit with copy information, but no content changes
723 723
724 724 $ cd ..
725 725 $ hg clone -q repo1 merge-and-rename
726 726 $ cd merge-and-rename
727 727 $ cat << EOF >> .hg/hgrc
728 728 > [experimental]
729 729 > evolution.createmarkers=True
730 730 > evolution.allowunstable=True
731 731 > EOF
732 732 $ hg co -q 1
733 733 $ hg mv d e
734 734 $ hg ci -qm 'rename d to e'
735 735 $ hg co -q 3
736 736 $ hg merge -q 4
737 737 $ hg ci -m 'merge'
738 738 $ hg co -q 2
739 739 $ mv d e
740 740 $ hg addremove -qs 0
741 741 $ hg ci -qm 'untracked rename of d to e'
742 742 $ hg debugobsolete -q `hg log -T '{node}' -r 4` `hg log -T '{node}' -r .`
743 743 1 new orphan changesets
744 744 $ hg tglog
745 745 @ 6: 676538af172d 'untracked rename of d to e'
746 746 |
747 747 | * 5: 71cb43376053 'merge'
748 748 | |\
749 749 | | x 4: 2c8b5dad7956 'rename d to e'
750 750 | | |
751 751 | o | 3: ca58782ad1e4 'b'
752 752 |/ /
753 753 o / 2: 814f6bd05178 'c'
754 754 |/
755 755 o 1: 02952614a83d 'd'
756 756 |
757 757 o 0: b173517d0057 'a'
758 758
759 759 $ hg rebase -b 5 -d tip
760 760 rebasing 3:ca58782ad1e4 "b"
761 761 rebasing 5:71cb43376053 "merge"
762 762 note: not rebasing 5:71cb43376053 "merge", its destination already has all its changes
763 763
764 764 $ cd ..
765 765
766 766 Test rebasing a commit with copy information
767 767
768 768 $ hg init rebase-rename
769 769 $ cd rebase-rename
770 770 $ echo a > a
771 771 $ hg ci -Aqm 'add a'
772 772 $ echo a2 > a
773 773 $ hg ci -m 'modify a'
774 774 $ hg co -q 0
775 775 $ hg mv a b
776 776 $ hg ci -qm 'rename a to b'
777 777 $ hg rebase -d 1
778 778 rebasing 2:b977edf6f839 "rename a to b" (tip)
779 779 merging a and b to b
780 780 saved backup bundle to $TESTTMP/rebase-rename/.hg/strip-backup/b977edf6f839-0864f570-rebase.hg
781 781 $ hg st --copies --change .
782 782 A b
783 783 a
784 784 R a
785 785 $ cd ..
786 786
787 Rebase across a copy with --collapse
788
789 $ hg init rebase-rename-collapse
790 $ cd rebase-rename-collapse
791 $ echo a > a
792 $ hg ci -Aqm 'add a'
793 $ hg mv a b
794 $ hg ci -m 'rename a to b'
795 $ hg co -q 0
796 $ echo a2 > a
797 $ hg ci -qm 'modify a'
798 BROKEN: obviously...
799 $ hg rebase -r . -d 1 --collapse
800 rebasing 2:41c4ea50d4cf "modify a" (tip)
801 merging b and a to b
802 abort: a@b977edf6f839: not found in manifest!
803 [255]
804 $ cd ..
805
787 806 Test rebasing when the file we are merging in destination is empty
788 807
789 808 $ hg init test
790 809 $ cd test
791 810 $ echo a > foo
792 811 $ hg ci -Aqm 'added a to foo'
793 812
794 813 $ rm foo
795 814 $ touch foo
796 815 $ hg di
797 816 diff --git a/foo b/foo
798 817 --- a/foo
799 818 +++ b/foo
800 819 @@ -1,1 +0,0 @@
801 820 -a
802 821
803 822 $ hg ci -m "make foo an empty file"
804 823
805 824 $ hg up '.^'
806 825 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
807 826 $ echo b > foo
808 827 $ hg di
809 828 diff --git a/foo b/foo
810 829 --- a/foo
811 830 +++ b/foo
812 831 @@ -1,1 +1,1 @@
813 832 -a
814 833 +b
815 834 $ hg ci -m "add b to foo"
816 835 created new head
817 836
818 837 $ hg rebase -r . -d 1 --config ui.merge=internal:merge3
819 838 rebasing 2:fb62b706688e "add b to foo" (tip)
820 839 merging foo
821 840 hit merge conflicts; re-running rebase without in-memory merge
822 841 rebasing 2:fb62b706688e "add b to foo" (tip)
823 842 merging foo
824 843 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
825 844 unresolved conflicts (see hg resolve, then hg rebase --continue)
826 845 [1]
General Comments 0
You need to be logged in to leave comments. Login now