##// END OF EJS Templates
revbranchcache: add a public function to update the data...
Boris Feld -
r36980:95f4f1bf default
parent child Browse files
Show More
@@ -454,6 +454,26 b' class revbranchcache(object):'
454 454 self._setcachedata(rev, reponode, branchidx)
455 455 return b, close
456 456
457 def setdata(self, branch, rev, node, close):
458 """add new data information to the cache"""
459 if branch in self._namesreverse:
460 branchidx = self._namesreverse[branch]
461 else:
462 branchidx = len(self._names)
463 self._names.append(branch)
464 self._namesreverse[branch] = branchidx
465 if close:
466 branchidx |= _rbccloseflag
467 self._setcachedata(rev, node, branchidx)
468 # If no cache data were readable (non exists, bad permission, etc)
469 # the cache was bypassing itself by setting:
470 #
471 # self.branchinfo = self._branchinfo
472 #
473 # Since we now have data in the cache, we need to drop this bypassing.
474 if 'branchinfo' in vars(self):
475 del self.branchinfo
476
457 477 def _setcachedata(self, rev, node, branchidx):
458 478 """Writes the node's branch data to the in-memory cache data."""
459 479 if rev == nullrev:
General Comments 0
You need to be logged in to leave comments. Login now