~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/bzrdir_implementations/test_bzrdir.py

  • Committer: v.ladeuil+lp at free
  • Date: 2007-01-09 15:44:23 UTC
  • mfrom: (2227 +trunk)
  • mto: (2323.7.1 redirection)
  • mto: This revision was merged to the branch mainline in revision 2390.
  • Revision ID: v.ladeuil+lp@free.fr-20070109154423-lyvr5gmkwv6e0v6h
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1261
1261
        dir = self.make_bzrdir('.')
1262
1262
        if dir.can_convert_format():
1263
1263
            # if its default updatable there must be an updater 
1264
 
            # (we change the default to match the lastest known format
1265
 
            # as downgrades may not be available
1266
 
            old_format = bzrdir.BzrDirFormat.get_default_format()
1267
 
            bzrdir.BzrDirFormat.set_default_format(dir._format)
1268
 
            try:
1269
 
                self.assertTrue(isinstance(dir._format.get_converter(),
1270
 
                                           bzrdir.Converter))
1271
 
            finally:
1272
 
                bzrdir.BzrDirFormat.set_default_format(old_format)
 
1264
            # (we force the latest known format as downgrades may not be
 
1265
            # available
 
1266
            self.assertTrue(isinstance(dir._format.get_converter(
 
1267
                format=dir._format), bzrdir.Converter))
1273
1268
        dir.needs_format_conversion(None)
1274
1269
 
1275
1270
    def test_upgrade_new_instance(self):
1281
1276
        self.createWorkingTreeOrSkip(dir)
1282
1277
        if dir.can_convert_format():
1283
1278
            # if its default updatable there must be an updater 
1284
 
            # (we change the default to match the lastest known format
1285
 
            # as downgrades may not be available
1286
 
            old_format = bzrdir.BzrDirFormat.get_default_format()
1287
 
            bzrdir.BzrDirFormat.set_default_format(dir._format)
 
1279
            # (we force the latest known format as downgrades may not be
 
1280
            # available
1288
1281
            pb = ui.ui_factory.nested_progress_bar()
1289
1282
            try:
1290
 
                dir._format.get_converter(None).convert(dir, pb)
 
1283
                dir._format.get_converter(format=dir._format).convert(dir, pb)
1291
1284
            finally:
1292
 
                bzrdir.BzrDirFormat.set_default_format(old_format)
1293
1285
                pb.finished()
1294
1286
            # and it should pass 'check' now.
1295
1287
            check(bzrdir.BzrDir.open(self.get_url('.')).open_branch(), False)