~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

  • Committer: Robert Collins
  • Date: 2007-03-08 04:06:06 UTC
  • mfrom: (2323.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 2442.
  • Revision ID: robertc@robertcollins.net-20070308040606-84gsniv56huiyjt4
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
# change upgrade from .bzr to create a '.bzr-new', then do a bait and switch.
20
20
 
21
21
 
22
 
from bzrlib.bzrdir import ConvertBzrDir4To5, ConvertBzrDir5To6, BzrDir, BzrDirFormat4, BzrDirFormat5
 
22
from bzrlib.bzrdir import ConvertBzrDir4To5, ConvertBzrDir5To6, BzrDir, BzrDirFormat4, BzrDirFormat5, BzrDirFormat
23
23
import bzrlib.errors as errors
24
24
from bzrlib.transport import get_transport
25
25
import bzrlib.ui as ui
54
54
        if not self.bzrdir.can_convert_format():
55
55
            raise errors.BzrError("cannot upgrade from branch format %s" %
56
56
                           self.bzrdir._format)
 
57
        if self.format is None:
 
58
            target_format = BzrDirFormat.get_default_format()
 
59
        else:
 
60
            target_format = self.format
 
61
        self.bzrdir.check_conversion_target(target_format)
57
62
        self.pb.note('starting upgrade of %s', self.transport.base)
58
63
        self._backup_control_dir()
59
64
        while self.bzrdir.needs_format_conversion(self.format):