diff mercurial/repoview.py @ 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 eba48f2b9b74
children c5df4af17110
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: