Show More
@@ -399,11 +399,10 b' def _underlyingfctxifabsent(filectx):' | |||||
399 | return filectx |
|
399 | return filectx | |
400 |
|
400 | |||
401 |
|
401 | |||
402 |
def _premerge(repo, fcd, fco, fca, toolconf, |
|
402 | def _premerge(repo, fcd, fco, fca, toolconf, backup, labels=None): | |
403 | tool, toolpath, binary, symlink, scriptfn = toolconf |
|
403 | tool, toolpath, binary, symlink, scriptfn = toolconf | |
404 | if symlink or fcd.isabsent() or fco.isabsent(): |
|
404 | if symlink or fcd.isabsent() or fco.isabsent(): | |
405 | return 1 |
|
405 | return 1 | |
406 | unused, unused, unused, backup = files |
|
|||
407 |
|
406 | |||
408 | ui = repo.ui |
|
407 | ui = repo.ui | |
409 |
|
408 | |||
@@ -463,7 +462,7 b' def _mergecheck(repo, mynode, orig, fcd,' | |||||
463 | return True |
|
462 | return True | |
464 |
|
463 | |||
465 |
|
464 | |||
466 |
def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
465 | def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels, mode): | |
467 | """ |
|
466 | """ | |
468 | Uses the internal non-interactive simple merge algorithm for merging |
|
467 | Uses the internal non-interactive simple merge algorithm for merging | |
469 | 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 | |
@@ -484,13 +483,13 b' def _merge(repo, mynode, orig, fcd, fco,' | |||||
484 | ), |
|
483 | ), | |
485 | precheck=_mergecheck, |
|
484 | precheck=_mergecheck, | |
486 | ) |
|
485 | ) | |
487 |
def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
486 | def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=None): | |
488 | """ |
|
487 | """ | |
489 | Uses the internal non-interactive simple merge algorithm for merging |
|
488 | Uses the internal non-interactive simple merge algorithm for merging | |
490 | 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. | |
491 | No markers are inserted.""" |
|
490 | No markers are inserted.""" | |
492 | return _merge( |
|
491 | return _merge( | |
493 |
repo, mynode, orig, fcd, fco, fca, toolconf, |
|
492 | repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels, b'union' | |
494 | ) |
|
493 | ) | |
495 |
|
494 | |||
496 |
|
495 | |||
@@ -503,14 +502,14 b' def _iunion(repo, mynode, orig, fcd, fco' | |||||
503 | ), |
|
502 | ), | |
504 | precheck=_mergecheck, |
|
503 | precheck=_mergecheck, | |
505 | ) |
|
504 | ) | |
506 |
def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
505 | def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=None): | |
507 | """ |
|
506 | """ | |
508 | Uses the internal non-interactive simple merge algorithm for merging |
|
507 | Uses the internal non-interactive simple merge algorithm for merging | |
509 | 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 | |
510 | 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 | |
511 | of merge.""" |
|
510 | of merge.""" | |
512 | return _merge( |
|
511 | return _merge( | |
513 |
repo, mynode, orig, fcd, fco, fca, toolconf, |
|
512 | repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels, b'merge' | |
514 | ) |
|
513 | ) | |
515 |
|
514 | |||
516 |
|
515 | |||
@@ -523,7 +522,7 b' def _imerge(repo, mynode, orig, fcd, fco' | |||||
523 | ), |
|
522 | ), | |
524 | precheck=_mergecheck, |
|
523 | precheck=_mergecheck, | |
525 | ) |
|
524 | ) | |
526 |
def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
525 | def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=None): | |
527 | """ |
|
526 | """ | |
528 | Uses the internal non-interactive simple merge algorithm for merging |
|
527 | Uses the internal non-interactive simple merge algorithm for merging | |
529 | 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 | |
@@ -533,7 +532,7 b' def _imerge3(repo, mynode, orig, fcd, fc' | |||||
533 | labels = _defaultconflictlabels |
|
532 | labels = _defaultconflictlabels | |
534 | if len(labels) < 3: |
|
533 | if len(labels) < 3: | |
535 | labels.append(b'base') |
|
534 | labels.append(b'base') | |
536 |
return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
535 | return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels) | |
537 |
|
536 | |||
538 |
|
537 | |||
539 | @internaltool( |
|
538 | @internaltool( | |
@@ -565,7 +564,7 b' def _imerge3alwaysgood(*args, **kwargs):' | |||||
565 | precheck=_mergecheck, |
|
564 | precheck=_mergecheck, | |
566 | ) |
|
565 | ) | |
567 | def _imerge_diff( |
|
566 | def _imerge_diff( | |
568 |
repo, mynode, orig, fcd, fco, fca, toolconf, |
|
567 | repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=None | |
569 | ): |
|
568 | ): | |
570 | """ |
|
569 | """ | |
571 | Uses the internal non-interactive simple merge algorithm for merging |
|
570 | Uses the internal non-interactive simple merge algorithm for merging | |
@@ -578,7 +577,16 b' def _imerge_diff(' | |||||
578 | if len(labels) < 3: |
|
577 | if len(labels) < 3: | |
579 | labels.append(b'base') |
|
578 | labels.append(b'base') | |
580 | return _merge( |
|
579 | return _merge( | |
581 | repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, b'mergediff' |
|
580 | repo, | |
|
581 | mynode, | |||
|
582 | orig, | |||
|
583 | fcd, | |||
|
584 | fco, | |||
|
585 | fca, | |||
|
586 | toolconf, | |||
|
587 | backup, | |||
|
588 | labels, | |||
|
589 | b'mergediff', | |||
582 | ) |
|
590 | ) | |
583 |
|
591 | |||
584 |
|
592 | |||
@@ -590,7 +598,7 b' def _imergeauto(' | |||||
590 | fco, |
|
598 | fco, | |
591 | fca, |
|
599 | fca, | |
592 | toolconf, |
|
600 | toolconf, | |
593 | files, |
|
601 | backup, | |
594 | labels=None, |
|
602 | labels=None, | |
595 | localorother=None, |
|
603 | localorother=None, | |
596 | ): |
|
604 | ): | |
@@ -631,7 +639,9 b' def _imergeother(*args, **kwargs):' | |||||
631 | b"tool of your choice)\n" |
|
639 | b"tool of your choice)\n" | |
632 | ), |
|
640 | ), | |
633 | ) |
|
641 | ) | |
634 | def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): |
|
642 | def _itagmerge( | |
|
643 | repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=None | |||
|
644 | ): | |||
635 | """ |
|
645 | """ | |
636 | Uses the internal tag merge algorithm (experimental). |
|
646 | Uses the internal tag merge algorithm (experimental). | |
637 | """ |
|
647 | """ | |
@@ -640,7 +650,7 b' def _itagmerge(repo, mynode, orig, fcd, ' | |||||
640 |
|
650 | |||
641 |
|
651 | |||
642 | @internaltool(b'dump', fullmerge, binary=True, symlink=True) |
|
652 | @internaltool(b'dump', fullmerge, binary=True, symlink=True) | |
643 |
def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
653 | def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=None): | |
644 | """ |
|
654 | """ | |
645 | Creates three versions of the files to merge, containing the |
|
655 | Creates three versions of the files to merge, containing the | |
646 | contents of local, other and base. These files can then be used to |
|
656 | contents of local, other and base. These files can then be used to | |
@@ -669,16 +679,20 b' def _idump(repo, mynode, orig, fcd, fco,' | |||||
669 |
|
679 | |||
670 |
|
680 | |||
671 | @internaltool(b'forcedump', mergeonly, binary=True, symlink=True) |
|
681 | @internaltool(b'forcedump', mergeonly, binary=True, symlink=True) | |
672 | def _forcedump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): |
|
682 | def _forcedump( | |
|
683 | repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=None | |||
|
684 | ): | |||
673 | """ |
|
685 | """ | |
674 | Creates three versions of the files as same as :dump, but omits premerge. |
|
686 | Creates three versions of the files as same as :dump, but omits premerge. | |
675 | """ |
|
687 | """ | |
676 | return _idump( |
|
688 | return _idump( | |
677 |
repo, mynode, orig, fcd, fco, fca, toolconf, |
|
689 | repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=labels | |
678 | ) |
|
690 | ) | |
679 |
|
691 | |||
680 |
|
692 | |||
681 | def _xmergeimm(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): |
|
693 | def _xmergeimm( | |
|
694 | repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels=None | |||
|
695 | ): | |||
682 | # In-memory merge simply raises an exception on all external merge tools, |
|
696 | # In-memory merge simply raises an exception on all external merge tools, | |
683 | # for now. |
|
697 | # for now. | |
684 | # |
|
698 | # | |
@@ -746,7 +760,7 b' def _describemerge(ui, repo, mynode, fcl' | |||||
746 | ui.status(t.renderdefault(props)) |
|
760 | ui.status(t.renderdefault(props)) | |
747 |
|
761 | |||
748 |
|
762 | |||
749 |
def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
763 | def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, backup, labels): | |
750 | tool, toolpath, binary, symlink, scriptfn = toolconf |
|
764 | tool, toolpath, binary, symlink, scriptfn = toolconf | |
751 | uipathfn = scmutil.getuipathfn(repo) |
|
765 | uipathfn = scmutil.getuipathfn(repo) | |
752 | if fcd.isabsent() or fco.isabsent(): |
|
766 | if fcd.isabsent() or fco.isabsent(): | |
@@ -755,7 +769,6 b' def _xmerge(repo, mynode, orig, fcd, fco' | |||||
755 | % (tool, uipathfn(fcd.path())) |
|
769 | % (tool, uipathfn(fcd.path())) | |
756 | ) |
|
770 | ) | |
757 | return False, 1, None |
|
771 | return False, 1, None | |
758 | unused, unused, unused, backup = files |
|
|||
759 | localpath = _workingpath(repo, fcd) |
|
772 | localpath = _workingpath(repo, fcd) | |
760 | args = _toolstr(repo.ui, tool, b"args") |
|
773 | args = _toolstr(repo.ui, tool, b"args") | |
761 |
|
774 | |||
@@ -1119,7 +1132,6 b' def filemerge(repo, wctx, mynode, orig, ' | |||||
1119 | return True, 1, False |
|
1132 | return True, 1, False | |
1120 |
|
1133 | |||
1121 | backup = _makebackup(repo, ui, wctx, fcd) |
|
1134 | backup = _makebackup(repo, ui, wctx, fcd) | |
1122 | files = (None, None, None, backup) |
|
|||
1123 | r = 1 |
|
1135 | r = 1 | |
1124 | try: |
|
1136 | try: | |
1125 | internalmarkerstyle = ui.config(b'ui', b'mergemarkers') |
|
1137 | internalmarkerstyle = ui.config(b'ui', b'mergemarkers') | |
@@ -1154,7 +1166,7 b' def filemerge(repo, wctx, mynode, orig, ' | |||||
1154 | ) |
|
1166 | ) | |
1155 |
|
1167 | |||
1156 | r = _premerge( |
|
1168 | r = _premerge( | |
1157 |
repo, fcd, fco, fca, toolconf, |
|
1169 | repo, fcd, fco, fca, toolconf, backup, labels=premergelabels | |
1158 | ) |
|
1170 | ) | |
1159 | # we're done if premerge was successful (r is 0) |
|
1171 | # we're done if premerge was successful (r is 0) | |
1160 | if not r: |
|
1172 | if not r: | |
@@ -1168,12 +1180,12 b' def filemerge(repo, wctx, mynode, orig, ' | |||||
1168 | fco, |
|
1180 | fco, | |
1169 | fca, |
|
1181 | fca, | |
1170 | toolconf, |
|
1182 | toolconf, | |
1171 |
|
|
1183 | backup, | |
1172 | labels=formattedlabels, |
|
1184 | labels=formattedlabels, | |
1173 | ) |
|
1185 | ) | |
1174 |
|
1186 | |||
1175 | if needcheck: |
|
1187 | if needcheck: | |
1176 |
r = _check(repo, r, ui, tool, fcd, |
|
1188 | r = _check(repo, r, ui, tool, fcd, backup) | |
1177 |
|
1189 | |||
1178 | if r: |
|
1190 | if r: | |
1179 | if onfailure: |
|
1191 | if onfailure: | |
@@ -1222,10 +1234,9 b' def hasconflictmarkers(data):' | |||||
1222 | ) |
|
1234 | ) | |
1223 |
|
1235 | |||
1224 |
|
1236 | |||
1225 |
def _check(repo, r, ui, tool, fcd, |
|
1237 | def _check(repo, r, ui, tool, fcd, backup): | |
1226 | fd = fcd.path() |
|
1238 | fd = fcd.path() | |
1227 | uipathfn = scmutil.getuipathfn(repo) |
|
1239 | uipathfn = scmutil.getuipathfn(repo) | |
1228 | unused, unused, unused, backup = files |
|
|||
1229 |
|
1240 | |||
1230 | if not r and ( |
|
1241 | if not r and ( | |
1231 | _toolbool(ui, tool, b"checkconflicts") |
|
1242 | _toolbool(ui, tool, b"checkconflicts") |
General Comments 0
You need to be logged in to leave comments.
Login now