comparison mercurial/fileset.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 db33c5bc781f
children 7c0f40f4f7bf
comparison
equal deleted inserted replaced
37083:f99d64e8a4e4 37084:f0b6fbea00cf
17 parser, 17 parser,
18 pycompat, 18 pycompat,
19 registrar, 19 registrar,
20 scmutil, 20 scmutil,
21 util, 21 util,
22 )
23 from .utils import (
24 stringutil,
22 ) 25 )
23 26
24 elements = { 27 elements = {
25 # token-type: binding-strength, primary, prefix, infix, suffix 28 # token-type: binding-strength, primary, prefix, infix, suffix
26 "(": (20, None, ("group", 1, ")"), ("func", 1, ")"), None), 29 "(": (20, None, ("group", 1, ")"), ("func", 1, ")"), None),
443 enc = getstring(x, _("eol requires a style name")) 446 enc = getstring(x, _("eol requires a style name"))
444 447
445 s = [] 448 s = []
446 for f in mctx.existing(): 449 for f in mctx.existing():
447 d = mctx.ctx[f].data() 450 d = mctx.ctx[f].data()
448 if util.binary(d): 451 if stringutil.binary(d):
449 continue 452 continue
450 if (enc == 'dos' or enc == 'win') and '\r\n' in d: 453 if (enc == 'dos' or enc == 'win') and '\r\n' in d:
451 s.append(f) 454 s.append(f)
452 elif enc == 'unix' and re.search('(?<!\r)\n', d): 455 elif enc == 'unix' and re.search('(?<!\r)\n', d):
453 s.append(f) 456 s.append(f)