comparison mercurial/revlog.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 7bf80d9d9543
children 0596d27457c6
comparison
equal deleted inserted replaced
37083:f99d64e8a4e4 37084:f0b6fbea00cf
42 mdiff, 42 mdiff,
43 policy, 43 policy,
44 pycompat, 44 pycompat,
45 templatefilters, 45 templatefilters,
46 util, 46 util,
47 )
48 from .utils import (
49 stringutil,
47 ) 50 )
48 51
49 parsers = policy.importmod(r'parsers') 52 parsers = policy.importmod(r'parsers')
50 53
51 # Aliased for performance. 54 # Aliased for performance.
2015 if t == 'x': 2018 if t == 'x':
2016 try: 2019 try:
2017 return _zlibdecompress(data) 2020 return _zlibdecompress(data)
2018 except zlib.error as e: 2021 except zlib.error as e:
2019 raise RevlogError(_('revlog decompress error: %s') % 2022 raise RevlogError(_('revlog decompress error: %s') %
2020 util.forcebytestr(e)) 2023 stringutil.forcebytestr(e))
2021 # '\0' is more common than 'u' so it goes first. 2024 # '\0' is more common than 'u' so it goes first.
2022 elif t == '\0': 2025 elif t == '\0':
2023 return data 2026 return data
2024 elif t == 'u': 2027 elif t == 'u':
2025 return util.buffer(data, 1) 2028 return util.buffer(data, 1)