157
157
transaction.register_clean(w, precious=self._precious)
160
@deprecated_method(zero_eight)
161
def get_lines(self, file_id, rev_id, transaction):
162
"""Return text from a particular version of a weave.
164
Returned as a list of lines.
166
file_id = osutils.safe_file_id(file_id)
167
w = self.get_weave(file_id, transaction)
168
return w.get_lines(rev_id)
170
160
def _make_new_versionedfile(self, file_id, transaction,
171
161
known_missing=False, _filename=None):
172
162
"""Make a new versioned file.
214
204
transaction.register_dirty(weave)
217
@deprecated_method(zero_eight)
218
def put_weave(self, file_id, weave, transaction):
219
"""This is a deprecated API: It writes an entire collection of ids out.
221
This became inappropriate when we made a versioned file api which
222
tracks the state of the collection of versions for a single id.
224
Its maintained for backwards compatability but will only work on
225
weave stores - pre 0.8 repositories.
227
file_id = osutils.safe_file_id(file_id)
228
self._put_weave(file_id, weave, transaction)
230
207
def _put_weave(self, file_id, weave, transaction):
231
208
"""Preserved here for upgrades-to-weaves to use."""
232
209
myweave = self._make_new_versionedfile(file_id, transaction)
233
210
myweave.join(weave)
235
@deprecated_method(zero_eight)
236
def add_text(self, file_id, rev_id, new_lines, parents, transaction):
237
"""This method was a shorthand for
239
vfile = self.get_weave_or_empty(file_id, transaction)
240
vfile.add_lines(rev_id, parents, new_lines)
242
file_id = osutils.safe_file_id(file_id)
243
vfile = self.get_weave_or_empty(file_id, transaction)
244
vfile.add_lines(rev_id, parents, new_lines)
246
@deprecated_method(zero_eight)
247
def add_identical_text(self, file_id, old_rev_id, new_rev_id, parents,
249
"""This method was a shorthand for
251
vfile = self.get_weave_or_empty(file_id, transaction)
252
vfile.clone_text(new_rev_id, old_rev_id, parents)
254
file_id = osutils.safe_file_id(file_id)
255
old_rev_id = osutils.safe_revision_id(old_rev_id)
256
new_rev_id = osutils.safe_revision_id(new_rev_id)
257
vfile = self.get_weave_or_empty(file_id, transaction)
258
vfile.clone_text(new_rev_id, old_rev_id, parents)
260
212
def copy(self, source, result_id, transaction):
261
213
"""Copy the source versioned file to result_id in this store."""
262
214
self._clear_cache_id(result_id, transaction)