114 ui = uimod.ui.load() |
115 ui = uimod.ui.load() |
115 _verifytext(local_input, ui, quiet=quiet, allow_binary=allow_binary) |
116 _verifytext(local_input, ui, quiet=quiet, allow_binary=allow_binary) |
116 _verifytext(base_input, ui, quiet=quiet, allow_binary=allow_binary) |
117 _verifytext(base_input, ui, quiet=quiet, allow_binary=allow_binary) |
117 _verifytext(other_input, ui, quiet=quiet, allow_binary=allow_binary) |
118 _verifytext(other_input, ui, quiet=quiet, allow_binary=allow_binary) |
118 |
119 |
119 sys.exit( |
120 merged_text, conflicts = simplemerge.simplemerge( |
120 simplemerge.simplemerge( |
121 ui, |
121 ui, |
122 local_input, |
122 local_input, |
123 base_input, |
123 base_input, |
124 other_input, |
124 other_input, |
125 mode, |
125 mode, |
126 quiet=True, |
126 quiet=True, |
127 allow_binary=allow_binary, |
127 allow_binary=allow_binary, |
128 print_result=opts.get(b'print'), |
128 print_result=opts.get(b'print'), |
|
129 ) |
|
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 except ParseError as e: |
135 except ParseError as e: |
132 e = stringutil.forcebytestr(e) |
136 e = stringutil.forcebytestr(e) |
133 procutil.stdout.write(b"%s: %s\n" % (sys.argv[0].encode('utf8'), e)) |
137 procutil.stdout.write(b"%s: %s\n" % (sys.argv[0].encode('utf8'), e)) |
134 showhelp() |
138 showhelp() |
135 sys.exit(1) |
139 sys.exit(1) |