Patchwork [7,of,8] py3: pass the memoryview object into bytes() to get the value

login
register
mail settings
Submitter Pulkit Goyal
Date June 26, 2017, 7:55 p.m.
Message ID <e53b2097c1368e99088d.1498506928@workspace>
Download mbox | patch
Permalink /patch/21748/
State Accepted
Headers show

Comments

Pulkit Goyal - June 26, 2017, 7:55 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1498501669 -19800
#      Mon Jun 26 23:57:49 2017 +0530
# Node ID e53b2097c1368e99088dc573225dd02b05dc5b0f
# Parent  576285090908583dac2a55826f0614f532bd19b1
py3: pass the memoryview object into bytes() to get the value

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -1818,7 +1818,7 @@ 
         # Obtain data on the raw chunks in the revlog.
         segment = r._getsegmentforrevs(rev, rev)[1]
         if segment:
-            chunktype = segment[0]
+            chunktype = bytes(segment[0:1])
         else:
             chunktype = 'empty'