/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

  • Committer: Aaron Bentley
  • Date: 2007-12-03 21:38:07 UTC
  • mto: This revision was merged to the branch mainline in revision 3073.
  • Revision ID: abentley@panoramicfeedback.com-20071203213807-inz8pur6ejnc1ax5
Use topo_sorted=False with get_ancestry

Show diffs side-by-side

added added

removed removed

Lines of Context:
550
550
        else:
551
551
            raise errors.RevisionNotPresent(version_id, self._file_id)
552
552
 
553
 
    def get_ancestry(self, version_id):
 
553
    def get_ancestry(self, version_id, topo_sorted=False):
554
554
        """See VersionedFile.get_ancestry.
555
555
 
556
556
        Note that this implementation assumes that if a VersionedFile can
561
561
        Also note that the results of this version are never topologically
562
562
        sorted, and are a set.
563
563
        """
 
564
        if topo_sorted:
 
565
            raise ValueError('This implementation does not provide sorting')
564
566
        parents = self._parents.get(version_id)
565
567
        if parents is None:
566
568
            for vf in self.fallback_versionedfiles:
567
569
                try:
568
 
                    return vf.get_ancestry(version_id)
 
570
                    return vf.get_ancestry(version_id, topo_sorted=False)
569
571
                except errors.RevisionNotPresent:
570
572
                    continue
571
573
            else:
572
574
                raise errors.RevisionNotPresent(version_id, self._file_id)
573
575
        ancestry = set([version_id])
574
576
        for parent in parents:
575
 
            ancestry.update(self.get_ancestry(parent))
 
577
            ancestry.update(self.get_ancestry(parent, topo_sorted=False))
576
578
        return ancestry
577
579
 
578
580
    def get_parents(self, version_id):