~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

(andrew) Correctly do stub initialization of pre-metadir trees over sftp for compatability with 0.7 and earlier.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1218
1218
        result = (super(BzrDirFormat5, self).initialize_on_transport(transport))
1219
1219
        RepositoryFormat5().initialize(result, _internal=True)
1220
1220
        if not _cloning:
1221
 
            BzrBranchFormat4().initialize(result)
1222
 
            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)
1223
1228
        return result
1224
1229
 
1225
1230
    def _open(self, transport):
1272
1277
        result = super(BzrDirFormat6, self).initialize_on_transport(transport)
1273
1278
        RepositoryFormat6().initialize(result, _internal=True)
1274
1279
        if not _cloning:
1275
 
            BzrBranchFormat4().initialize(result)
 
1280
            branch = BzrBranchFormat4().initialize(result)
1276
1281
            try:
1277
1282
                WorkingTreeFormat2().initialize(result)
1278
1283
            except errors.NotLocalUrl:
1279
 
                # emulate pre-check behaviour for working tree and silently 
1280
 
                # fail.
1281
 
                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)
1282
1287
        return result
1283
1288
 
1284
1289
    def _open(self, transport):