441
441
help="Create a lightweight checkout."), 'revision',
442
442
Option('files-from', type=unicode,
443
443
help='Accelerate checkout using files from this'
446
help='Hard-link files from source/files-from tree'
448
445
takes_args = ["source", "target?"]
449
446
def run(self, source, target=None, lightweight=False, revision=None,
450
files_from=None, hardlink=False):
451
448
from cbranch import cbranch
452
449
return cbranch(source, target, lightweight=lightweight,
453
revision=revision, files_from=files_from,
450
revision=revision, files_from=files_from)
457
453
class cmd_branches(BzrToolsCommand):
547
543
colordiff(check_style, *args, **kwargs)
546
class cmd_baz_import(BzrToolsCommand):
547
"""Import an Arch or Baz archive into a bzr repository.
549
This command should be used on local archives (or mirrors) only. It is
550
quite slow on remote archives.
552
reuse_history allows you to specify any previous imports you
553
have done of different archives, which this archive has branches
554
tagged from. This will dramatically reduce the time to convert
555
the archive as it will not have to convert the history already
556
converted in that other branch.
558
If you specify prefixes, only branches whose names start with that prefix
559
will be imported. Skipped branches will be listed, so you can import any
560
branches you missed by accident. Here's an example of doing a partial
561
import from thelove@canonical.com:
562
bzr baz-import thelove thelove@canonical.com --prefixes dists:talloc-except
564
WARNING: Encoding should not be specified unless necessary, because if you
565
specify an encoding, your converted branch will not interoperate with
566
independently-converted branches, unless the other branches were converted
567
with exactly the same encoding. Any encoding recognized by Python may
568
be specified. Aliases are not detected, so 'utf_8', 'U8', 'UTF' and 'utf8'
571
takes_args = ['to_root_dir', 'from_archive', 'reuse_history*']
572
takes_options = ['verbose', Option('prefixes', type=str,
573
help="Prefixes of branches to import, colon-separated."),
574
Option('encoding', type=str,
575
help='Force encoding to specified value. See WARNING.')]
577
def run(self, to_root_dir, from_archive, encoding=None, verbose=False,
578
reuse_history_list=[], prefixes=None):
579
from errors import NoPyBaz
582
baz_import.baz_import(to_root_dir, from_archive, encoding,
583
verbose, reuse_history_list, prefixes)
585
print "This command is disabled. Please install PyBaz."
588
class cmd_baz_import_branch(BzrToolsCommand):
589
"""Import an Arch or Baz branch into a bzr branch.
591
WARNING: Encoding should not be specified unless necessary, because if you
592
specify an encoding, your converted branch will not interoperate with
593
independently-converted branches, unless the other branches were converted
594
with exactly the same encoding. Any encoding recognized by Python may
595
be specified. Aliases are not detected, so 'utf_8', 'U8', 'UTF' and 'utf8'
598
takes_args = ['to_location', 'from_branch?', 'reuse_history*']
599
takes_options = ['verbose',
600
Option('max-count', type=int,
601
help='Maximim revisions to import at once.'),
602
Option('encoding', type=str,
603
help='Force encoding to specified value. See WARNING.')]
605
def run(self, to_location, from_branch=None, fast=False, max_count=None,
606
encoding=None, verbose=False, dry_run=False,
607
reuse_history_list=[]):
608
from errors import NoPyBaz
611
baz_import.baz_import_branch(to_location, from_branch, fast,
612
max_count, verbose, encoding, dry_run,
615
print "This command is disabled. Please install PyBaz."
550
618
class cmd_rspush(BzrToolsCommand):
551
619
"""Upload this branch to another location using rsync.
640
681
result = TestSuite()
641
682
result.addTest(DocTestSuite(bzrtools, optionflags=ELLIPSIS))
642
683
result.addTest(tests.clean_tree.test_suite())
686
result.addTest(DocTestSuite(baz_import))
643
689
result.addTest(tests.test_suite())
644
690
result.addTest(TestLoader().loadTestsFromModule(tests.shelf_tests))
645
691
result.addTest(tests.blackbox.test_suite())
646
692
result.addTest(tests.upstream_import.test_suite())
647
693
result.addTest(zap.test_suite())
648
result.addTest(TestLoader().loadTestsFromModule(tests.test_dotgraph))
649
694
result.addTest(TestLoader().loadTestsFromModule(tests.is_clean))
650
result.addTest(TestLoader().loadTestsFromModule(tests.test_link_tree))
651
result.addTest(TestLoader().loadTestsFromModule(tests.test_patch))
652
695
result.addTest(TestLoader().loadTestsFromModule(tests.test_rspush))
653
result.addTest(TestLoader().loadTestsFromModule(tests.test_cbranch))