##// END OF EJS Templates
revisionbranchcache: fall back to slow path if starting readonly (issue4531)...
Mads Kiilerich -
r24159:5b4ed033 3.3.1 stable
parent child Browse files
Show More
@@ -330,7 +330,7 b' class revbranchcache(object):'
330 and will grow with it but be 1/8th of its size.
330 and will grow with it but be 1/8th of its size.
331 """
331 """
332
332
333 def __init__(self, repo):
333 def __init__(self, repo, readonly=True):
334 assert repo.filtername is None
334 assert repo.filtername is None
335 self._names = [] # branch names in local encoding with static index
335 self._names = [] # branch names in local encoding with static index
336 self._rbcrevs = array('c') # structs of type _rbcrecfmt
336 self._rbcrevs = array('c') # structs of type _rbcrecfmt
@@ -342,6 +342,10 b' class revbranchcache(object):'
342 except (IOError, OSError), inst:
342 except (IOError, OSError), inst:
343 repo.ui.debug("couldn't read revision branch cache names: %s\n" %
343 repo.ui.debug("couldn't read revision branch cache names: %s\n" %
344 inst)
344 inst)
345 if readonly:
346 # don't try to use cache - fall back to the slow path
347 self.branchinfo = self._branchinfo
348
345 if self._names:
349 if self._names:
346 try:
350 try:
347 data = repo.vfs.read(_rbcrevs)
351 data = repo.vfs.read(_rbcrevs)
@@ -527,7 +527,7 b' def branch(repo, subset, x):'
527 import branchmap
527 import branchmap
528 urepo = repo.unfiltered()
528 urepo = repo.unfiltered()
529 ucl = urepo.changelog
529 ucl = urepo.changelog
530 getbi = branchmap.revbranchcache(urepo).branchinfo
530 getbi = branchmap.revbranchcache(urepo, readonly=True).branchinfo
531
531
532 try:
532 try:
533 b = getstring(x, '')
533 b = getstring(x, '')
General Comments 0
You need to be logged in to leave comments. Login now