comparison mercurial/localrepo.py @ 18128:f0d56efaa35a

branchmap: make write a method on the branchmap object
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 20 Dec 2012 16:28:43 +0100
parents dcd43ac7572d
children 1b05ffce47bd
comparison
equal deleted inserted replaced
18127:dcd43ac7572d 18128:f0d56efaa35a
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) 1443 cache.write(self)
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) 2501 cache.write(self)
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