/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-04 03:36:03 UTC
  • mfrom: (3073 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3133.
  • Revision ID: aaron.bentley@utoronto.ca-20071204033603-equ8y41vfk8vkway
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
517
517
        self._parents = {}
518
518
        self._lines = {}
519
519
 
 
520
    def plan_merge(self, ver_a, ver_b):
 
521
        """See VersionedFile.plan_merge"""
 
522
        from merge import _PlanMerge
 
523
        return _PlanMerge(ver_a, ver_b, self).plan_merge()
 
524
 
520
525
    def add_lines(self, version_id, parents, lines):
521
526
        """See VersionedFile.add_lines
522
527
 
545
550
        else:
546
551
            raise errors.RevisionNotPresent(version_id, self._file_id)
547
552
 
548
 
    def get_ancestry(self, version_id):
 
553
    def get_ancestry(self, version_id, topo_sorted=False):
549
554
        """See VersionedFile.get_ancestry.
550
555
 
551
556
        Note that this implementation assumes that if a VersionedFile can
556
561
        Also note that the results of this version are never topologically
557
562
        sorted, and are a set.
558
563
        """
 
564
        if topo_sorted:
 
565
            raise ValueError('This implementation does not provide sorting')
559
566
        parents = self._parents.get(version_id)
560
567
        if parents is None:
561
568
            for vf in self.fallback_versionedfiles:
562
569
                try:
563
 
                    return vf.get_ancestry(version_id)
 
570
                    return vf.get_ancestry(version_id, topo_sorted=False)
564
571
                except errors.RevisionNotPresent:
565
572
                    continue
566
573
            else:
567
574
                raise errors.RevisionNotPresent(version_id, self._file_id)
568
575
        ancestry = set([version_id])
569
576
        for parent in parents:
570
 
            ancestry.update(self.get_ancestry(parent))
 
577
            ancestry.update(self.get_ancestry(parent, topo_sorted=False))
571
578
        return ancestry
572
579
 
573
580
    def get_parents(self, version_id):