equal
deleted
inserted
replaced
397 self._names.append(b) |
397 self._names.append(b) |
398 self._namesreverse[b] = branchidx |
398 self._namesreverse[b] = branchidx |
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.""" |
410 repo = self._repo |
414 repo = self._repo |
411 if self._rbcnamescount < len(self._names): |
415 if self._rbcnamescount < len(self._names): |