~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to knit.py

  • Committer: Martin Pool
  • Date: 2005-06-27 03:07:53 UTC
  • mto: This revision was merged to the branch mainline in revision 852.
  • Revision ID: mbp@sourcefrog.net-20050627030753-5bc4ff34c0d50140
Unify get/annotate code

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        """Yield list of (index-id, line) pairs for the specified version.
66
66
 
67
67
        The index indicates when the line originated in the weave."""
 
68
        self._v[index]                  # check index is valid
 
69
 
68
70
        for origin, line in self._l:
69
71
            if origin == index:
70
72
                yield origin, line
72
74
 
73
75
    def getiter(self, index):
74
76
        """Yield lines for the specified version."""
75
 
        self._v[index]                  # check index is valid
76
 
 
77
 
        for idx, line in self._l:
78
 
            if idx == index:
79
 
                yield line
 
77
        for origin, line in self.annotate_iter(index):
 
78
            yield line
80
79
 
81
80
 
82
81
    def get(self, index):