##// END OF EJS Templates
branchmap: updating triggers a write...
Martijn Pieters -
r41707:eb7ce452 default
parent child Browse files
Show More
@@ -63,7 +63,6 b' def updatecache(repo):'
63 revs.extend(cl.revs(start=bcache.tiprev + 1))
63 revs.extend(cl.revs(start=bcache.tiprev + 1))
64 if revs:
64 if revs:
65 bcache.update(repo, revs)
65 bcache.update(repo, revs)
66 bcache.write(repo)
67
66
68 assert bcache.validfor(repo), filtername
67 assert bcache.validfor(repo), filtername
69 repo._branchcaches[repo.filtername] = bcache
68 repo._branchcaches[repo.filtername] = bcache
@@ -242,7 +241,8 b' class branchcache(dict):'
242
241
243 def copy(self):
242 def copy(self):
244 """return an deep copy of the branchcache object"""
243 """return an deep copy of the branchcache object"""
245 return branchcache(self, self.tipnode, self.tiprev, self.filteredhash,
244 return type(self)(
245 self, self.tipnode, self.tiprev, self.filteredhash,
246 self._closednodes)
246 self._closednodes)
247
247
248 def write(self, repo):
248 def write(self, repo):
@@ -332,6 +332,15 b' class branchcache(dict):'
332 repo.ui.log('branchcache', 'updated %s branch cache in %.4f seconds\n',
332 repo.ui.log('branchcache', 'updated %s branch cache in %.4f seconds\n',
333 repo.filtername, duration)
333 repo.filtername, duration)
334
334
335 self.write(repo)
336
337
338 class remotebranchcache(branchcache):
339 """Branchmap info for a remote connection, should not write locally"""
340 def write(self, repo):
341 pass
342
343
335 # Revision branch info cache
344 # Revision branch info cache
336
345
337 _rbcversion = '-v1'
346 _rbcversion = '-v1'
@@ -238,7 +238,7 b' def _headssummary(pushop):'
238
238
239 # D. Update newmap with outgoing changes.
239 # D. Update newmap with outgoing changes.
240 # This will possibly add new heads and remove existing ones.
240 # This will possibly add new heads and remove existing ones.
241 newmap = branchmap.branchcache((branch, heads[1])
241 newmap = branchmap.remotebranchcache((branch, heads[1])
242 for branch, heads in headssum.iteritems()
242 for branch, heads in headssum.iteritems()
243 if heads[0] is not None)
243 if heads[0] is not None)
244 newmap.update(repo, (ctx.rev() for ctx in missingctx))
244 newmap.update(repo, (ctx.rev() for ctx in missingctx))
General Comments 0
You need to be logged in to leave comments. Login now