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