py3: fix slicing of byte string in revlog.compress()
authorYuya Nishihara <yuya@tcha.org>
Sun, 26 Mar 2017 17:12:06 +0900
changeset 31643 6ceb3c4c3ab6
parent 31642 addc392cc3d3
child 31644 f80d9ddc40f3
py3: fix slicing of byte string in revlog.compress() I tried .startswith('\0'), but data wasn't always a bytes nor a bytearray.
mercurial/revlog.py
--- a/mercurial/revlog.py	Sun Mar 26 16:31:01 2017 +0900
+++ b/mercurial/revlog.py	Sun Mar 26 17:12:06 2017 +0900
@@ -1488,7 +1488,7 @@
             # The revlog compressor added the header in the returned data.
             return '', compressed
 
-        if data[0] == '\0':
+        if data[0:1] == '\0':
             return '', data
         return 'u', data