comparison mercurial/revlog.py @ 31643:6ceb3c4c3ab6

py3: fix slicing of byte string in revlog.compress() I tried .startswith('\0'), but data wasn't always a bytes nor a bytearray.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 26 Mar 2017 17:12:06 +0900
parents a8e55d6f1d67
children 4eb75c86368b
comparison
equal deleted inserted replaced
31642:addc392cc3d3 31643:6ceb3c4c3ab6
1486 1486
1487 if compressed: 1487 if compressed:
1488 # The revlog compressor added the header in the returned data. 1488 # The revlog compressor added the header in the returned data.
1489 return '', compressed 1489 return '', compressed
1490 1490
1491 if data[0] == '\0': 1491 if data[0:1] == '\0':
1492 return '', data 1492 return '', data
1493 return 'u', data 1493 return 'u', data
1494 1494
1495 def decompress(self, data): 1495 def decompress(self, data):
1496 """Decompress a revlog chunk. 1496 """Decompress a revlog chunk.