mercurial/repoview.py
changeset 22261 eba48f2b9b74
parent 22174 0cc2db64c335
child 22282 4092d12ba18a
equal deleted inserted replaced
22260:2229d757802d 22261:eba48f2b9b74
     6 # This software may be used and distributed according to the terms of the
     6 # This software may be used and distributed according to the terms of the
     7 # GNU General Public License version 2 or any later version.
     7 # GNU General Public License version 2 or any later version.
     8 
     8 
     9 import copy
     9 import copy
    10 import error
    10 import error
    11 import hashlib
       
    12 import phases
    11 import phases
    13 import util
    12 import util
    14 import obsolete
    13 import obsolete
    15 import struct
    14 import struct
    16 import tags as tagsmod
    15 import tags as tagsmod
    67 
    66 
    68     We calculate a sha1 of repo heads and the content of the obsstore and write
    67     We calculate a sha1 of repo heads and the content of the obsstore and write
    69     it to the cache. Upon reading we can easily validate by checking the hash
    68     it to the cache. Upon reading we can easily validate by checking the hash
    70     against the stored one and discard the cache in case the hashes don't match.
    69     against the stored one and discard the cache in case the hashes don't match.
    71     """
    70     """
    72     h = hashlib.sha1()
    71     h = util.sha1(''.join(repo.heads()))
    73     h.update(''.join(repo.heads()))
       
    74     h.update(str(hash(frozenset(hideable))))
    72     h.update(str(hash(frozenset(hideable))))
    75     return h.digest()
    73     return h.digest()
    76 
    74 
    77 def trywritehiddencache(repo, hideable, hidden):
    75 def trywritehiddencache(repo, hideable, hidden):
    78     """write cache of hidden changesets to disk
    76     """write cache of hidden changesets to disk