hgext3rd/evolve/obscache.py
changeset 2570 86959f2c625d
parent 2569 427f6091250e
child 2594 a3fbe5293bf6
equal deleted inserted replaced
2569:427f6091250e 2570:86959f2c625d
   415         any object beside the nodes and not have to decode any complex data.
   415         any object beside the nodes and not have to decode any complex data.
   416 
   416 
   417         For now we stick to the simpler approach of paying the
   417         For now we stick to the simpler approach of paying the
   418         performance cost on new changesets.
   418         performance cost on new changesets.
   419         """
   419         """
   420         node = repo.changelog.node
   420         new_entries = bytearray(len(revs))
   421         succs = repo.obsstore.successors
   421         if not self._data:
   422         for r in revs:
   422             self._setdata(new_entries)
   423             if node(r) in succs:
   423         else:
   424                 val = 1
   424             self._data.extend(new_entries)
   425             else:
   425         data = self._data
   426                 val = 0
   426         if repo.obsstore:
   427             self._data.append(val)
   427             node = repo.changelog.node
   428         cl = repo.changelog
   428             succs = repo.obsstore.successors
   429         assert len(self._data) == len(cl), (len(self._data), len(cl))
   429             for r in revs:
       
   430                 if node(r) in succs:
       
   431                     data[r] = 1
   430 
   432 
   431     def _updatemarkers(self, repo, obsmarkers):
   433     def _updatemarkers(self, repo, obsmarkers):
   432         """update the cache with new markers"""
   434         """update the cache with new markers"""
   433         rev = repo.changelog.nodemap.get
   435         rev = repo.changelog.nodemap.get
   434         for m in obsmarkers:
   436         for m in obsmarkers: