~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

  • Committer: INADA Naoki
  • Date: 2011-05-17 00:45:09 UTC
  • mfrom: (5875 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5891.
  • Revision ID: songofacandy@gmail.com-20110517004509-q58negjbdjh7t6u1
mergeĀ fromĀ lp:bzr

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
 
 
21
19
from bzrlib import (
22
20
    bzrdir,
23
21
    errors,
181
179
        result.get_parent_map([('A',)])
182
180
        return result
183
181
 
 
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
 
184
207
    @needs_read_lock
185
208
    def get_revision(self, revision_id):
186
209
        """Return the Revision object for a named revision"""
484
507
    @needs_read_lock
485
508
    def search_missing_revision_ids(self,
486
509
            revision_id=symbol_versioning.DEPRECATED_PARAMETER,
487
 
            find_ghosts=True, revision_ids=None, if_present_ids=None,
488
 
            limit=None):
 
510
            find_ghosts=True, revision_ids=None, if_present_ids=None):
489
511
        """See InterRepository.search_missing_revision_ids()."""
490
512
        if symbol_versioning.deprecated_passed(revision_id):
491
513
            symbol_versioning.warn(
520
542
            # that against the revision records.
521
543
            result_set = set(
522
544
                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))
526
545
        return self.source.revision_ids_to_search_result(result_set)
527
546
 
528
547