235
def _open_directory_or_containing_tree_or_branch(filename, directory):
236
"""Open the tree or branch containing the specified file, unless
237
the --directory option is used to specify a different branch."""
238
if directory is not None:
239
return (None, Branch.open(directory), filename)
240
return bzrdir.BzrDir.open_containing_tree_or_branch(filename)
235
243
# TODO: Make sure no commands unconditionally use the working directory as a
236
244
# branch. If a filename argument is used, the first of them should be used to
237
245
# specify the branch. (Perhaps this can be factored out into some kind of
342
350
takes_args = ['revision_id?']
343
takes_options = ['revision']
351
takes_options = ['directory', 'revision']
344
352
# cat-revision is more for frontends so should be exact
345
353
encoding = 'strict'
353
361
self.outf.write(revtext.decode('utf-8'))
356
def run(self, revision_id=None, revision=None):
364
def run(self, revision_id=None, revision=None, directory=u'.'):
357
365
if revision_id is not None and revision is not None:
358
366
raise errors.BzrCommandError('You can only supply one of'
359
367
' revision_id or --revision')
360
368
if revision_id is None and revision is None:
361
369
raise errors.BzrCommandError('You must supply either'
362
370
' --revision or a revision_id')
363
b = WorkingTree.open_containing(u'.')[0].branch
371
b = WorkingTree.open_containing(directory)[0].branch
365
373
revisions = b.repository.revisions
366
374
if revisions is None:
483
491
takes_options = [
485
493
help='Remove the working tree even if it has '
486
'uncommitted changes.'),
494
'uncommitted or shelved changes.'),
489
497
def run(self, location_list, force=False):
504
512
if (working.has_changes()):
505
513
raise errors.UncommittedChanges(working)
514
if working.get_shelf_manager().last_shelf() is not None:
515
raise errors.ShelvedChanges(working)
507
517
if working.user_url != working.branch.user_url:
508
518
raise errors.BzrCommandError("You cannot remove the working tree"
552
562
takes_args = ['revision_info*']
553
563
takes_options = [
565
custom_help('directory',
556
566
help='Branch to examine, '
557
'rather than the one containing the working directory.',
567
'rather than the one containing the working directory.'),
561
568
Option('tree', help='Show revno of working tree'),
951
958
takes_options = ['remember', 'overwrite', 'revision',
952
959
custom_help('verbose',
953
960
help='Show logs of pulled revisions.'),
961
custom_help('directory',
955
962
help='Branch to pull into, '
956
'rather than the one containing the working directory.',
963
'rather than the one containing the working directory.'),
961
965
help="Perform a local pull in a bound "
962
966
"branch. Local pulls are not applied to "
1076
1080
Option('create-prefix',
1077
1081
help='Create the path leading up to the branch '
1078
1082
'if it does not already exist.'),
1083
custom_help('directory',
1080
1084
help='Branch to push from, '
1081
'rather than the one containing the working directory.',
1085
'rather than the one containing the working directory.'),
1085
1086
Option('use-existing-dir',
1086
1087
help='By default push will fail if the target'
1087
1088
' directory exists, but does not already'
1969
1970
old_branch, new_branch,
1970
1971
specific_files, extra_trees) = get_trees_and_branches_to_diff_locked(
1971
1972
file_list, revision, old, new, self.add_cleanup, apply_view=True)
1973
# GNU diff on Windows uses ANSI encoding for filenames
1974
path_encoding = osutils.get_diff_header_encoding()
1972
1975
return show_diff_trees(old_tree, new_tree, sys.stdout,
1973
1976
specific_files=specific_files,
1974
1977
external_diff_options=diff_options,
1975
1978
old_label=old_label, new_label=new_label,
1976
extra_trees=extra_trees, using=using,
1979
extra_trees=extra_trees,
1980
path_encoding=path_encoding,
1977
1982
format_cls=format)
1987
1992
# level of effort but possibly much less IO. (Or possibly not,
1988
1993
# if the directories are very large...)
1989
1994
_see_also = ['status', 'ls']
1990
takes_options = ['show-ids']
1995
takes_options = ['directory', 'show-ids']
1992
1997
@display_command
1993
def run(self, show_ids=False):
1994
tree = WorkingTree.open_containing(u'.')[0]
1998
def run(self, show_ids=False, directory=u'.'):
1999
tree = WorkingTree.open_containing(directory)[0]
1995
2000
self.add_cleanup(tree.lock_read().unlock)
1996
2001
old = tree.basis_tree()
1997
2002
self.add_cleanup(old.lock_read().unlock)
2012
2017
_see_also = ['status', 'ls']
2015
help='Write an ascii NUL (\\0) separator '
2016
'between files rather than a newline.')
2018
takes_options = ['directory', 'null']
2019
2020
@display_command
2020
def run(self, null=False):
2021
tree = WorkingTree.open_containing(u'.')[0]
2021
def run(self, null=False, directory=u'.'):
2022
tree = WorkingTree.open_containing(directory)[0]
2022
2023
td = tree.changes_from(tree.basis_tree())
2023
2024
for path, id, kind, text_modified, meta_modified in td.modified:
2035
2036
_see_also = ['status', 'ls']
2038
help='Write an ascii NUL (\\0) separator '
2039
'between files rather than a newline.')
2037
takes_options = ['directory', 'null']
2042
2039
@display_command
2043
def run(self, null=False):
2044
wt = WorkingTree.open_containing(u'.')[0]
2040
def run(self, null=False, directory=u'.'):
2041
wt = WorkingTree.open_containing(directory)[0]
2045
2042
self.add_cleanup(wt.lock_read().unlock)
2046
2043
basis = wt.basis_tree()
2047
2044
self.add_cleanup(basis.lock_read().unlock)
2053
2050
if inv.is_root(file_id) and len(basis_inv) == 0:
2055
2052
path = inv.id2path(file_id)
2056
if not os.access(osutils.abspath(path), os.F_OK):
2053
if not os.access(osutils.pathjoin(wt.basedir, path), os.F_OK):
2059
2056
self.outf.write(path + '\0')
2259
2256
help='Show just the specified revision.'
2260
2257
' See also "help revisionspec".'),
2259
RegistryOption('authors',
2260
'What names to list as authors - first, all or committer.',
2262
lazy_registry=('bzrlib.log', 'author_list_registry'),
2262
2264
Option('levels',
2263
2265
short_name='n',
2264
2266
help='Number of levels to display - 0 for all, 1 for flat.',
2382
2385
show_timezone=timezone,
2383
2386
delta_format=get_verbosity_level(),
2385
show_advice=levels is None)
2388
show_advice=levels is None,
2389
author_list_handler=authors)
2387
2391
# Choose the algorithm for doing the logging. It's annoying
2388
2392
# having multiple code paths like this but necessary until
2505
2509
help='Recurse into subdirectories.'),
2506
2510
Option('from-root',
2507
2511
help='Print paths relative to the root of the branch.'),
2508
Option('unknown', help='Print unknown files.'),
2512
Option('unknown', short_name='u',
2513
help='Print unknown files.'),
2509
2514
Option('versioned', help='Print versioned files.',
2510
2515
short_name='V'),
2511
Option('ignored', help='Print ignored files.'),
2513
help='Write an ascii NUL (\\0) separator '
2514
'between files rather than a newline.'),
2516
Option('ignored', short_name='i',
2517
help='Print ignored files.'),
2518
Option('kind', short_name='k',
2516
2519
help='List entries of a particular kind: file, directory, symlink.',
2520
2525
@display_command
2521
2526
def run(self, revision=None, verbose=False,
2522
2527
recursive=False, from_root=False,
2523
2528
unknown=False, versioned=False, ignored=False,
2524
null=False, kind=None, show_ids=False, path=None):
2529
null=False, kind=None, show_ids=False, path=None, directory=None):
2526
2531
if kind and kind not in ('file', 'directory', 'symlink'):
2527
2532
raise errors.BzrCommandError('invalid kind specified')
2539
2544
raise errors.BzrCommandError('cannot specify both --from-root'
2542
tree, branch, relpath = bzrdir.BzrDir.open_containing_tree_or_branch(
2547
tree, branch, relpath = \
2548
_open_directory_or_containing_tree_or_branch(fs_path, directory)
2545
2550
# Calculate the prefix to use
2616
2621
_see_also = ['ls']
2622
takes_options = ['directory']
2618
2624
@display_command
2620
for f in WorkingTree.open_containing(u'.')[0].unknowns():
2625
def run(self, directory=u'.'):
2626
for f in WorkingTree.open_containing(directory)[0].unknowns():
2621
2627
self.outf.write(osutils.quotefn(f) + '\n')
2689
2695
_see_also = ['status', 'ignored', 'patterns']
2690
2696
takes_args = ['name_pattern*']
2697
takes_options = ['directory',
2692
2698
Option('default-rules',
2693
2699
help='Display the default ignore rules that bzr uses.')
2696
def run(self, name_pattern_list=None, default_rules=None):
2702
def run(self, name_pattern_list=None, default_rules=None,
2697
2704
from bzrlib import ignores
2698
2705
if default_rules is not None:
2699
2706
# dump the default rules and exit
2710
2717
(len(name_pattern) > 1 and name_pattern[1] == ':')):
2711
2718
raise errors.BzrCommandError(
2712
2719
"NAME_PATTERN should not be an absolute path")
2713
tree, relpath = WorkingTree.open_containing(u'.')
2720
tree, relpath = WorkingTree.open_containing(directory)
2714
2721
ignores.tree_ignores_add_patterns(tree, name_pattern_list)
2715
2722
ignored = globbing.Globster(name_pattern_list)
2724
self.add_cleanup(tree.lock_read().unlock)
2718
2725
for entry in tree.list_files():
2720
2727
if id is not None:
2721
2728
filename = entry[0]
2722
2729
if ignored.match(filename):
2723
2730
matches.append(filename)
2725
2731
if len(matches) > 0:
2726
2732
self.outf.write("Warning: the following files are version controlled and"
2727
2733
" match your ignore pattern:\n%s"
2743
2749
encoding_type = 'replace'
2744
2750
_see_also = ['ignore', 'ls']
2751
takes_options = ['directory']
2746
2753
@display_command
2748
tree = WorkingTree.open_containing(u'.')[0]
2754
def run(self, directory=u'.'):
2755
tree = WorkingTree.open_containing(directory)[0]
2749
2756
self.add_cleanup(tree.lock_read().unlock)
2750
2757
for path, file_class, kind, file_id, entry in tree.list_files():
2751
2758
if file_class != 'I':
2765
2772
takes_args = ['revno']
2773
takes_options = ['directory']
2767
2775
@display_command
2768
def run(self, revno):
2776
def run(self, revno, directory=u'.'):
2770
2778
revno = int(revno)
2771
2779
except ValueError:
2772
2780
raise errors.BzrCommandError("not a valid revision-number: %r"
2774
revid = WorkingTree.open_containing(u'.')[0].branch.get_rev_id(revno)
2782
revid = WorkingTree.open_containing(directory)[0].branch.get_rev_id(revno)
2775
2783
self.outf.write("%s\n" % revid)
2804
2812
================= =========================
2806
2814
takes_args = ['dest', 'branch_or_subdir?']
2815
takes_options = ['directory',
2808
2816
Option('format',
2809
2817
help="Type of file to export to.",
2819
2827
'revision in which it was changed.'),
2821
2829
def run(self, dest, branch_or_subdir=None, revision=None, format=None,
2822
root=None, filters=False, per_file_timestamps=False):
2830
root=None, filters=False, per_file_timestamps=False, directory=u'.'):
2823
2831
from bzrlib.export import export
2825
2833
if branch_or_subdir is None:
2826
tree = WorkingTree.open_containing(u'.')[0]
2834
tree = WorkingTree.open_containing(directory)[0]
2827
2835
b = tree.branch
2850
2858
_see_also = ['ls']
2859
takes_options = ['directory',
2852
2860
Option('name-from-revision', help='The path name in the old tree.'),
2853
2861
Option('filters', help='Apply content filters to display the '
2854
2862
'convenience form.'),
2860
2868
@display_command
2861
2869
def run(self, filename, revision=None, name_from_revision=False,
2870
filters=False, directory=None):
2863
2871
if revision is not None and len(revision) != 1:
2864
2872
raise errors.BzrCommandError("bzr cat --revision takes exactly"
2865
2873
" one revision specifier")
2866
2874
tree, branch, relpath = \
2867
bzrdir.BzrDir.open_containing_tree_or_branch(filename)
2875
_open_directory_or_containing_tree_or_branch(filename, directory)
2868
2876
self.add_cleanup(branch.lock_read().unlock)
2869
2877
return self._run(tree, branch, relpath, filename, revision,
2870
2878
name_from_revision, filters)
3142
3150
def get_message(commit_obj):
3143
3151
"""Callback to get commit message"""
3145
my_message = codecs.open(
3146
file, 'rt', osutils.get_user_encoding()).read()
3153
f = codecs.open(file, 'rt', osutils.get_user_encoding())
3155
my_message = f.read()
3147
3158
elif message is not None:
3148
3159
my_message = message
3304
3315
bzr whoami "Frank Chu <fchu@example.com>"
3306
takes_options = [ Option('email',
3317
takes_options = [ 'directory',
3307
3319
help='Display email address only.'),
3308
3320
Option('branch',
3309
3321
help='Set identity for the current branch instead of '
3313
3325
encoding_type = 'replace'
3315
3327
@display_command
3316
def run(self, email=False, branch=False, name=None):
3328
def run(self, email=False, branch=False, name=None, directory=None):
3317
3329
if name is None:
3318
# use branch if we're inside one; otherwise global config
3320
c = Branch.open_containing('.')[0].get_config()
3321
except errors.NotBranchError:
3322
c = config.GlobalConfig()
3330
if directory is None:
3331
# use branch if we're inside one; otherwise global config
3333
c = Branch.open_containing(u'.')[0].get_config()
3334
except errors.NotBranchError:
3335
c = config.GlobalConfig()
3337
c = Branch.open(directory).get_config()
3324
3339
self.outf.write(c.user_email() + '\n')
3336
3351
# use global config unless --branch given
3338
c = Branch.open_containing('.')[0].get_config()
3353
if directory is None:
3354
c = Branch.open_containing(u'.')[0].get_config()
3356
c = Branch.open(directory).get_config()
3340
3358
c = config.GlobalConfig()
3341
3359
c.set_user_option('email', name)
3354
3372
_see_also = ['info']
3355
3373
takes_args = ['nickname?']
3356
def run(self, nickname=None):
3357
branch = Branch.open_containing(u'.')[0]
3374
takes_options = ['directory']
3375
def run(self, nickname=None, directory=u'.'):
3376
branch = Branch.open_containing(directory)[0]
3358
3377
if nickname is None:
3359
3378
self.printme(branch)
3585
3604
self.additional_selftest_args['runner_class'] = SubUnitBzrRunner
3586
3605
# On Windows, disable automatic conversion of '\n' to '\r\n' in
3587
3606
# stdout, which would corrupt the subunit stream.
3588
if sys.platform == "win32" and sys.stdout.fileno() >= 0:
3607
# FIXME: This has been fixed in subunit trunk (>0.0.5) so the
3608
# following code can be deleted when it's sufficiently deployed
3609
# -- vila/mgz 20100514
3610
if (sys.platform == "win32"
3611
and getattr(sys.stdout, 'fileno', None) is not None):
3590
3613
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
3764
3787
' completely merged into the source, pull from the'
3765
3788
' source rather than merging. When this happens,'
3766
3789
' you do not need to commit the result.'),
3790
custom_help('directory',
3768
3791
help='Branch to merge into, '
3769
'rather than the one containing the working directory.',
3792
'rather than the one containing the working directory.'),
3773
3793
Option('preview', help='Instead of merging, show a diff of the'
3775
3795
Option('interactive', help='Select changes interactively.',
3875
3895
def _do_preview(self, merger):
3876
3896
from bzrlib.diff import show_diff_trees
3877
3897
result_tree = self._get_preview(merger)
3898
path_encoding = osutils.get_diff_header_encoding()
3878
3899
show_diff_trees(merger.this_tree, result_tree, self.outf,
3879
old_label='', new_label='')
3900
old_label='', new_label='',
3901
path_encoding=path_encoding)
3881
3903
def _do_merge(self, merger, change_reporter, allow_pending, verified):
3882
3904
merger.change_reporter = change_reporter
4281
4303
_see_also = ['merge', 'pull']
4282
4304
takes_args = ['other_branch?']
4283
4305
takes_options = [
4284
4307
Option('reverse', 'Reverse the order of revisions.'),
4285
4308
Option('mine-only',
4286
4309
'Display changes in the local branch only.'),
4308
4331
theirs_only=False,
4309
4332
log_format=None, long=False, short=False, line=False,
4310
4333
show_ids=False, verbose=False, this=False, other=False,
4311
include_merges=False, revision=None, my_revision=None):
4334
include_merges=False, revision=None, my_revision=None,
4312
4336
from bzrlib.missing import find_unmerged, iter_log_revisions
4313
4337
def message(s):
4314
4338
if not is_quiet():
4542
4566
Option('long', help='Show commit date in annotations.'),
4546
4571
encoding_type = 'exact'
4548
4573
@display_command
4549
4574
def run(self, filename, all=False, long=False, revision=None,
4575
show_ids=False, directory=None):
4551
4576
from bzrlib.annotate import annotate_file, annotate_file_tree
4552
4577
wt, branch, relpath = \
4553
bzrdir.BzrDir.open_containing_tree_or_branch(filename)
4578
_open_directory_or_containing_tree_or_branch(filename, directory)
4554
4579
if wt is not None:
4555
4580
self.add_cleanup(wt.lock_read().unlock)
4581
4606
hidden = True # is this right ?
4582
4607
takes_args = ['revision_id*']
4583
takes_options = ['revision']
4608
takes_options = ['directory', 'revision']
4585
def run(self, revision_id_list=None, revision=None):
4610
def run(self, revision_id_list=None, revision=None, directory=u'.'):
4586
4611
if revision_id_list is not None and revision is not None:
4587
4612
raise errors.BzrCommandError('You can only supply one of revision_id or --revision')
4588
4613
if revision_id_list is None and revision is None:
4589
4614
raise errors.BzrCommandError('You must supply either --revision or a revision_id')
4590
b = WorkingTree.open_containing(u'.')[0].branch
4615
b = WorkingTree.open_containing(directory)[0].branch
4591
4616
self.add_cleanup(b.lock_write().unlock)
4592
4617
return self._run(b, revision_id_list, revision)
4654
4679
_see_also = ['checkouts', 'unbind']
4655
4680
takes_args = ['location?']
4681
takes_options = ['directory']
4658
def run(self, location=None):
4659
b, relpath = Branch.open_containing(u'.')
4683
def run(self, location=None, directory=u'.'):
4684
b, relpath = Branch.open_containing(directory)
4660
4685
if location is None:
4662
4687
location = b.get_old_bound_location()
4690
4715
_see_also = ['checkouts', 'bind']
4691
4716
takes_args = []
4717
takes_options = ['directory']
4695
b, relpath = Branch.open_containing(u'.')
4719
def run(self, directory=u'.'):
4720
b, relpath = Branch.open_containing(directory)
4696
4721
if not b.unbind():
4697
4722
raise errors.BzrCommandError('Local branch is not bound')
4860
4885
'result in a dynamically allocated port. The default port '
4861
4886
'depends on the protocol.',
4864
help='Serve contents of this directory.',
4888
custom_help('directory',
4889
help='Serve contents of this directory.'),
4866
4890
Option('allow-writes',
4867
4891
help='By default the server is a readonly server. Supplying '
4868
4892
'--allow-writes enables write access to the contents of '
4896
4920
def run(self, port=None, inet=False, directory=None, allow_writes=False,
4897
4921
protocol=None):
4898
from bzrlib.transport import get_transport, transport_server_registry
4922
from bzrlib import transport
4899
4923
if directory is None:
4900
4924
directory = os.getcwd()
4901
4925
if protocol is None:
4902
protocol = transport_server_registry.get()
4926
protocol = transport.transport_server_registry.get()
4903
4927
host, port = self.get_host_and_port(port)
4904
4928
url = urlutils.local_path_to_url(directory)
4905
4929
if not allow_writes:
4906
4930
url = 'readonly+' + url
4907
transport = get_transport(url)
4908
protocol(transport, host, port, inet)
4931
t = transport.get_transport(url)
4932
protocol(t, host, port, inet)
4911
4935
class cmd_join(Command):
5022
5047
encoding_type = 'exact'
5024
5049
def run(self, submit_branch=None, public_branch=None, patch_type='bundle',
5025
sign=False, revision=None, mail_to=None, message=None):
5050
sign=False, revision=None, mail_to=None, message=None,
5026
5052
from bzrlib.revision import ensure_null, NULL_REVISION
5027
5053
include_patch, include_bundle = {
5028
5054
'plain': (False, False),
5029
5055
'diff': (True, False),
5030
5056
'bundle': (True, True),
5032
branch = Branch.open('.')
5058
branch = Branch.open(directory)
5033
5059
stored_submit_branch = branch.get_submit_branch()
5034
5060
if submit_branch is None:
5035
5061
submit_branch = stored_submit_branch
5120
5146
given, in which case it is sent to a file.
5122
5148
Mail is sent using your preferred mail program. This should be transparent
5123
on Windows (it uses MAPI). On Linux, it requires the xdg-email utility.
5149
on Windows (it uses MAPI). On Unix, it requires the xdg-email utility.
5124
5150
If the preferred client can't be found (or used), your editor will be used.
5126
5152
To use a specific mail program, set the mail_client configuration option.
5297
5323
Option('delete',
5298
5324
help='Delete this tag rather than placing it.',
5301
help='Branch in which to place the tag.',
5326
custom_help('directory',
5327
help='Branch in which to place the tag.'),
5305
5328
Option('force',
5306
5329
help='Replace existing tags.',
5350
5373
_see_also = ['tag']
5351
5374
takes_options = [
5353
help='Branch whose tags should be displayed.',
5375
custom_help('directory',
5376
help='Branch whose tags should be displayed.'),
5357
5377
RegistryOption.from_kwargs('sort',
5358
5378
'Sort tags by different criteria.', title='Sorting',
5359
5379
alpha='Sort tags lexicographically (default).',
5531
5551
takes_args = ['to_location?']
5532
takes_options = [Option('force',
5552
takes_options = ['directory',
5533
5554
help='Switch even if local commits will be lost.'),
5535
5556
Option('create-branch', short_name='b',
5540
5561
def run(self, to_location=None, force=False, create_branch=False,
5562
revision=None, directory=u'.'):
5542
5563
from bzrlib import switch
5564
tree_location = directory
5544
5565
revision = _get_one_revision('switch', revision)
5545
5566
control_dir = bzrdir.BzrDir.open_containing(tree_location)[0]
5546
5567
if to_location is None:
5547
5568
if revision is None:
5548
5569
raise errors.BzrCommandError('You must supply either a'
5549
5570
' revision or a location')
5571
to_location = tree_location
5552
5573
branch = control_dir.open_branch()
5553
5574
had_explicit_nick = branch.get_config().has_explicit_nickname()
5842
5864
_see_also = ['unshelve']
5844
5866
def run(self, revision=None, all=False, file_list=None, message=None,
5845
writer=None, list=False, destroy=False):
5867
writer=None, list=False, destroy=False, directory=u'.'):
5847
5869
return self.run_for_list()
5848
5870
from bzrlib.shelf_ui import Shelver
5850
5872
writer = bzrlib.option.diff_writer_registry.get()
5852
5874
shelver = Shelver.from_args(writer(sys.stdout), revision, all,
5853
file_list, message, destroy=destroy)
5875
file_list, message, destroy=destroy, directory=directory)
5885
5907
takes_args = ['shelf_id?']
5886
5908
takes_options = [
5887
5910
RegistryOption.from_kwargs(
5888
5911
'action', help="The action to perform.",
5889
5912
enum_switch=False, value_switches=True,
5898
5921
_see_also = ['shelve']
5900
def run(self, shelf_id=None, action='apply'):
5923
def run(self, shelf_id=None, action='apply', directory=u'.'):
5901
5924
from bzrlib.shelf_ui import Unshelver
5902
unshelver = Unshelver.from_args(shelf_id, action)
5925
unshelver = Unshelver.from_args(shelf_id, action, directory=directory)
5904
5927
unshelver.run()
5922
5945
To check what clean-tree will do, use --dry-run.
5924
takes_options = [Option('ignored', help='Delete all ignored files.'),
5947
takes_options = ['directory',
5948
Option('ignored', help='Delete all ignored files.'),
5925
5949
Option('detritus', help='Delete conflict files, merge'
5926
5950
' backups, and failed selftest dirs.'),
5927
5951
Option('unknown',
5930
5954
' deleting them.'),
5931
5955
Option('force', help='Do not prompt before deleting.')]
5932
5956
def run(self, unknown=False, ignored=False, detritus=False, dry_run=False,
5957
force=False, directory=u'.'):
5934
5958
from bzrlib.clean_tree import clean_tree
5935
5959
if not (unknown or ignored or detritus):
5939
clean_tree('.', unknown=unknown, ignored=ignored, detritus=detritus,
5940
dry_run=dry_run, no_prompt=force)
5963
clean_tree(directory, unknown=unknown, ignored=ignored,
5964
detritus=detritus, dry_run=dry_run, no_prompt=force)
5943
5967
class cmd_reference(Command):