Mercurial > public > mercurial-scm > hg-stable
diff mercurial/branchmap.py @ 24163:bb11081562d7
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 02 Mar 2015 01:20:14 -0600 |
parents | 32a64923d2b7 5b4ed033390b |
children | 59cc09240afb |
line wrap: on
line diff
--- a/mercurial/branchmap.py Sat Feb 28 01:12:54 2015 -0500 +++ b/mercurial/branchmap.py Mon Mar 02 01:20:14 2015 -0600 @@ -330,7 +330,7 @@ and will grow with it but be 1/8th of its size. """ - def __init__(self, repo): + def __init__(self, repo, readonly=True): assert repo.filtername is None self._names = [] # branch names in local encoding with static index self._rbcrevs = array('c') # structs of type _rbcrecfmt @@ -342,6 +342,10 @@ except (IOError, OSError), inst: repo.ui.debug("couldn't read revision branch cache names: %s\n" % inst) + if readonly: + # don't try to use cache - fall back to the slow path + self.branchinfo = self._branchinfo + if self._names: try: data = repo.vfs.read(_rbcrevs)