Mercurial > public > mercurial-scm > hg
comparison mercurial/simplemerge.py @ 48755:6ae3c97a0919
simplemerge: move printing of merge result to extension
The `mercurial.simplemerge` module still has some command-lines
processing that doesn't belong in such a low-level module. This patch
moves the handling of `hg simplemerge --print` to the extension by
having `mercurial.simplemerge.simplemerge()` return the merged text.
Differential Revision: https://phab.mercurial-scm.org/D12148
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 14 Jan 2022 08:17:13 -0800 |
parents | d9602f0df4f3 |
children | 7dad4665d223 |
comparison
equal
deleted
inserted
replaced
48754:d9602f0df4f3 | 48755:6ae3c97a0919 |
---|---|
530 else: | 530 else: |
531 labels = _format_labels(local, other) | 531 labels = _format_labels(local, other) |
532 lines, conflicts = render_minimized(m3, *labels) | 532 lines, conflicts = render_minimized(m3, *labels) |
533 | 533 |
534 mergedtext = b''.join(lines) | 534 mergedtext = b''.join(lines) |
535 if print_result: | 535 return mergedtext, conflicts |
536 ui.fout.write(mergedtext) | |
537 else: | |
538 # local.fctx.flags() already has the merged flags (done in | |
539 # mergestate.resolve()) | |
540 local.fctx.write(mergedtext, local.fctx.flags()) | |
541 | |
542 return conflicts |