changeset 22282:4092d12ba18a

repoview: fix 0L with pack/unpack for 2.4
author Matt Mackall <mpm@selenic.com>
date Tue, 26 Aug 2014 13:11:53 +0200
parents 7eef5a87ce3f
children cb556ea76dcd
files mercurial/repoview.py mercurial/revlog.py
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/repoview.py	Fri Aug 22 16:40:34 2014 -0400
+++ b/mercurial/repoview.py	Tue Aug 26 13:11:53 2014 +0200
@@ -68,7 +68,8 @@
     it to the cache. Upon reading we can easily validate by checking the hash
     against the stored one and discard the cache in case the hashes don't match.
     """
-    h = util.sha1(''.join(repo.heads()))
+    h = util.sha1()
+    h.update(''.join(repo.heads()))
     h.update(str(hash(frozenset(hideable))))
     return h.digest()
 
@@ -88,7 +89,7 @@
             # write cache to file
             newhash = cachehash(repo, hideable)
             sortedset = sorted(hidden)
-            data = struct.pack('>%iI' % len(sortedset), *sortedset)
+            data = struct.pack('>%ii' % len(sortedset), *sortedset)
             fh = repo.vfs.open(cachefile, 'w+b', atomictemp=True)
             fh.write(struct.pack(">H", cacheversion))
             fh.write(newhash)
@@ -116,7 +117,7 @@
                 # cache is valid, so we can start reading the hidden revs
                 data = fh.read()
                 count = len(data) / 4
-                hidden = frozenset(struct.unpack('>%iI' % count, data))
+                hidden = frozenset(struct.unpack('>%ii' % count, data))
         return hidden
     finally:
         if fh:
--- a/mercurial/revlog.py	Fri Aug 22 16:40:34 2014 -0400
+++ b/mercurial/revlog.py	Tue Aug 26 13:11:53 2014 +0200
@@ -306,6 +306,8 @@
     def rev(self, node):
         try:
             return self._nodecache[node]
+        except TypeError:
+            raise
         except RevlogError:
             # parsers.c radix tree lookup failed
             raise LookupError(node, self.indexfile, _('no node'))