~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

  • Committer: Robert Collins
  • Date: 2010-04-08 04:34:03 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5139.
  • Revision ID: robertc@robertcollins.net-20100408043403-56z0d07vdqrx7f3t
Update bugfix for 528114 to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2008, 2009, 2010 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
 
38
37
        if self.bzrdir.root_transport.is_readonly():
39
38
            raise errors.UpgradeReadonly
40
39
        self.transport = self.bzrdir.root_transport
41
 
        self.pb = ui.ui_factory.nested_progress_bar()
42
40
        ui.ui_factory.suppressed_warnings.add(warning_id)
43
41
        try:
44
42
            self.convert()
45
43
        finally:
46
 
            self.pb.finished()
47
44
            if not saved_warning:
48
45
                ui.ui_factory.suppressed_warnings.remove(warning_id)
49
46
 
83
80
        self.bzrdir.backup_bzrdir()
84
81
        while self.bzrdir.needs_format_conversion(format):
85
82
            converter = self.bzrdir._format.get_converter(format)
86
 
            self.bzrdir = converter.convert(self.bzrdir, self.pb)
 
83
            self.bzrdir = converter.convert(self.bzrdir, None)
87
84
        ui.ui_factory.note("finished")
88
85
 
89
86