##// END OF EJS Templates
localrepo/branchcache: kill unused localrepo.branchcache...
Benoit Boissinot -
r9674:603b23c6 default
parent child Browse files
Show More
@@ -98,8 +98,7 b' class localrepository(repo.repository):'
98 self._tags = None
98 self._tags = None
99 self._tagtypes = None
99 self._tagtypes = None
100
100
101 self.branchcache = None
101 self._branchcache = None # in UTF-8
102 self._ubranchcache = None # UTF-8 version of branchcache
103 self._branchcachetip = None
102 self._branchcachetip = None
104 self.nodetagscache = None
103 self.nodetagscache = None
105 self.filterpats = {}
104 self.filterpats = {}
@@ -320,19 +319,19 b' class localrepository(repo.repository):'
320 return partial
319 return partial
321
320
322 def lbranchmap(self):
321 def lbranchmap(self):
323 self.branchcache = {}
322 branchcache = {}
324 partial = self.branchmap()
323 partial = self.branchmap()
325
324
326 # the branch cache is stored on disk as UTF-8, but in the local
325 # the branch cache is stored on disk as UTF-8, but in the local
327 # charset internally
326 # charset internally
328 for k, v in partial.iteritems():
327 for k, v in partial.iteritems():
329 self.branchcache[encoding.tolocal(k)] = v
328 branchcache[encoding.tolocal(k)] = v
330 return self.branchcache
329 return branchcache
331
330
332 def branchmap(self):
331 def branchmap(self):
333 tip = self.changelog.tip()
332 tip = self.changelog.tip()
334 if self._ubranchcache is not None and self._branchcachetip == tip:
333 if self._branchcache is not None and self._branchcachetip == tip:
335 return self._ubranchcache
334 return self._branchcache
336
335
337 oldtip = self._branchcachetip
336 oldtip = self._branchcachetip
338 self._branchcachetip = tip
337 self._branchcachetip = tip
@@ -340,13 +339,13 b' class localrepository(repo.repository):'
340 partial, last, lrev = self._readbranchcache()
339 partial, last, lrev = self._readbranchcache()
341 else:
340 else:
342 lrev = self.changelog.rev(oldtip)
341 lrev = self.changelog.rev(oldtip)
343 partial = self._ubranchcache
342 partial = self._branchcache
344
343
345 self._branchtags(partial, lrev)
344 self._branchtags(partial, lrev)
346 # this private cache holds all heads (not just tips)
345 # this private cache holds all heads (not just tips)
347 self._ubranchcache = partial
346 self._branchcache = partial
348
347
349 return self._ubranchcache
348 return self._branchcache
350
349
351 def branchtags(self):
350 def branchtags(self):
352 '''return a dict where branch names map to the tipmost head of
351 '''return a dict where branch names map to the tipmost head of
@@ -632,8 +631,7 b' class localrepository(repo.repository):'
632 self._tags = None
631 self._tags = None
633 self._tagtypes = None
632 self._tagtypes = None
634 self.nodetagscache = None
633 self.nodetagscache = None
635 self.branchcache = None
634 self._branchcache = None # in UTF-8
636 self._ubranchcache = None
637 self._branchcachetip = None
635 self._branchcachetip = None
638
636
639 def _lock(self, lockname, wait, releasefn, acquirefn, desc):
637 def _lock(self, lockname, wait, releasefn, acquirefn, desc):
@@ -915,7 +913,7 b' class localrepository(repo.repository):'
915 self.changelog.finalize(trp)
913 self.changelog.finalize(trp)
916 tr.close()
914 tr.close()
917
915
918 if self.branchcache:
916 if self._branchcache:
919 self.branchtags()
917 self.branchtags()
920
918
921 self.hook("commit", node=hex(n), parent1=xp1, parent2=xp2)
919 self.hook("commit", node=hex(n), parent1=xp1, parent2=xp2)
General Comments 0
You need to be logged in to leave comments. Login now