75
67
help='Delete files unknown to bzr (default).'),
76
68
Option('dry-run', help='Show files to delete instead of'
78
def run(self, unknown=False, ignored=False, detritus=False, dry_run=False):
70
Option('force', help='Do not prompt before deleting.')]
71
def run(self, unknown=False, ignored=False, detritus=False, dry_run=False,
79
73
from clean_tree import clean_tree
80
74
if not (unknown or ignored or detritus):
82
78
clean_tree('.', unknown=unknown, ignored=ignored, detritus=detritus,
79
dry_run=dry_run, no_prompt=force)
86
82
class cmd_graph_ancestry(BzrToolsCommand):
178
174
return patch(wt, filename, strip, silent)
181
class cmd_shelve(BzrToolsCommand):
177
class cmd_shelve1(BzrToolsCommand):
182
178
"""Temporarily set aside some changes from the current tree.
184
180
Shelve allows you to temporarily put changes you've made "on the shelf",
185
181
ie. out of the way, until a later time when you can bring them back from
186
the shelf with the 'unshelve' command.
182
the shelf with the 'unshelve1' command.
188
184
Shelve is intended to help separate several sets of text changes that have
189
185
been inappropriately mingled. If you just want to get rid of all changes
190
186
(text and otherwise) and you don't need to restore them later, use revert.
191
If you want to shelve all text changes at once, use shelve --all.
187
If you want to shelve all text changes at once, use shelve1 --all.
193
By default shelve asks you what you want to shelve, press '?' at the
194
prompt to get help. To shelve everything run shelve --all.
189
By default shelve1 asks you what you want to shelve, press '?' at the
190
prompt to get help. To shelve everything run shelve1 --all.
196
192
If filenames are specified, only the changes to those files will be
197
193
shelved, other files will be left untouched.
199
195
If a revision is specified, changes since that revision will be shelved.
201
197
You can put multiple items on the shelf. Normally each time you run
202
unshelve the most recently shelved changes will be reinstated. However,
198
unshelve1 the most recently shelved changes will be reinstated. However,
203
199
you can also unshelve changes in a different order by explicitly
204
specifiying which changes to unshelve. This works best when the changes
200
specifiying which changes to unshelve1. This works best when the changes
205
201
don't depend on each other.
207
203
While you have patches on the shelf you can view and manipulate them with
208
204
the 'shelf' command. Run 'bzr shelf -h' for more info.
211
208
takes_args = ['file*']
212
209
takes_options = [Option('message',
213
210
help='A message to associate with the shelved changes.',
440
438
takes_options = [Option("lightweight",
441
help="Create a lightweight checkout."), 'revision']
439
help="Create a lightweight checkout."), 'revision',
440
Option('files-from', type=unicode,
441
help='Accelerate checkout using files from this'
444
help='Hard-link files from source/files-from tree'
442
446
takes_args = ["source", "target?"]
443
def run(self, source, target=None, lightweight=False, revision=None):
447
def run(self, source, target=None, lightweight=False, revision=None,
448
files_from=None, hardlink=False):
444
449
from cbranch import cbranch
445
450
return cbranch(source, target, lightweight=lightweight,
451
revision=revision, files_from=files_from,
449
455
class cmd_branches(BzrToolsCommand):
453
459
from branches import branches
454
460
return branches(location)
462
class cmd_trees(BzrToolsCommand):
463
"""Scan a location for trees"""
464
takes_args = ['location?']
465
def run(self, location='.'):
466
from bzrlib.workingtree import WorkingTree
467
from bzrlib.transport import get_transport
468
t = get_transport(location)
469
for tree in WorkingTree.find_trees(location):
470
self.outf.write('%s\n' % t.relpath(
471
tree.bzrdir.root_transport.base))
457
473
class cmd_multi_pull(BzrToolsCommand):
458
474
"""Pull all the branches under a location, e.g. a repository.
528
545
colordiff(check_style, *args, **kwargs)
531
class cmd_baz_import(BzrToolsCommand):
532
"""Import an Arch or Baz archive into a bzr repository.
534
This command should be used on local archives (or mirrors) only. It is
535
quite slow on remote archives.
537
reuse_history allows you to specify any previous imports you
538
have done of different archives, which this archive has branches
539
tagged from. This will dramatically reduce the time to convert
540
the archive as it will not have to convert the history already
541
converted in that other branch.
543
If you specify prefixes, only branches whose names start with that prefix
544
will be imported. Skipped branches will be listed, so you can import any
545
branches you missed by accident. Here's an example of doing a partial
546
import from thelove@canonical.com:
547
bzr baz-import thelove thelove@canonical.com --prefixes dists:talloc-except
549
WARNING: Encoding should not be specified unless necessary, because if you
550
specify an encoding, your converted branch will not interoperate with
551
independently-converted branches, unless the other branches were converted
552
with exactly the same encoding. Any encoding recognized by Python may
553
be specified. Aliases are not detected, so 'utf_8', 'U8', 'UTF' and 'utf8'
556
takes_args = ['to_root_dir', 'from_archive', 'reuse_history*']
557
takes_options = ['verbose', Option('prefixes', type=str,
558
help="Prefixes of branches to import, colon-separated."),
559
Option('encoding', type=str,
560
help='Force encoding to specified value. See WARNING.')]
562
def run(self, to_root_dir, from_archive, encoding=None, verbose=False,
563
reuse_history_list=[], prefixes=None):
564
from errors import NoPyBaz
567
baz_import.baz_import(to_root_dir, from_archive, encoding,
568
verbose, reuse_history_list, prefixes)
570
print "This command is disabled. Please install PyBaz."
573
class cmd_baz_import_branch(BzrToolsCommand):
574
"""Import an Arch or Baz branch into a bzr branch.
576
WARNING: Encoding should not be specified unless necessary, because if you
577
specify an encoding, your converted branch will not interoperate with
578
independently-converted branches, unless the other branches were converted
579
with exactly the same encoding. Any encoding recognized by Python may
580
be specified. Aliases are not detected, so 'utf_8', 'U8', 'UTF' and 'utf8'
583
takes_args = ['to_location', 'from_branch?', 'reuse_history*']
584
takes_options = ['verbose',
585
Option('max-count', type=int,
586
help='Maximim revisions to import at once.'),
587
Option('encoding', type=str,
588
help='Force encoding to specified value. See WARNING.')]
590
def run(self, to_location, from_branch=None, fast=False, max_count=None,
591
encoding=None, verbose=False, dry_run=False,
592
reuse_history_list=[]):
593
from errors import NoPyBaz
596
baz_import.baz_import_branch(to_location, from_branch, fast,
597
max_count, verbose, encoding, dry_run,
600
print "This command is disabled. Please install PyBaz."
603
548
class cmd_rspush(BzrToolsCommand):
604
549
"""Upload this branch to another location using rsync.
633
599
cmd_fetch_ghosts,
634
600
cmd_graph_ancestry,
647
if hasattr(bzrlib.commands, 'register_command'):
648
for command in commands:
649
bzrlib.commands.register_command(command)
653
from bzrlib.tests.TestUtil import TestLoader
655
from doctest import DocTestSuite, ELLIPSIS
656
from unittest import TestSuite
658
import tests.clean_tree
659
import tests.is_clean
660
import tests.test_rspush
661
import tests.upstream_import
663
import tests.blackbox
664
import tests.shelf_tests
666
result.addTest(DocTestSuite(bzrtools, optionflags=ELLIPSIS))
667
result.addTest(tests.clean_tree.test_suite())
670
result.addTest(DocTestSuite(baz_import))
673
result.addTest(tests.test_suite())
674
result.addTest(TestLoader().loadTestsFromModule(tests.shelf_tests))
675
result.addTest(tests.blackbox.test_suite())
676
result.addTest(tests.upstream_import.test_suite())
677
result.addTest(zap.test_suite())
678
result.addTest(TestLoader().loadTestsFromModule(tests.is_clean))
679
result.addTest(TestLoader().loadTestsFromModule(tests.test_rspush))