changeset 32535:260a6f715bd2

manifest: fix some pure-Python parser bits to work on Python 3
author Augie Fackler <raf@durin42.com>
date Sun, 28 May 2017 21:29:15 -0400
parents 0048a852b6aa
children aa333c1982ab
files mercurial/manifest.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/manifest.py	Sun May 28 18:08:36 2017 -0400
+++ b/mercurial/manifest.py	Sun May 28 21:29:15 2017 -0400
@@ -33,7 +33,7 @@
     # class exactly matches its C counterpart to try and help
     # prevent surprise breakage for anyone that develops against
     # the pure version.
-    if data and data[-1] != '\n':
+    if data and data[-1:] != '\n':
         raise ValueError('Manifest did not end in a newline.')
     prev = None
     for l in data.splitlines():
@@ -55,7 +55,7 @@
         end = data.find('\n', pos + 1) # +1 to skip stem length byte
         if end == -1:
             raise ValueError('Manifest ended with incomplete file entry.')
-        stemlen = ord(data[pos])
+        stemlen = ord(data[pos:pos + 1])
         items = data[pos + 1:end].split('\0')
         f = prevf[:stemlen] + items[0]
         if prevf > f: