Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 18127:dcd43ac7572d
branchmap: simplify write signature
All necessary data (cache value and key) are now stored in the branchcache
object. Any extra parameter is superfluous.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Sat, 22 Dec 2012 02:04:49 +0100 |
parents | 090ada0acddb |
children | f0d56efaa35a |
comparison
equal
deleted
inserted
replaced
18126:090ada0acddb | 18127:dcd43ac7572d |
---|---|
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() | 1441 cache.tipnode = self.changelog.tip() |
1442 cache.tiprev = self.changelog.rev(cache.tipnode) | 1442 cache.tiprev = self.changelog.rev(cache.tipnode) |
1443 branchmap.write(self, cache, cache.tipnode, cache.tiprev) | 1443 branchmap.write(self, cache) |
1444 | 1444 |
1445 # Ensure the persistent tag cache is updated. Doing it now | 1445 # Ensure the persistent tag cache is updated. Doing it now |
1446 # means that the tag cache only has to worry about destroyed | 1446 # means that the tag cache only has to worry about destroyed |
1447 # heads immediately after a strip/rollback. That in turn | 1447 # heads immediately after a strip/rollback. That in turn |
1448 # guarantees that "cachetip == currenttip" (comparing both rev | 1448 # guarantees that "cachetip == currenttip" (comparing both rev |
2496 for node in rbheads)) | 2496 for node in rbheads)) |
2497 cache = branchmap.branchcache(rbranchmap, | 2497 cache = branchmap.branchcache(rbranchmap, |
2498 self[rtiprev].node(), | 2498 self[rtiprev].node(), |
2499 rtiprev) | 2499 rtiprev) |
2500 self._branchcache = cache | 2500 self._branchcache = cache |
2501 branchmap.write(self, cache, cache.tipnode, cache.tiprev) | 2501 branchmap.write(self, cache) |
2502 self.invalidate() | 2502 self.invalidate() |
2503 return len(self.heads()) + 1 | 2503 return len(self.heads()) + 1 |
2504 finally: | 2504 finally: |
2505 lock.release() | 2505 lock.release() |
2506 | 2506 |