~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.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:
382
382
        return bzrdir.create_workingtree()
383
383
 
384
384
    def create_workingtree(self, revision_id=None, from_branch=None,
385
 
        accelerator_tree=None):
 
385
        accelerator_tree=None, hardlink=False):
386
386
        """Create a working tree at this BzrDir.
387
387
        
388
388
        :param revision_id: create it as of this revision id.
816
816
 
817
817
    def sprout(self, url, revision_id=None, force_new_repo=False,
818
818
               recurse='down', possible_transports=None,
819
 
               accelerator_tree=None):
 
819
               accelerator_tree=None, hardlink=False):
820
820
        """Create a copy of this bzrdir prepared for use as a new line of
821
821
        development.
822
822
 
833
833
            contents more quickly than the revision tree, i.e. a workingtree.
834
834
            The revision tree will be used for cases where accelerator_tree's
835
835
            content is different.
 
836
        :param hardlink: If true, hard-link files from accelerator_tree,
 
837
            where possible.
836
838
        """
837
839
        target_transport = get_transport(url, possible_transports)
838
840
        target_transport.ensure_base()
877
879
            result.create_branch()
878
880
        if isinstance(target_transport, LocalTransport) and (
879
881
            result_repo is None or result_repo.make_working_trees()):
880
 
            wt = result.create_workingtree(accelerator_tree=accelerator_tree)
 
882
            wt = result.create_workingtree(accelerator_tree=accelerator_tree,
 
883
                hardlink=hardlink)
881
884
            wt.lock_write()
882
885
            try:
883
886
                if wt.path2id('') is None:
972
975
        raise errors.UnsupportedOperation(self.destroy_repository, self)
973
976
 
974
977
    def create_workingtree(self, revision_id=None, from_branch=None,
975
 
                           accelerator_tree=None):
 
978
                           accelerator_tree=None, hardlink=False):
976
979
        """See BzrDir.create_workingtree."""
977
980
        # this looks buggy but is not -really-
978
981
        # because this format creates the workingtree when the bzrdir is
1046
1049
        return format.open(self, _found=True)
1047
1050
 
1048
1051
    def sprout(self, url, revision_id=None, force_new_repo=False,
1049
 
               possible_transports=None, accelerator_tree=None):
 
1052
               possible_transports=None, accelerator_tree=None,
 
1053
               hardlink=False):
1050
1054
        """See BzrDir.sprout()."""
1051
1055
        from bzrlib.workingtree import WorkingTreeFormat2
1052
1056
        self._make_tail(url)
1061
1065
            pass
1062
1066
        # we always want a working tree
1063
1067
        WorkingTreeFormat2().initialize(result,
1064
 
                                        accelerator_tree=accelerator_tree)
 
1068
                                        accelerator_tree=accelerator_tree,
 
1069
                                        hardlink=hardlink)
1065
1070
        return result
1066
1071
 
1067
1072
 
1156
1161
        self.transport.delete_tree('repository')
1157
1162
 
1158
1163
    def create_workingtree(self, revision_id=None, from_branch=None,
1159
 
                           accelerator_tree=None):
 
1164
                           accelerator_tree=None, hardlink=False):
1160
1165
        """See BzrDir.create_workingtree."""
1161
1166
        return self._format.workingtree_format.initialize(
1162
1167
            self, revision_id, from_branch=from_branch,
1163
 
            accelerator_tree=accelerator_tree)
 
1168
            accelerator_tree=accelerator_tree, hardlink=hardlink)
1164
1169
 
1165
1170
    def destroy_workingtree(self):
1166
1171
        """See BzrDir.destroy_workingtree."""