Mercurial > hg
comparison mercurial/repoview.py @ 31444:55390e97fdd2
py3: use portable way to stringify cache key of repoview
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 12 Mar 2017 17:20:42 -0700 |
parents | 4015dfc899bb |
children | 06aa645e2372 |
comparison
equal
deleted
inserted
replaced
31443:0241dd94ed38 | 31444:55390e97fdd2 |
---|---|
102 it to the cache. Upon reading we can easily validate by checking the hash | 102 it to the cache. Upon reading we can easily validate by checking the hash |
103 against the stored one and discard the cache in case the hashes don't match. | 103 against the stored one and discard the cache in case the hashes don't match. |
104 """ | 104 """ |
105 h = hashlib.sha1() | 105 h = hashlib.sha1() |
106 h.update(''.join(repo.heads())) | 106 h.update(''.join(repo.heads())) |
107 h.update(str(hash(frozenset(hideable)))) | 107 h.update('%d' % hash(frozenset(hideable))) |
108 return h.digest() | 108 return h.digest() |
109 | 109 |
110 def _writehiddencache(cachefile, cachehash, hidden): | 110 def _writehiddencache(cachefile, cachehash, hidden): |
111 """write hidden data to a cache file""" | 111 """write hidden data to a cache file""" |
112 data = struct.pack('>%ii' % len(hidden), *sorted(hidden)) | 112 data = struct.pack('>%ii' % len(hidden), *sorted(hidden)) |