comparison mercurial/simplemerge.py @ 37084:f0b6fbea00cf

stringutil: bulk-replace call sites to point to new module This might conflict with other patches floating around, sorry.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 22 Mar 2018 21:56:20 +0900
parents 93c4958d987c
children e7aa113b14f7
comparison
equal deleted inserted replaced
37083:f99d64e8a4e4 37084:f0b6fbea00cf
21 from .i18n import _ 21 from .i18n import _
22 from . import ( 22 from . import (
23 error, 23 error,
24 mdiff, 24 mdiff,
25 pycompat, 25 pycompat,
26 util, 26 )
27 from .utils import (
28 stringutil,
27 ) 29 )
28 30
29 class CantReprocessAndShowBase(Exception): 31 class CantReprocessAndShowBase(Exception):
30 pass 32 pass
31 33
395 return unc 397 return unc
396 398
397 def _verifytext(text, path, ui, opts): 399 def _verifytext(text, path, ui, opts):
398 """verifies that text is non-binary (unless opts[text] is passed, 400 """verifies that text is non-binary (unless opts[text] is passed,
399 then we just warn)""" 401 then we just warn)"""
400 if util.binary(text): 402 if stringutil.binary(text):
401 msg = _("%s looks like a binary file.") % path 403 msg = _("%s looks like a binary file.") % path
402 if not opts.get('quiet'): 404 if not opts.get('quiet'):
403 ui.warn(_('warning: %s\n') % msg) 405 ui.warn(_('warning: %s\n') % msg)
404 if not opts.get('text'): 406 if not opts.get('text'):
405 raise error.Abort(msg) 407 raise error.Abort(msg)