# HG changeset patch # User Matt Mackall # Date 1161140996 18000 # Node ID a7ef6b6cc311d6c7c781bfefb93099edb107cd9f # Parent b17f9d3eda745a256e012bd14ce9d7fb07dbda91 branchtags: use changectx setting self.branchcache on entry avoids recursions in lookup diff -r b17f9d3eda74 -r a7ef6b6cc311 mercurial/localrepo.py --- a/mercurial/localrepo.py Tue Oct 17 22:07:54 2006 -0500 +++ b/mercurial/localrepo.py Tue Oct 17 22:09:56 2006 -0500 @@ -293,7 +293,7 @@ if self.branchcache != None: return self.branchcache - self.branchcache = {} + self.branchcache = {} # avoid recursion in changectx try: f = self.opener("branches.cache") @@ -310,12 +310,11 @@ tip = self.changelog.count() - 1 if lrev != tip: - for r in range(lrev + 1, tip + 1): - n = self.changelog.node(r) - c = self.changelog.read(n) - b = c[5].get("branch") + for r in xrange(lrev + 1, tip + 1): + c = self.changectx(r) + b = c.branch() if b: - self.branchcache[b] = n + self.branchcache[b] = c.node() self._writebranchcache() return self.branchcache