~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

  • Committer: Martin Pool
  • Date: 2010-02-25 06:17:27 UTC
  • mfrom: (5055 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5057.
  • Revision ID: mbp@sourcefrog.net-20100225061727-4sd9lt0qmdc6087t
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2008, 2009 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2008, 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
17
17
"""bzr upgrade logic."""
18
18
 
19
19
 
20
 
from bzrlib.bzrdir import BzrDir, BzrDirFormat, format_registry
 
20
from bzrlib.bzrdir import BzrDir, format_registry
21
21
import bzrlib.errors as errors
22
22
from bzrlib.remote import RemoteBzrDir
23
 
from bzrlib.transport import get_transport
24
23
import bzrlib.ui as ui
25
24
 
26
25
 
35
34
        if self.bzrdir.root_transport.is_readonly():
36
35
            raise errors.UpgradeReadonly
37
36
        self.transport = self.bzrdir.root_transport
38
 
        self.pb = ui.ui_factory.nested_progress_bar()
39
 
        try:
40
 
            self.convert()
41
 
        finally:
42
 
            self.pb.finished()
 
37
        self.convert()
43
38
 
44
39
    def convert(self):
45
40
        try:
77
72
        self.bzrdir.backup_bzrdir()
78
73
        while self.bzrdir.needs_format_conversion(format):
79
74
            converter = self.bzrdir._format.get_converter(format)
80
 
            self.bzrdir = converter.convert(self.bzrdir, self.pb)
 
75
            self.bzrdir = converter.convert(self.bzrdir, None)
81
76
        ui.ui_factory.note("finished")
82
77
 
83
78