28
28
from unittest import TestSuite
31
import bzrlib.errors as errors
31
32
from bzrlib.inter import InterObject
32
33
from bzrlib.symbol_versioning import *
33
34
from bzrlib.transport.memory import MemoryTransport
49
50
Texts are identified by a version-id string.
52
56
def copy_to(self, name, transport):
53
57
"""Copy this versioned file to name on transport."""
54
58
raise NotImplementedError(self.copy_to)
80
84
already present in file history.
82
86
Must raise RevisionNotPresent if any of the given parents are
83
not present in file history."""
87
not present in file history.
89
self._check_finished()
90
self._add_lines(version_id, parents, lines)
92
def _add_lines(self, version_id, parents, lines):
93
"""Helper to do the class specific add_lines."""
84
94
raise NotImplementedError(self.add_lines)
86
96
def add_lines_with_ghosts(self, version_id, parents, lines):
87
97
"""Add lines to the versioned file, allowing ghosts to be present."""
98
self._check_finished()
99
self._add_lines_with_ghosts(version_id, parents, lines)
101
def _add_lines_with_ghosts(self, version_id, parents, lines):
102
"""Helper to do class specific add_lines_with_ghosts."""
88
103
raise NotImplementedError(self.add_lines_with_ghosts)
90
105
def check(self, progress_bar=None):
91
106
"""Check the versioned file for integrity."""
92
107
raise NotImplementedError(self.check)
109
def _check_finished(self):
110
"""Is the versioned file marked as 'finished' ? Raise if it is."""
112
raise errors.OutSideTransaction()
94
114
def clear_cache(self):
95
115
"""Remove any data cached in the versioned file object."""
121
141
the parents list must be a superset of the current
144
self._check_finished()
145
self._fix_parents(version, new_parents)
147
def _fix_parents(self, version, new_parents):
148
"""Helper for fix_parents."""
124
149
raise NotImplementedError(self.fix_parents)
126
151
def get_suffixes(self):
255
281
raise NotImplementedError(self.iter_lines_added_or_present_in_versions)
283
def transaction_finished(self):
284
"""The transaction that this file was opened in has finished.
286
This records self.finished = True and should cause all mutating
257
291
@deprecated_method(zero_eight)
258
292
def walk(self, version_ids=None):
259
293
"""Walk the versioned file as a weave-like structure, for