~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

Introduce a api specifically for looking at lines in some versions of the inventory, for fileid_involved.

Show diffs side-by-side

added added

removed removed

Lines of Context:
188
188
            version_ids,
189
189
            ignore_missing)
190
190
 
 
191
    def iter_lines_added_or_present_in_versions(self, version_ids=None):
 
192
        """Iterate over the lines in the versioned file from version_ids.
 
193
 
 
194
        This may return lines from other versions, and does not return the
 
195
        specific version marker at this point. The api may be changed
 
196
        during development to include the version that the versioned file
 
197
        thinks is relevant, but given that such hints are just guesses,
 
198
        its better not to have it if we dont need it.
 
199
 
 
200
        NOTES: Lines are normalised: they will all have \n terminators.
 
201
               Lines are returned in arbitrary order.
 
202
        """
 
203
        raise NotImplementedError(self.iter_lines_added_or_present_in_versions)
 
204
 
 
205
    @deprecated_method(zero_eight)
191
206
    def walk(self, version_ids=None):
192
207
        """Walk the versioned file as a weave-like structure, for
193
208
        versions relative to version_ids.  Yields sequence of (lineno,
198
213
 
199
214
        :param version_ids: the version_ids to walk with respect to. If not
200
215
                            supplied the entire weave-like structure is walked.
 
216
 
 
217
        walk is deprecated in favour of iter_lines_added_or_present_in_versions
201
218
        """
202
219
        raise NotImplementedError(self.walk)
203
220
 
218
235
        inc_b = set(self.get_ancestry([ver_b]))
219
236
        inc_c = inc_a & inc_b
220
237
 
221
 
        for lineno, insert, deleteset, line in self.walk():
 
238
        for lineno, insert, deleteset, line in self.walk([ver_a, ver_b]):
222
239
            if deleteset & inc_c:
223
240
                # killed in parent; can't be in either a or b
224
241
                # not relevant to our work