~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
874
874
            raise errors.BzrCommandError(
875
875
                'bzr branch --revision takes exactly 1 revision value')
876
876
 
877
 
        br_from = Branch.open(from_location)
 
877
        accelerator_tree, br_from = bzrdir.BzrDir.open_tree_or_branch(
 
878
            from_location)
878
879
        br_from.lock_read()
879
880
        try:
880
881
            if len(revision) == 1 and revision[0] is not None:
902
903
            try:
903
904
                # preserve whatever source format we have.
904
905
                dir = br_from.bzrdir.sprout(to_transport.base, revision_id,
905
 
                                            possible_transports=[to_transport])
 
906
                                            possible_transports=[to_transport],
 
907
                                            accelerator_tree=accelerator_tree)
906
908
                branch = dir.open_branch()
907
909
            except errors.NoSuchRevision:
908
910
                to_transport.delete_tree('.')
947
949
                                 "common operations like diff and status without "
948
950
                                 "such access, and also support local commits."
949
951
                            ),
 
952
                     Option('files-from',
 
953
                            help="Get file contents from this tree.", type=str)
950
954
                     ]
951
955
    aliases = ['co']
952
956
 
953
957
    def run(self, branch_location=None, to_location=None, revision=None,
954
 
            lightweight=False):
 
958
            lightweight=False, files_from=None):
 
959
        if files_from is not None:
 
960
            accelerator_tree = WorkingTree.open(files_from)
 
961
        else:
 
962
            accelerator_tree = None
955
963
        if revision is None:
956
964
            revision = [None]
957
965
        elif len(revision) > 1:
978
986
            except errors.NoWorkingTree:
979
987
                source.bzrdir.create_workingtree(revision_id)
980
988
                return
981
 
        source.create_checkout(to_location, revision_id, lightweight)
 
989
        source.create_checkout(to_location, revision_id, lightweight,
 
990
                               accelerator_tree)
982
991
 
983
992
 
984
993
class cmd_renames(Command):
3709
3718
        ]
3710
3719
 
3711
3720
    def run(self, port=None, inet=False, directory=None, allow_writes=False):
 
3721
        from bzrlib import lockdir
3712
3722
        from bzrlib.smart import medium, server
3713
3723
        from bzrlib.transport import get_transport
3714
3724
        from bzrlib.transport.chroot import ChrootServer
3739
3749
        # be changed with care though, as we dont want to use bandwidth sending
3740
3750
        # progress over stderr to smart server clients!
3741
3751
        old_factory = ui.ui_factory
 
3752
        old_lockdir_timeout = lockdir._DEFAULT_TIMEOUT_SECONDS
3742
3753
        try:
3743
3754
            ui.ui_factory = ui.SilentUIFactory()
 
3755
            lockdir._DEFAULT_TIMEOUT_SECONDS = 0
3744
3756
            smart_server.serve()
3745
3757
        finally:
3746
3758
            ui.ui_factory = old_factory
 
3759
            lockdir._DEFAULT_TIMEOUT_SECONDS = old_lockdir_timeout
3747
3760
 
3748
3761
 
3749
3762
class cmd_join(Command):