equal
deleted
inserted
replaced
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) |