[PATCH 08 of 10 py3] revlog: extract first byte of revlog with a slice so it's portable

Augie Fackler raf at durin42.com
Sun Mar 12 14:57:48 EDT 2017


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1489297789 18000
#      Sun Mar 12 00:49:49 2017 -0500
# Node ID 4eab3adcc0793f60b863da542fe8e152e33efa9c
# Parent  7f013bdcdbddcc8ed86dcb373e88f6956bcbdd51
revlog: extract first byte of revlog with a slice so it's portable

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1521,7 +1521,7 @@ class revlog(object):
         #
         # According to `hg perfrevlogchunks`, this is ~0.5% faster for zlib
         # compressed chunks. And this matters for changelog and manifest reads.
-        t = data[0]
+        t = data[0:1]
 
         if t == 'x':
             try:


More information about the Mercurial-devel mailing list