~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-10-10 07:23:07 UTC
  • mfrom: (2067.1.1 urandom-56883)
  • Revision ID: pqm@pqm.ubuntu.com-20061010072307-037a6f63da8a1bdd
(John Arbash Meinel) Handle exceptions while opening /dev/urandom

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
 
248
248
    def _lookup(self, name):
249
249
        """Convert symbolic version name to index."""
250
 
        self.check_not_reserved_id(name)
251
250
        try:
252
251
            return self._name_map[name]
253
252
        except KeyError:
607
606
        else:
608
607
            return self.get_ancestry(version_ids)
609
608
 
610
 
    def get_ancestry(self, version_ids, topo_sorted=True):
 
609
    def get_ancestry(self, version_ids):
611
610
        """See VersionedFile.get_ancestry."""
612
611
        if isinstance(version_ids, basestring):
613
612
            version_ids = [version_ids]
641
640
        """
642
641
        return len(other_parents.difference(my_parents)) == 0
643
642
 
 
643
    def annotate(self, version_id):
 
644
        if isinstance(version_id, int):
 
645
            warnings.warn('Weave.annotate(int) is deprecated. Please use version names'
 
646
                 ' in all circumstances as of 0.8',
 
647
                 DeprecationWarning,
 
648
                 stacklevel=2
 
649
                 )
 
650
            result = []
 
651
            for origin, lineno, text in self._extract([version_id]):
 
652
                result.append((origin, text))
 
653
            return result
 
654
        else:
 
655
            return super(Weave, self).annotate(version_id)
 
656
    
644
657
    def annotate_iter(self, version_id):
645
658
        """Yield list of (version-id, line) pairs for the specified version.
646
659
 
1107
1120
 
1108
1121
    def _add_lines(self, version_id, parents, lines, parent_texts):
1109
1122
        """Add a version and save the weave."""
1110
 
        self.check_not_reserved_id(version_id)
1111
1123
        result = super(WeaveFile, self)._add_lines(version_id, parents, lines,
1112
1124
                                                   parent_texts)
1113
1125
        self._save()