Patchwork [02,of,10,V2] branchmap: factorise access to changelog in updatebranchcache

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 20, 2012, 2:08 p.m.
Message ID <322a1c4c3fff352d7694.1356012512@crater2.logilab.fr>
Download mbox | patch
Permalink /patch/204/
State Accepted
Commit da1714bd0250ff87ac7b73657769208ddc4b61dc
Headers show

Comments

Pierre-Yves David - Dec. 20, 2012, 2:08 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1355935189 -3600
# Node ID 322a1c4c3fff352d7694647c291e4edefa1ccc6a
# Parent  aa0e6e4fda8672e936c641d1995c62f6309fd311
branchmap: factorise access to changelog in updatebranchcache

This prepares merge of `updatebranchcache` and `_branchtags`.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -665,20 +665,21 @@  class localrepository(object):
             self._updatebranchcache(partial, ctxgen)
         return partial
 
     @unfilteredmethod # Until we get a smarter cache management
     def updatebranchcache(self):
-        tip = self.changelog.tip()
+        cl = self.changelog
+        tip = cl.tip()
         if self._branchcache is not None and self._branchcachetip == tip:
             return
 
         oldtip = self._branchcachetip
         self._branchcachetip = tip
-        if oldtip is None or oldtip not in self.changelog.nodemap:
+        if oldtip is None or oldtip not in cl.nodemap:
             partial, last, lrev = self._readbranchcache()
         else:
-            lrev = self.changelog.rev(oldtip)
+            lrev = cl.rev(oldtip)
             partial = self._branchcache
 
         self._branchtags(partial, lrev)
         # this private cache holds all heads (not just the branch tips)
         self._branchcache = partial