Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 18130:1b05ffce47bd
branchmap: make update responsible to update the cache key
The update function have all necessary data to keep the branchcache key
up to date with its value.
This saves assignment to the cache key that each caller of update had to do by
hand.
The strip case is a bit more complicated to handles from inside the function but
I do not expect any impact.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Mon, 24 Dec 2012 02:22:04 +0100 |
parents | f0d56efaa35a |
children | f0eeb9b3444a |
comparison
equal
deleted
inserted
replaced
18129:3264d3ce53a0 | 18130:1b05ffce47bd |
---|---|
1436 if newheadnodes: | 1436 if newheadnodes: |
1437 ctxgen = (self[node] for node in newheadnodes | 1437 ctxgen = (self[node] for node in newheadnodes |
1438 if self.changelog.hasnode(node)) | 1438 if self.changelog.hasnode(node)) |
1439 cache = self._branchcache | 1439 cache = self._branchcache |
1440 branchmap.update(self, cache, ctxgen) | 1440 branchmap.update(self, cache, ctxgen) |
1441 cache.tipnode = self.changelog.tip() | |
1442 cache.tiprev = self.changelog.rev(cache.tipnode) | |
1443 cache.write(self) | 1441 cache.write(self) |
1444 | 1442 |
1445 # Ensure the persistent tag cache is updated. Doing it now | 1443 # Ensure the persistent tag cache is updated. Doing it now |
1446 # means that the tag cache only has to worry about destroyed | 1444 # means that the tag cache only has to worry about destroyed |
1447 # heads immediately after a strip/rollback. That in turn | 1445 # heads immediately after a strip/rollback. That in turn |