~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to knit.py

  • Committer: Martin Pool
  • Date: 2005-06-27 04:21:55 UTC
  • mto: This revision was merged to the branch mainline in revision 852.
  • Revision ID: mbp@sourcefrog.net-20050627042155-6bd7d122f5bda095
Factor out Knit.extract() method

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
 
84
84
        The index indicates when the line originated in the weave."""
85
85
        vi = self._v[index]
86
 
 
 
86
        included = set(vi.included)
 
87
        included.add(index)
 
88
        return iter(self.extract(included))
 
89
 
 
90
 
 
91
    def extract(self, included):
 
92
        """Yield annotation of lines in included set.
 
93
 
 
94
        The set typically but not necessarily corresponds to a version.
 
95
        """
87
96
        for origin, line in self._l:
88
 
            if (origin == index) or (origin in vi.included):
 
97
            if origin in included:
89
98
                yield origin, line
 
99
        
90
100
 
91
101
 
92
102
    def getiter(self, index):