Show More
@@ -15,6 +15,7 b' from mercurial import (' | |||
|
15 | 15 | fancyopts, |
|
16 | 16 | simplemerge, |
|
17 | 17 | ui as uimod, |
|
18 | util, | |
|
18 | 19 | ) |
|
19 | 20 | from mercurial.utils import procutil, stringutil |
|
20 | 21 | |
@@ -116,18 +117,21 b' try:' | |||
|
116 | 117 | _verifytext(base_input, ui, quiet=quiet, allow_binary=allow_binary) |
|
117 | 118 | _verifytext(other_input, ui, quiet=quiet, allow_binary=allow_binary) |
|
118 | 119 | |
|
119 | sys.exit( | |
|
120 | simplemerge.simplemerge( | |
|
121 | ui, | |
|
122 |
|
|
|
123 |
|
|
|
124 | other_input, | |
|
125 | mode, | |
|
126 | quiet=True, | |
|
127 | allow_binary=allow_binary, | |
|
128 | print_result=opts.get(b'print'), | |
|
129 | ) | |
|
120 | merged_text, conflicts = simplemerge.simplemerge( | |
|
121 | ui, | |
|
122 | local_input, | |
|
123 | base_input, | |
|
124 | other_input, | |
|
125 | mode, | |
|
126 | quiet=True, | |
|
127 | allow_binary=allow_binary, | |
|
128 | print_result=opts.get(b'print'), | |
|
130 | 129 | ) |
|
130 | if opts.get(b'print'): | |
|
131 | ui.fout.write(merged_text) | |
|
132 | else: | |
|
133 | util.writefile(local, merged_text) | |
|
134 | sys.exit(1 if conflicts else 0) | |
|
131 | 135 | except ParseError as e: |
|
132 | 136 | e = stringutil.forcebytestr(e) |
|
133 | 137 | procutil.stdout.write(b"%s: %s\n" % (sys.argv[0].encode('utf8'), e)) |
@@ -442,10 +442,13 b' def _premerge(repo, local, other, base, ' | |||
|
442 | 442 | stringutil.binary(input.text()) for input in (local, base, other) |
|
443 | 443 | ): |
|
444 | 444 | return 1 # continue merging |
|
445 | r = simplemerge.simplemerge( | |
|
446 |
ui, local, base, other, |
|
|
445 | merged_text, conflicts = simplemerge.simplemerge( | |
|
446 | ui, local, base, other, mode=mode | |
|
447 | 447 | ) |
|
448 | if not r: | |
|
448 | # fcd.flags() already has the merged flags (done in | |
|
449 | # mergestate.resolve()) | |
|
450 | local.fctx.write(merged_text, local.fctx.flags()) | |
|
451 | if not conflicts: | |
|
449 | 452 | ui.debug(b" premerge successful\n") |
|
450 | 453 | return 0 |
|
451 | 454 | if premerge not in validkeep: |
@@ -489,8 +492,14 b' def _merge(repo, local, other, base, mod' | |||
|
489 | 492 | _verifytext(other, ui) |
|
490 | 493 | except error.Abort: |
|
491 | 494 | return True, True, False |
|
492 | r = simplemerge.simplemerge(ui, local, base, other, mode=mode) | |
|
493 | return True, r, False | |
|
495 | else: | |
|
496 | merged_text, conflicts = simplemerge.simplemerge( | |
|
497 | ui, local, base, other, mode=mode | |
|
498 | ) | |
|
499 | # fcd.flags() already has the merged flags (done in | |
|
500 | # mergestate.resolve()) | |
|
501 | local.fctx.write(merged_text, local.fctx.flags()) | |
|
502 | return True, conflicts, False | |
|
494 | 503 | |
|
495 | 504 | |
|
496 | 505 | @internaltool( |
@@ -532,11 +532,4 b' def simplemerge(' | |||
|
532 | 532 | lines, conflicts = render_minimized(m3, *labels) |
|
533 | 533 | |
|
534 | 534 | mergedtext = b''.join(lines) |
|
535 | if print_result: | |
|
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 | |
|
535 | return mergedtext, conflicts |
General Comments 0
You need to be logged in to leave comments.
Login now