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

login
register
mail settings
Submitter Augie Fackler
Date March 12, 2017, 6:57 p.m.
Message ID <4eab3adcc0793f60b863.1489345068@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/19207/
State Accepted
Headers show

Comments

Augie Fackler - March 12, 2017, 6:57 p.m.
# HG changeset patch
# User Augie Fackler <augie@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

Patch

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: