~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

  • Committer: Martin Pool
  • Date: 2010-03-26 10:25:47 UTC
  • mfrom: (5110.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5118.
  • Revision ID: mbp@canonical.com-20100326102547-74ta65m7w7ecjebq
merge 2.1.1, including fetch format warning, back to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    def __init__(self, url, format=None):
29
29
        self.format = format
30
30
        self.bzrdir = BzrDir.open_unsupported(url)
 
31
        # XXX: Change to cleanup
 
32
        warning_id = 'cross_format_fetch'
 
33
        saved_warning = warning_id in ui.ui_factory.suppressed_warnings
31
34
        if isinstance(self.bzrdir, RemoteBzrDir):
32
35
            self.bzrdir._ensure_real()
33
36
            self.bzrdir = self.bzrdir._real_bzrdir
34
37
        if self.bzrdir.root_transport.is_readonly():
35
38
            raise errors.UpgradeReadonly
36
39
        self.transport = self.bzrdir.root_transport
37
 
        self.convert()
 
40
        ui.ui_factory.suppressed_warnings.add(warning_id)
 
41
        try:
 
42
            self.convert()
 
43
        finally:
 
44
            if not saved_warning:
 
45
                ui.ui_factory.suppressed_warnings.remove(warning_id)
38
46
 
39
47
    def convert(self):
40
48
        try: