~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-20 13:28:35 UTC
  • mfrom: (5852.1.11 fetch-limit)
  • Revision ID: pqm@pqm.ubuntu.com-20110520132835-3rf01eu5mbkz3zos
(jelmer) Add limit argument to Branch.fetch(). (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from bzrlib.lazy_import import lazy_import
18
18
lazy_import(globals(), """
 
19
import itertools
 
20
 
19
21
from bzrlib import (
20
22
    bzrdir,
21
23
    errors,
507
509
    @needs_read_lock
508
510
    def search_missing_revision_ids(self,
509
511
            revision_id=symbol_versioning.DEPRECATED_PARAMETER,
510
 
            find_ghosts=True, revision_ids=None, if_present_ids=None):
 
512
            find_ghosts=True, revision_ids=None, if_present_ids=None,
 
513
            limit=None):
511
514
        """See InterRepository.search_missing_revision_ids()."""
512
515
        if symbol_versioning.deprecated_passed(revision_id):
513
516
            symbol_versioning.warn(
542
545
            # that against the revision records.
543
546
            result_set = set(
544
547
                self.source._eliminate_revisions_not_present(required_revisions))
 
548
        if limit is not None:
 
549
            topo_ordered = self.source.get_graph().iter_topo_order(result_set)
 
550
            result_set = set(itertools.islice(topo_ordered, limit))
545
551
        return self.source.revision_ids_to_search_result(result_set)
546
552
 
547
553