~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-02-15 15:11:31 UTC
  • mfrom: (2230.3.55 branch6)
  • Revision ID: pqm@pqm.ubuntu.com-20070215151131-1f2ce67d76e40200
Provide new branch6 format

Show diffs side-by-side

added added

removed removed

Lines of Context:
644
644
            done.add(revision_id)
645
645
        return result
646
646
 
 
647
    def _get_history_vf(self):
 
648
        """Get a versionedfile whose history graph reflects all revisions.
 
649
 
 
650
        For weave repositories, this is the inventory weave.
 
651
        """
 
652
        return self.get_inventory_weave()
 
653
 
 
654
    def iter_reverse_revision_history(self, revision_id):
 
655
        """Iterate backwards through revision ids in the lefthand history
 
656
 
 
657
        :param revision_id: The revision id to start with.  All its lefthand
 
658
            ancestors will be traversed.
 
659
        """
 
660
        if revision_id in (None, _mod_revision.NULL_REVISION):
 
661
            return
 
662
        next_id = revision_id
 
663
        versionedfile = self._get_history_vf()
 
664
        while True:
 
665
            yield next_id
 
666
            parents = versionedfile.get_parents(next_id)
 
667
            if len(parents) == 0:
 
668
                return
 
669
            else:
 
670
                next_id = parents[0]
 
671
 
647
672
    @needs_read_lock
648
673
    def get_revision_inventory(self, revision_id):
649
674
        """Return inventory of a past revision."""