~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

Merge updated set_parents api.

Show diffs side-by-side

added added

removed removed

Lines of Context:
615
615
                # XXX FIXME RBC 20060214 need tests for this when the basis
616
616
                # is incomplete
617
617
                result_repo.fetch(basis_repo, revision_id=revision_id)
618
 
            result_repo.fetch(source_repository, revision_id=revision_id)
 
618
            if source_repository is not None:
 
619
                result_repo.fetch(source_repository, revision_id=revision_id)
619
620
        if source_branch is not None:
620
621
            source_branch.sprout(result, revision_id=revision_id)
621
622
        else:
733
734
        self._check_supported(format, unsupported)
734
735
        return format.open(self, _found=True)
735
736
 
736
 
    def sprout(self, url, revision_id=None, basis=None):
 
737
    def sprout(self, url, revision_id=None, basis=None, force_new_repo=False):
737
738
        """See BzrDir.sprout()."""
738
739
        from bzrlib.workingtree import WorkingTreeFormat2
739
740
        self._make_tail(url)
1217
1218
        result = (super(BzrDirFormat5, self).initialize_on_transport(transport))
1218
1219
        RepositoryFormat5().initialize(result, _internal=True)
1219
1220
        if not _cloning:
1220
 
            BzrBranchFormat4().initialize(result)
1221
 
            WorkingTreeFormat2().initialize(result)
 
1221
            branch = BzrBranchFormat4().initialize(result)
 
1222
            try:
 
1223
                WorkingTreeFormat2().initialize(result)
 
1224
            except errors.NotLocalUrl:
 
1225
                # Even though we can't access the working tree, we need to
 
1226
                # create its control files.
 
1227
                WorkingTreeFormat2().stub_initialize_remote(branch.control_files)
1222
1228
        return result
1223
1229
 
1224
1230
    def _open(self, transport):
1271
1277
        result = super(BzrDirFormat6, self).initialize_on_transport(transport)
1272
1278
        RepositoryFormat6().initialize(result, _internal=True)
1273
1279
        if not _cloning:
1274
 
            BzrBranchFormat4().initialize(result)
 
1280
            branch = BzrBranchFormat4().initialize(result)
1275
1281
            try:
1276
1282
                WorkingTreeFormat2().initialize(result)
1277
1283
            except errors.NotLocalUrl:
1278
 
                # emulate pre-check behaviour for working tree and silently 
1279
 
                # fail.
1280
 
                pass
 
1284
                # Even though we can't access the working tree, we need to
 
1285
                # create its control files.
 
1286
                WorkingTreeFormat2().stub_initialize_remote(branch.control_files)
1281
1287
        return result
1282
1288
 
1283
1289
    def _open(self, transport):