Show More
@@ -306,7 +306,7 b' def _matcheol(file, backup):' | |||
|
306 | 306 | |
|
307 | 307 | |
|
308 | 308 | @internaltool(b'prompt', nomerge) |
|
309 |
def _iprompt(repo, mynode |
|
|
309 | def _iprompt(repo, mynode, fcd, fco, fca, toolconf, labels=None): | |
|
310 | 310 | """Asks the user which of the local `p1()` or the other `p2()` version to |
|
311 | 311 | keep as the merged version.""" |
|
312 | 312 | ui = repo.ui |
@@ -347,24 +347,24 b' def _iprompt(repo, mynode, orig, fcd, fc' | |||
|
347 | 347 | choice = [b'local', b'other', b'unresolved'][index] |
|
348 | 348 | |
|
349 | 349 | if choice == b'other': |
|
350 |
return _iother(repo, mynode |
|
|
350 | return _iother(repo, mynode, fcd, fco, fca, toolconf, labels) | |
|
351 | 351 | elif choice == b'local': |
|
352 |
return _ilocal(repo, mynode |
|
|
352 | return _ilocal(repo, mynode, fcd, fco, fca, toolconf, labels) | |
|
353 | 353 | elif choice == b'unresolved': |
|
354 |
return _ifail(repo, mynode |
|
|
354 | return _ifail(repo, mynode, fcd, fco, fca, toolconf, labels) | |
|
355 | 355 | except error.ResponseExpected: |
|
356 | 356 | ui.write(b"\n") |
|
357 |
return _ifail(repo, mynode |
|
|
357 | return _ifail(repo, mynode, fcd, fco, fca, toolconf, labels) | |
|
358 | 358 | |
|
359 | 359 | |
|
360 | 360 | @internaltool(b'local', nomerge) |
|
361 |
def _ilocal(repo, mynode |
|
|
361 | def _ilocal(repo, mynode, fcd, fco, fca, toolconf, labels=None): | |
|
362 | 362 | """Uses the local `p1()` version of files as the merged version.""" |
|
363 | 363 | return 0, fcd.isabsent() |
|
364 | 364 | |
|
365 | 365 | |
|
366 | 366 | @internaltool(b'other', nomerge) |
|
367 |
def _iother(repo, mynode |
|
|
367 | def _iother(repo, mynode, fcd, fco, fca, toolconf, labels=None): | |
|
368 | 368 | """Uses the other `p2()` version of files as the merged version.""" |
|
369 | 369 | if fco.isabsent(): |
|
370 | 370 | # local changed, remote deleted -- 'deleted' picked |
@@ -377,7 +377,7 b' def _iother(repo, mynode, orig, fcd, fco' | |||
|
377 | 377 | |
|
378 | 378 | |
|
379 | 379 | @internaltool(b'fail', nomerge) |
|
380 |
def _ifail(repo, mynode |
|
|
380 | def _ifail(repo, mynode, fcd, fco, fca, toolconf, labels=None): | |
|
381 | 381 | """ |
|
382 | 382 | Rather than attempting to merge files that were modified on both |
|
383 | 383 | branches, it marks them as unresolved. The resolve command must be |
@@ -441,7 +441,7 b' def _premerge(repo, fcd, fco, fca, toolc' | |||
|
441 | 441 | return 1 # continue merging |
|
442 | 442 | |
|
443 | 443 | |
|
444 |
def _mergecheck(repo, mynode |
|
|
444 | def _mergecheck(repo, mynode, fcd, fco, fca, toolconf): | |
|
445 | 445 | tool, toolpath, binary, symlink, scriptfn = toolconf |
|
446 | 446 | uipathfn = scmutil.getuipathfn(repo) |
|
447 | 447 | if symlink: |
@@ -462,7 +462,7 b' def _mergecheck(repo, mynode, orig, fcd,' | |||
|
462 | 462 | return True |
|
463 | 463 | |
|
464 | 464 | |
|
465 |
def _merge(repo, mynode |
|
|
465 | def _merge(repo, mynode, fcd, fco, fca, toolconf, backup, labels, mode): | |
|
466 | 466 | """ |
|
467 | 467 | Uses the internal non-interactive simple merge algorithm for merging |
|
468 | 468 | files. It will fail if there are any conflicts and leave markers in |
@@ -483,13 +483,13 b' def _merge(repo, mynode, orig, fcd, fco,' | |||
|
483 | 483 | ), |
|
484 | 484 | precheck=_mergecheck, |
|
485 | 485 | ) |
|
486 |
def _iunion(repo, mynode |
|
|
486 | def _iunion(repo, mynode, fcd, fco, fca, toolconf, backup, labels=None): | |
|
487 | 487 | """ |
|
488 | 488 | Uses the internal non-interactive simple merge algorithm for merging |
|
489 | 489 | files. It will use both left and right sides for conflict regions. |
|
490 | 490 | No markers are inserted.""" |
|
491 | 491 | return _merge( |
|
492 |
repo, mynode |
|
|
492 | repo, mynode, fcd, fco, fca, toolconf, backup, labels, b'union' | |
|
493 | 493 | ) |
|
494 | 494 | |
|
495 | 495 | |
@@ -502,14 +502,14 b' def _iunion(repo, mynode, orig, fcd, fco' | |||
|
502 | 502 | ), |
|
503 | 503 | precheck=_mergecheck, |
|
504 | 504 | ) |
|
505 |
def _imerge(repo, mynode |
|
|
505 | def _imerge(repo, mynode, fcd, fco, fca, toolconf, backup, labels=None): | |
|
506 | 506 | """ |
|
507 | 507 | Uses the internal non-interactive simple merge algorithm for merging |
|
508 | 508 | files. It will fail if there are any conflicts and leave markers in |
|
509 | 509 | the partially merged file. Markers will have two sections, one for each side |
|
510 | 510 | of merge.""" |
|
511 | 511 | return _merge( |
|
512 |
repo, mynode |
|
|
512 | repo, mynode, fcd, fco, fca, toolconf, backup, labels, b'merge' | |
|
513 | 513 | ) |
|
514 | 514 | |
|
515 | 515 | |
@@ -522,7 +522,7 b' def _imerge(repo, mynode, orig, fcd, fco' | |||
|
522 | 522 | ), |
|
523 | 523 | precheck=_mergecheck, |
|
524 | 524 | ) |
|
525 |
def _imerge3(repo, mynode |
|
|
525 | def _imerge3(repo, mynode, fcd, fco, fca, toolconf, backup, labels=None): | |
|
526 | 526 | """ |
|
527 | 527 | Uses the internal non-interactive simple merge algorithm for merging |
|
528 | 528 | files. It will fail if there are any conflicts and leave markers in |
@@ -532,7 +532,7 b' def _imerge3(repo, mynode, orig, fcd, fc' | |||
|
532 | 532 | labels = _defaultconflictlabels |
|
533 | 533 | if len(labels) < 3: |
|
534 | 534 | labels.append(b'base') |
|
535 |
return _imerge(repo, mynode |
|
|
535 | return _imerge(repo, mynode, fcd, fco, fca, toolconf, backup, labels) | |
|
536 | 536 | |
|
537 | 537 | |
|
538 | 538 | @internaltool( |
@@ -563,9 +563,7 b' def _imerge3alwaysgood(*args, **kwargs):' | |||
|
563 | 563 | ), |
|
564 | 564 | precheck=_mergecheck, |
|
565 | 565 | ) |
|
566 | def _imerge_diff( | |
|
567 | repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=None | |
|
568 | ): | |
|
566 | def _imerge_diff(repo, mynode, fcd, fco, fca, toolconf, backup, labels=None): | |
|
569 | 567 | """ |
|
570 | 568 | Uses the internal non-interactive simple merge algorithm for merging |
|
571 | 569 | files. It will fail if there are any conflicts and leave markers in |
@@ -577,23 +575,13 b' def _imerge_diff(' | |||
|
577 | 575 | if len(labels) < 3: |
|
578 | 576 | labels.append(b'base') |
|
579 | 577 | return _merge( |
|
580 | repo, | |
|
581 | mynode, | |
|
582 | orig, | |
|
583 | fcd, | |
|
584 | fco, | |
|
585 | fca, | |
|
586 | toolconf, | |
|
587 | backup, | |
|
588 | labels, | |
|
589 | b'mergediff', | |
|
578 | repo, mynode, fcd, fco, fca, toolconf, backup, labels, b'mergediff' | |
|
590 | 579 | ) |
|
591 | 580 | |
|
592 | 581 | |
|
593 | 582 | def _imergeauto( |
|
594 | 583 | repo, |
|
595 | 584 | mynode, |
|
596 | orig, | |
|
597 | 585 | fcd, |
|
598 | 586 | fco, |
|
599 | 587 | fca, |
@@ -639,9 +627,7 b' def _imergeother(*args, **kwargs):' | |||
|
639 | 627 | b"tool of your choice)\n" |
|
640 | 628 | ), |
|
641 | 629 | ) |
|
642 | def _itagmerge( | |
|
643 | repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=None | |
|
644 | ): | |
|
630 | def _itagmerge(repo, mynode, fcd, fco, fca, toolconf, backup, labels=None): | |
|
645 | 631 | """ |
|
646 | 632 | Uses the internal tag merge algorithm (experimental). |
|
647 | 633 | """ |
@@ -650,7 +636,7 b' def _itagmerge(' | |||
|
650 | 636 | |
|
651 | 637 | |
|
652 | 638 | @internaltool(b'dump', fullmerge, binary=True, symlink=True) |
|
653 |
def _idump(repo, mynode |
|
|
639 | def _idump(repo, mynode, fcd, fco, fca, toolconf, backup, labels=None): | |
|
654 | 640 | """ |
|
655 | 641 | Creates three versions of the files to merge, containing the |
|
656 | 642 | contents of local, other and base. These files can then be used to |
@@ -679,20 +665,14 b' def _idump(repo, mynode, orig, fcd, fco,' | |||
|
679 | 665 | |
|
680 | 666 | |
|
681 | 667 | @internaltool(b'forcedump', mergeonly, binary=True, symlink=True) |
|
682 | def _forcedump( | |
|
683 | repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=None | |
|
684 | ): | |
|
668 | def _forcedump(repo, mynode, fcd, fco, fca, toolconf, backup, labels=None): | |
|
685 | 669 | """ |
|
686 | 670 | Creates three versions of the files as same as :dump, but omits premerge. |
|
687 | 671 | """ |
|
688 | return _idump( | |
|
689 | repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=labels | |
|
690 | ) | |
|
672 | return _idump(repo, mynode, fcd, fco, fca, toolconf, backup, labels=labels) | |
|
691 | 673 | |
|
692 | 674 | |
|
693 | def _xmergeimm( | |
|
694 | repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=None | |
|
695 | ): | |
|
675 | def _xmergeimm(repo, mynode, fcd, fco, fca, toolconf, backup, labels=None): | |
|
696 | 676 | # In-memory merge simply raises an exception on all external merge tools, |
|
697 | 677 | # for now. |
|
698 | 678 | # |
@@ -760,7 +740,7 b' def _describemerge(ui, repo, mynode, fcl' | |||
|
760 | 740 | ui.status(t.renderdefault(props)) |
|
761 | 741 | |
|
762 | 742 | |
|
763 |
def _xmerge(repo, mynode |
|
|
743 | def _xmerge(repo, mynode, fcd, fco, fca, toolconf, backup, labels): | |
|
764 | 744 | tool, toolpath, binary, symlink, scriptfn = toolconf |
|
765 | 745 | uipathfn = scmutil.getuipathfn(repo) |
|
766 | 746 | if fcd.isabsent() or fco.isabsent(): |
@@ -1109,7 +1089,7 b' def filemerge(repo, wctx, mynode, orig, ' | |||
|
1109 | 1089 | toolconf = tool, toolpath, binary, symlink, scriptfn |
|
1110 | 1090 | |
|
1111 | 1091 | if mergetype == nomerge: |
|
1112 |
r, deleted = func(repo, mynode, |
|
|
1092 | r, deleted = func(repo, mynode, fcd, fco, fca, toolconf, labels) | |
|
1113 | 1093 | return True, r, deleted |
|
1114 | 1094 | |
|
1115 | 1095 | if orig != fco.path(): |
@@ -1122,7 +1102,7 b' def filemerge(repo, wctx, mynode, orig, ' | |||
|
1122 | 1102 | |
|
1123 | 1103 | ui.debug(b"my %s other %s ancestor %s\n" % (fcd, fco, fca)) |
|
1124 | 1104 | |
|
1125 |
if precheck and not precheck(repo, mynode, |
|
|
1105 | if precheck and not precheck(repo, mynode, fcd, fco, fca, toolconf): | |
|
1126 | 1106 | if onfailure: |
|
1127 | 1107 | if wctx.isinmemory(): |
|
1128 | 1108 | raise error.InMemoryMergeConflictsError( |
@@ -1175,7 +1155,6 b' def filemerge(repo, wctx, mynode, orig, ' | |||
|
1175 | 1155 | needcheck, r, deleted = func( |
|
1176 | 1156 | repo, |
|
1177 | 1157 | mynode, |
|
1178 | orig, | |
|
1179 | 1158 | fcd, |
|
1180 | 1159 | fco, |
|
1181 | 1160 | fca, |
General Comments 0
You need to be logged in to leave comments.
Login now