mercurial/branchmap.py
changeset 18189 b9026ba002f6
parent 18188 46ed5226503a
child 18212 493778b5fe9f
equal deleted inserted replaced
18188:46ed5226503a 18189:b9026ba002f6
    57     return partial
    57     return partial
    58 
    58 
    59 
    59 
    60 
    60 
    61 def updatecache(repo):
    61 def updatecache(repo):
    62     repo = repo.unfiltered()  # Until we get a smarter cache management
       
    63     cl = repo.changelog
    62     cl = repo.changelog
    64     partial = repo._branchcache
    63     filtername = repo.filtername
       
    64     partial = repo._branchcaches.get(filtername)
    65 
    65 
    66     if partial is None or not partial.validfor(repo):
    66     if partial is None or not partial.validfor(repo):
    67         partial = read(repo)
    67         partial = read(repo)
    68 
    68 
    69     catip = repo._cacheabletip()
    69     catip = repo._cacheabletip()
    79     # written to disk since it's not cacheable.
    79     # written to disk since it's not cacheable.
    80     tiprev = cl.rev(cl.tip())
    80     tiprev = cl.rev(cl.tip())
    81     if partial.tiprev < tiprev:
    81     if partial.tiprev < tiprev:
    82         ctxgen = (repo[r] for r in cl.revs(partial.tiprev + 1, tiprev))
    82         ctxgen = (repo[r] for r in cl.revs(partial.tiprev + 1, tiprev))
    83         partial.update(repo, ctxgen)
    83         partial.update(repo, ctxgen)
    84     repo._branchcache = partial
    84     repo._branchcaches[repo.filtername] = partial
    85 
    85 
    86 class branchcache(dict):
    86 class branchcache(dict):
    87     """A dict like object that hold branches heads cache"""
    87     """A dict like object that hold branches heads cache"""
    88 
    88 
    89     def __init__(self, entries=(), tipnode=nullid, tiprev=nullrev,
    89     def __init__(self, entries=(), tipnode=nullid, tiprev=nullrev,