##// END OF EJS Templates
revbranchcache: move entry writing to a separate function...
Durham Goode -
r24375:fe255b25 default
parent child Browse files
Show More
@@ -399,11 +399,15 b' class revbranchcache(object):'
399 reponode = changelog.node(rev)
399 reponode = changelog.node(rev)
400 if close:
400 if close:
401 branchidx |= _rbccloseflag
401 branchidx |= _rbccloseflag
402 self._setcachedata(rev, reponode, branchidx)
403 return b, close
404
405 def _setcachedata(self, rev, node, branchidx):
406 """Writes the node's branch data to the in-memory cache data."""
402 rbcrevidx = rev * _rbcrecsize
407 rbcrevidx = rev * _rbcrecsize
403 rec = array('c')
408 rec = array('c')
404 rec.fromstring(pack(_rbcrecfmt, reponode, branchidx))
409 rec.fromstring(pack(_rbcrecfmt, node, branchidx))
405 self._rbcrevs[rbcrevidx:rbcrevidx + _rbcrecsize] = rec
410 self._rbcrevs[rbcrevidx:rbcrevidx + _rbcrecsize] = rec
406 return b, close
407
411
408 def write(self):
412 def write(self):
409 """Save branch cache if it is dirty."""
413 """Save branch cache if it is dirty."""
General Comments 0
You need to be logged in to leave comments. Login now