2279
2279
class cmd_check(Command):
2280
"""Validate working tree structure, branch consistency and repository
2280
"""Validate working tree structure, branch consistency and repository history.
2283
2282
This command checks various invariants about branch and repository storage
2284
2283
to detect data corruption or bzr bugs.
2299
2298
in the checked revisions. Texts can be repeated when their file
2300
2299
entries are modified, but the file contents are not. It does not
2301
2300
indicate a problem.
2302
If no restrictions are specified, all Bazaar data that is found at the given
2303
location will be checked.
2307
Check the tree and branch at 'foo'::
2309
bzr check --tree --branch foo
2311
Check only the repository at 'bar'::
2313
bzr check --repo bar
2315
Check everything at 'baz'::
2304
2320
_see_also = ['reconcile']
2305
2321
takes_args = ['path?']
2306
takes_options = ['verbose']
2322
takes_options = ['verbose',
2323
Option('branch', help="Check the branch related to the"
2324
" current directory."),
2325
Option('repo', help="Check the repository related to the"
2326
" current directory."),
2327
Option('tree', help="Check the working tree related to"
2328
" the current directory.")]
2308
def run(self, path=None, verbose=False):
2330
def run(self, path=None, verbose=False, branch=False, repo=False,
2309
2332
from bzrlib.check import check_dwim
2310
2333
if path is None:
2312
check_dwim(path, verbose)
2335
if not branch and not repo and not tree:
2336
branch = repo = tree = True
2337
check_dwim(path, verbose, do_branch=branch, do_repo=repo, do_tree=tree)
2315
2340
class cmd_upgrade(Command):