~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Aaron Bentley
  • Date: 2007-01-05 06:32:57 UTC
  • mto: (2255.1.1 bzr.ab.integration)
  • mto: This revision was merged to the branch mainline in revision 2226.
  • Revision ID: aaron.bentley@utoronto.ca-20070105063257-4t62uie9fb3i017j
deprecate Repository.set_default_format, update upgrade tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from stat import S_ISDIR
26
26
from StringIO import StringIO
27
27
 
 
28
from bzrlib import symbol_versioning
28
29
import bzrlib
29
30
import bzrlib.bzrdir as bzrdir
30
31
import bzrlib.errors as errors
46
47
        private_default = repository._default_format.__class__
47
48
        old_format = repository.RepositoryFormat.get_default_format()
48
49
        self.assertTrue(isinstance(old_format, private_default))
49
 
        repository.RepositoryFormat.set_default_format(SampleRepositoryFormat())
 
50
        self.applyDeprecated(symbol_versioning.zero_fourteen, 
 
51
            repository.RepositoryFormat.set_default_format, 
 
52
            SampleRepositoryFormat())
50
53
        # creating a repository should now create an instrumented dir.
51
54
        try:
52
55
            # the default branch format is used by the meta dir format
55
58
            result = dir.create_repository()
56
59
            self.assertEqual(result, 'A bzr repository dir')
57
60
        finally:
58
 
            repository.RepositoryFormat.set_default_format(old_format)
 
61
            self.applyDeprecated(symbol_versioning.zero_fourteen, 
 
62
                repository.RepositoryFormat.set_default_format, old_format)
59
63
        self.assertEqual(old_format, repository.RepositoryFormat.get_default_format())
60
64
 
61
65