##// END OF EJS Templates
simplemerge: make `localorother` a "mode" instead of a separate thing...
Martin von Zweigbergk -
r49340:5151b0f6 default
parent child Browse files
Show More
@@ -579,43 +579,24 b' def _imerge_diff(repo, mynode, fcd, fco,'
579 579 )
580 580
581 581
582 def _imergeauto(
583 repo,
584 mynode,
585 fcd,
586 fco,
587 fca,
588 toolconf,
589 backup,
590 labels=None,
591 localorother=None,
592 ):
593 """
594 Generic driver for _imergelocal and _imergeother
595 """
596 assert localorother is not None
597 r = simplemerge.simplemerge(
598 repo.ui, fcd, fca, fco, label=labels, localorother=localorother
599 )
600 return True, r
601
602
603 582 @internaltool(b'merge-local', mergeonly, precheck=_mergecheck)
604 def _imergelocal(*args, **kwargs):
583 def _imergelocal(repo, mynode, fcd, fco, fca, toolconf, backup, labels=None):
605 584 """
606 585 Like :merge, but resolve all conflicts non-interactively in favor
607 586 of the local `p1()` changes."""
608 success, status = _imergeauto(localorother=b'local', *args, **kwargs)
609 return success, status, False
587 return _merge(
588 repo, mynode, fcd, fco, fca, toolconf, backup, labels, b'local'
589 )
610 590
611 591
612 592 @internaltool(b'merge-other', mergeonly, precheck=_mergecheck)
613 def _imergeother(*args, **kwargs):
593 def _imergeother(repo, mynode, fcd, fco, fca, toolconf, backup, labels=None):
614 594 """
615 595 Like :merge, but resolve all conflicts non-interactively in favor
616 596 of the other `p2()` changes."""
617 success, status = _imergeauto(localorother=b'other', *args, **kwargs)
618 return success, status, False
597 return _merge(
598 repo, mynode, fcd, fco, fca, toolconf, backup, labels, b'other'
599 )
619 600
620 601
621 602 @internaltool(
@@ -516,13 +516,17 b' def simplemerge(ui, localctx, basectx, o'
516 516
517 517 m3 = Merge3Text(basetext, localtext, othertext)
518 518 extrakwargs = {
519 "localorother": opts.get("localorother", None),
519 "localorother": None,
520 520 'minimize': True,
521 521 }
522 522 if mode == b'union':
523 523 extrakwargs['start_marker'] = None
524 524 extrakwargs['mid_marker'] = None
525 525 extrakwargs['end_marker'] = None
526 elif mode == b'local':
527 extrakwargs['localorother'] = b'local'
528 elif mode == b'other':
529 extrakwargs['localorother'] = b'other'
526 530 elif name_base is not None:
527 531 extrakwargs['base_marker'] = b'|||||||'
528 532 extrakwargs['name_base'] = name_base
General Comments 0
You need to be logged in to leave comments. Login now