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