Show More
@@ -68,7 +68,8 b' def cachehash(repo, hideable):' | |||
|
68 | 68 | it to the cache. Upon reading we can easily validate by checking the hash |
|
69 | 69 | against the stored one and discard the cache in case the hashes don't match. |
|
70 | 70 | """ |
|
71 |
h = util.sha1( |
|
|
71 | h = util.sha1() | |
|
72 | h.update(''.join(repo.heads())) | |
|
72 | 73 | h.update(str(hash(frozenset(hideable)))) |
|
73 | 74 | return h.digest() |
|
74 | 75 | |
@@ -88,7 +89,7 b' def trywritehiddencache(repo, hideable, ' | |||
|
88 | 89 | # write cache to file |
|
89 | 90 | newhash = cachehash(repo, hideable) |
|
90 | 91 | sortedset = sorted(hidden) |
|
91 |
data = struct.pack('>%i |
|
|
92 | data = struct.pack('>%ii' % len(sortedset), *sortedset) | |
|
92 | 93 | fh = repo.vfs.open(cachefile, 'w+b', atomictemp=True) |
|
93 | 94 | fh.write(struct.pack(">H", cacheversion)) |
|
94 | 95 | fh.write(newhash) |
@@ -116,7 +117,7 b' def tryreadcache(repo, hideable):' | |||
|
116 | 117 | # cache is valid, so we can start reading the hidden revs |
|
117 | 118 | data = fh.read() |
|
118 | 119 | count = len(data) / 4 |
|
119 |
hidden = frozenset(struct.unpack('>%i |
|
|
120 | hidden = frozenset(struct.unpack('>%ii' % count, data)) | |
|
120 | 121 | return hidden |
|
121 | 122 | finally: |
|
122 | 123 | if fh: |
General Comments 0
You need to be logged in to leave comments.
Login now