##// END OF EJS Templates
branchmap: pass revision insteads of changectx to the update function...
Pierre-Yves David -
r18305:2502a15e default
parent child Browse files
Show More
@@ -77,8 +77,7 def updatecache(repo):
77 77 revs.extend(r for r in extrarevs if r <= partial.tiprev)
78 78 revs.extend(cl.revs(start=partial.tiprev + 1))
79 79 if revs:
80 ctxgen = (repo[r] for r in revs)
81 partial.update(repo, ctxgen)
80 partial.update(repo, revs)
82 81 partial.write(repo)
83 82 assert partial.validfor(repo)
84 83 repo._branchcaches[repo.filtername] = partial
@@ -144,12 +143,13 class branchcache(dict):
144 143 # Abort may be raise by read only opener
145 144 pass
146 145
147 def update(self, repo, ctxgen):
146 def update(self, repo, revgen):
148 147 """Given a branchhead cache, self, that may have extra nodes or be
149 148 missing heads, and a generator of nodes that are at least a superset of
150 149 heads missing, this function updates self to be correct.
151 150 """
152 151 cl = repo.changelog
152 ctxgen = (repo[r] for r in revgen)
153 153 # collect new branch entries
154 154 newbranches = {}
155 155 for c in ctxgen:
@@ -196,7 +196,7 def _headssummary(repo, remote, outgoing
196 196 newmap = branchmap.branchcache((branch, heads[1])
197 197 for branch, heads in headssum.iteritems()
198 198 if heads[0] is not None)
199 newmap.update(repo, missingctx)
199 newmap.update(repo, (ctx.rev() for ctx in missingctx))
200 200 for branch, newheads in newmap.iteritems():
201 201 headssum[branch][1][:] = newheads
202 202 return headssum
@@ -1406,10 +1406,11 class localrepository(object):
1406 1406 # it, Otherwise, since nodes were destroyed, the cache is stale and this
1407 1407 # will be caught the next time it is read.
1408 1408 if newheadnodes:
1409 ctxgen = (self[node] for node in newheadnodes
1410 if self.changelog.hasnode(node))
1409 cl = self.changelog
1410 revgen = (cl.rev(node) for node in newheadnodes
1411 if cl.hasnode(node))
1411 1412 cache = self._branchcaches[None]
1412 cache.update(self, ctxgen)
1413 cache.update(self, revgen)
1413 1414 cache.write(self)
1414 1415
1415 1416 # Ensure the persistent tag cache is updated. Doing it now
General Comments 0
You need to be logged in to leave comments. Login now