268
268
self._control_files.break_lock()
269
269
self.branch.break_lock()
271
def _get_check_refs(self):
272
"""Return the references needed to perform a check of this tree.
274
The default implementation returns no refs, and is only suitable for
275
trees that have no local caching and can commit on ghosts at any time.
277
:seealso: bzrlib.check for details about check_refs.
281
271
def requires_rich_root(self):
282
272
return self._format.requires_rich_root
1785
1775
self.set_conflicts(un_resolved)
1786
1776
return un_resolved, resolved
1789
def _check(self, references):
1790
"""Check the tree for consistency.
1792
:param references: A dict with keys matching the items returned by
1793
self._get_check_refs(), and values from looking those keys up in
1796
tree_basis = self.basis_tree()
1797
tree_basis.lock_read()
1799
repo_basis = references[('trees', self.last_revision())]
1800
if len(list(repo_basis.iter_changes(tree_basis))) > 0:
1801
raise errors.BzrCheckError(
1802
"Mismatched basis inventory content.")
1807
1778
def _validate(self):
1808
1779
"""Validate internal structures.
1819
1789
def check_state(self):
1820
1790
"""Check that the working state is/isn't valid."""
1821
check_refs = self._get_check_refs()
1823
for ref in check_refs:
1826
refs[ref] = self.branch.repository.revision_tree(value)
1791
raise NotImplementedError(self.check_state)
1829
1793
def reset_state(self, revision_ids=None):
1830
1794
"""Reset the state of the working tree.
2139
2103
if self._change_last_revision(new_revision):
2140
2104
self._cache_basis_inventory(new_revision)
2106
def _get_check_refs(self):
2107
"""Return the references needed to perform a check of this tree.
2109
The default implementation returns no refs, and is only suitable for
2110
trees that have no local caching and can commit on ghosts at any time.
2112
:seealso: bzrlib.check for details about check_refs.
2117
def _check(self, references):
2118
"""Check the tree for consistency.
2120
:param references: A dict with keys matching the items returned by
2121
self._get_check_refs(), and values from looking those keys up in
2124
tree_basis = self.basis_tree()
2125
tree_basis.lock_read()
2127
repo_basis = references[('trees', self.last_revision())]
2128
if len(list(repo_basis.iter_changes(tree_basis))) > 0:
2129
raise errors.BzrCheckError(
2130
"Mismatched basis inventory content.")
2136
def check_state(self):
2137
"""Check that the working state is/isn't valid."""
2138
check_refs = self._get_check_refs()
2140
for ref in check_refs:
2143
refs[ref] = self.branch.repository.revision_tree(value)
2142
2146
@needs_tree_write_lock
2143
2147
def reset_state(self, revision_ids=None):
2144
2148
"""Reset the state of the working tree.