/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/weave.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-20 14:51:03 UTC
  • mfrom: (0.8.23 version_info)
  • mto: This revision was merged to the branch mainline in revision 2028.
  • Revision ID: john@arbash-meinel.com-20060920145103-02725c6d6c886040
[merge] version-info plugin, and cleanup for layout in bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
import time
76
76
import warnings
77
77
 
78
 
from bzrlib import (
79
 
    progress,
80
 
    )
81
78
from bzrlib.trace import mutter
82
79
from bzrlib.errors import (WeaveError, WeaveFormatError, WeaveParentMismatch,
83
80
        RevisionAlreadyPresent,
247
244
 
248
245
    def _lookup(self, name):
249
246
        """Convert symbolic version name to index."""
250
 
        self.check_not_reserved_id(name)
251
247
        try:
252
248
            return self._name_map[name]
253
249
        except KeyError:
641
637
        """
642
638
        return len(other_parents.difference(my_parents)) == 0
643
639
 
 
640
    def annotate(self, version_id):
 
641
        if isinstance(version_id, int):
 
642
            warnings.warn('Weave.annotate(int) is deprecated. Please use version names'
 
643
                 ' in all circumstances as of 0.8',
 
644
                 DeprecationWarning,
 
645
                 stacklevel=2
 
646
                 )
 
647
            result = []
 
648
            for origin, lineno, text in self._extract([version_id]):
 
649
                result.append((origin, text))
 
650
            return result
 
651
        else:
 
652
            return super(Weave, self).annotate(version_id)
 
653
    
644
654
    def annotate_iter(self, version_id):
645
655
        """Yield list of (version-id, line) pairs for the specified version.
646
656
 
654
664
        """_walk has become visit, a supported api."""
655
665
        return self._walk_internal()
656
666
 
657
 
    def iter_lines_added_or_present_in_versions(self, version_ids=None,
658
 
                                                pb=None):
 
667
    def iter_lines_added_or_present_in_versions(self, version_ids=None):
659
668
        """See VersionedFile.iter_lines_added_or_present_in_versions()."""
660
669
        if version_ids is None:
661
670
            version_ids = self.versions()
1107
1116
 
1108
1117
    def _add_lines(self, version_id, parents, lines, parent_texts):
1109
1118
        """Add a version and save the weave."""
1110
 
        self.check_not_reserved_id(version_id)
1111
1119
        result = super(WeaveFile, self)._add_lines(version_id, parents, lines,
1112
1120
                                                   parent_texts)
1113
1121
        self._save()