Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/filemerge.py @ 46437:63dfaca9087f
filemerge: add a hacktastic version of internal:merge3 for merge diffs
This is a version of merge3 that always reports success, so that
conflict markers get preserved without us having to implement conflict
storage for in-memory merge. Credit to martinvonz for the idea. The
only planned consumer of this "merge tool" is my upcoming merge-diffs
functionality, though I suspect it could be useful in other ways.
Differential Revision: https://phab.mercurial-scm.org/D8515
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 11 May 2020 18:45:45 -0400 |
parents | 0c95b59a89f1 |
children | d57e607d9e33 |
comparison
equal
deleted
inserted
replaced
46436:24a32dea6955 | 46437:63dfaca9087f |
---|---|
533 if not labels: | 533 if not labels: |
534 labels = _defaultconflictlabels | 534 labels = _defaultconflictlabels |
535 if len(labels) < 3: | 535 if len(labels) < 3: |
536 labels.append(b'base') | 536 labels.append(b'base') |
537 return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels) | 537 return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels) |
538 | |
539 | |
540 @internaltool( | |
541 b'merge3-lie-about-conflicts', | |
542 fullmerge, | |
543 b'', | |
544 precheck=_mergecheck, | |
545 ) | |
546 def _imerge3alwaysgood(*args, **kwargs): | |
547 # Like merge3, but record conflicts as resolved with markers in place. | |
548 # | |
549 # This is used for `hg diff --merge` to show the differences between | |
550 # the auto-merge state and the committed merge state. It may be | |
551 # useful for other things. | |
552 b1, junk, b2 = _imerge3(*args, **kwargs) | |
553 # TODO is this right? I'm not sure what these return values mean, | |
554 # but as far as I can tell this will indicate to callers tha the | |
555 # merge succeeded. | |
556 return b1, False, b2 | |
538 | 557 |
539 | 558 |
540 @internaltool( | 559 @internaltool( |
541 b'mergediff', | 560 b'mergediff', |
542 fullmerge, | 561 fullmerge, |