~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

Abbreviate pack_stat struct format to '>6L'

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,
179
181
        result.get_parent_map([('A',)])
180
182
        return result
181
183
 
182
 
    def fileid_involved_between_revs(self, from_revid, to_revid):
183
 
        """Find file_id(s) which are involved in the changes between revisions.
184
 
 
185
 
        This determines the set of revisions which are involved, and then
186
 
        finds all file ids affected by those revisions.
187
 
        """
188
 
        vf = self._get_revision_vf()
189
 
        from_set = set(vf.get_ancestry(from_revid))
190
 
        to_set = set(vf.get_ancestry(to_revid))
191
 
        changed = to_set.difference(from_set)
192
 
        return self._fileid_involved_by_set(changed)
193
 
 
194
 
    def fileid_involved(self, last_revid=None):
195
 
        """Find all file_ids modified in the ancestry of last_revid.
196
 
 
197
 
        :param last_revid: If None, last_revision() will be used.
198
 
        """
199
 
        if not last_revid:
200
 
            changed = set(self.all_revision_ids())
201
 
        else:
202
 
            changed = set(self.get_ancestry(last_revid))
203
 
        if None in changed:
204
 
            changed.remove(None)
205
 
        return self._fileid_involved_by_set(changed)
206
 
 
207
184
    @needs_read_lock
208
185
    def get_revision(self, revision_id):
209
186
        """Return the Revision object for a named revision"""
507
484
    @needs_read_lock
508
485
    def search_missing_revision_ids(self,
509
486
            revision_id=symbol_versioning.DEPRECATED_PARAMETER,
510
 
            find_ghosts=True, revision_ids=None, if_present_ids=None):
 
487
            find_ghosts=True, revision_ids=None, if_present_ids=None,
 
488
            limit=None):
511
489
        """See InterRepository.search_missing_revision_ids()."""
512
490
        if symbol_versioning.deprecated_passed(revision_id):
513
491
            symbol_versioning.warn(
542
520
            # that against the revision records.
543
521
            result_set = set(
544
522
                self.source._eliminate_revisions_not_present(required_revisions))
 
523
        if limit is not None:
 
524
            topo_ordered = self.source.get_graph().iter_topo_order(result_set)
 
525
            result_set = set(itertools.islice(topo_ordered, limit))
545
526
        return self.source.revision_ids_to_search_result(result_set)
546
527
 
547
528