##// END OF EJS Templates
simplemerge: remove code for checking binary input now that callers do it...
Martin von Zweigbergk -
r49598:d9602f0d default
parent child Browse files
Show More
@@ -272,16 +272,12 b' class Merge3Text(object):'
272 return sl
272 return sl
273
273
274
274
275 def _verifytext(text, path, ui, quiet=False, allow_binary=False):
275 def _verifytext(input):
276 """verifies that text is non-binary (unless opts[text] is passed,
276 """verifies that text is non-binary (unless opts[text] is passed,
277 then we just warn)"""
277 then we just warn)"""
278 if stringutil.binary(text):
278 if stringutil.binary(input.text()):
279 msg = _(b"%s looks like a binary file.") % path
279 msg = _(b"%s looks like a binary file.") % input.fctx.path()
280 if not quiet:
281 ui.warn(_(b'warning: %s\n') % msg)
282 if not allow_binary:
283 raise error.Abort(msg)
280 raise error.Abort(msg)
284 return text
285
281
286
282
287 def _format_labels(*inputs):
283 def _format_labels(*inputs):
@@ -511,23 +507,12 b' def simplemerge('
511 The merged result is written into `localctx`.
507 The merged result is written into `localctx`.
512 """
508 """
513
509
514 def readctx(input):
510 if not allow_binary:
515 return _verifytext(
511 _verifytext(local)
516 input.text(),
512 _verifytext(base)
517 input.fctx.path(),
513 _verifytext(other)
518 ui,
519 quiet=quiet,
520 allow_binary=allow_binary,
521 )
522
514
523 try:
515 m3 = Merge3Text(base.text(), local.text(), other.text())
524 localtext = readctx(local)
525 basetext = readctx(base)
526 othertext = readctx(other)
527 except error.Abort:
528 return True
529
530 m3 = Merge3Text(basetext, localtext, othertext)
531 conflicts = False
516 conflicts = False
532 if mode == b'union':
517 if mode == b'union':
533 lines = _resolve(m3, (1, 2))
518 lines = _resolve(m3, (1, 2))
General Comments 0
You need to be logged in to leave comments. Login now