~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2007-12-20 20:44:45 UTC
  • mto: This revision was merged to the branch mainline in revision 3235.
  • Revision ID: abentley@panoramicfeedback.com-20071220204445-9o2f10gvvd8e4rks
Implement hard-link support for branch and checkout

Show diffs side-by-side

added added

removed removed

Lines of Context:
863
863
 
864
864
    _see_also = ['checkout']
865
865
    takes_args = ['from_location', 'to_location?']
866
 
    takes_options = ['revision']
 
866
    takes_options = ['revision', Option('hardlink',
 
867
        help='Hard-link working tree files where possible.')]
867
868
    aliases = ['get', 'clone']
868
869
 
869
 
    def run(self, from_location, to_location=None, revision=None):
 
870
    def run(self, from_location, to_location=None, revision=None,
 
871
            hardlink=False):
870
872
        from bzrlib.tag import _merge_tags_if_possible
871
873
        if revision is None:
872
874
            revision = [None]
904
906
                # preserve whatever source format we have.
905
907
                dir = br_from.bzrdir.sprout(to_transport.base, revision_id,
906
908
                                            possible_transports=[to_transport],
907
 
                                            accelerator_tree=accelerator_tree)
 
909
                                            accelerator_tree=accelerator_tree,
 
910
                                            hardlink=hardlink)
908
911
                branch = dir.open_branch()
909
912
            except errors.NoSuchRevision:
910
913
                to_transport.delete_tree('.')
949
952
                                 "common operations like diff and status without "
950
953
                                 "such access, and also support local commits."
951
954
                            ),
952
 
                     Option('files-from',
953
 
                            help="Get file contents from this tree.", type=str)
 
955
                     Option('files-from', type=str,
 
956
                            help="Get file contents from this tree."),
 
957
                     Option('hardlink',
 
958
                            help='Hard-link working tree files where possible.'
 
959
                            ),
954
960
                     ]
955
961
    aliases = ['co']
956
962
 
957
963
    def run(self, branch_location=None, to_location=None, revision=None,
958
 
            lightweight=False, files_from=None):
 
964
            lightweight=False, files_from=None, hardlink=False):
959
965
        if files_from is not None:
960
966
            accelerator_tree = WorkingTree.open(files_from)
961
967
        else:
987
993
                source.bzrdir.create_workingtree(revision_id)
988
994
                return
989
995
        source.create_checkout(to_location, revision_id, lightweight,
990
 
                               accelerator_tree)
 
996
                               accelerator_tree, hardlink)
991
997
 
992
998
 
993
999
class cmd_renames(Command):