~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/weaverepo.py

  • Committer: Robert Collins
  • Date: 2008-01-11 03:54:51 UTC
  • mto: (3172.5.3 remote.graph)
  • mto: This revision was merged to the branch mainline in revision 3176.
  • Revision ID: robertc@robertcollins.net-20080111035451-52at4031ohbmtoh2
Repository has a new method ``has_revisions`` which signals the presence
of many revisions by returning a set of the revisions listed which are
present. This can be done by index queries without reading data for parent
revision names etc. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
                        pending.add(revision_id)
177
177
            return result
178
178
 
 
179
    def has_revisions(self, revision_ids):
 
180
        """See Repository.has_revisions()."""
 
181
        result = set()
 
182
        transaction = self.get_transaction()
 
183
        for revision_id in revision_ids:
 
184
            if self._revision_store.has_revision_id(revision_id, transaction):
 
185
                result.add(revision_id)
 
186
        return result
 
187
 
179
188
    @needs_read_lock
180
189
    def is_shared(self):
181
190
        """AllInOne repositories cannot be shared."""
308
317
                        pending.add(revision_id)
309
318
            return result
310
319
 
 
320
    def has_revisions(self, revision_ids):
 
321
        """See Repository.has_revisions()."""
 
322
        result = set()
 
323
        transaction = self.get_transaction()
 
324
        for revision_id in revision_ids:
 
325
            if self._revision_store.has_revision_id(revision_id, transaction):
 
326
                result.add(revision_id)
 
327
        return result
 
328
 
311
329
    def revision_graph_can_have_wrong_parents(self):
312
330
        # XXX: This is an old format that we don't support full checking on, so
313
331
        # just claim that checking for this inconsistency is not required.