~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-29 22:03:03 UTC
  • mfrom: (5416.2.6 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100929220303-cr95h8iwtggco721
(mbp) Add 'break-lock --force'

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:
41
49
            branch = self.bzrdir.open_branch()
42
 
            if branch.bzrdir.root_transport.base != \
43
 
                self.bzrdir.root_transport.base:
 
50
            if branch.user_url != self.bzrdir.user_url:
44
51
                ui.ui_factory.note("This is a checkout. The branch (%s) needs to be "
45
52
                             "upgraded separately." %
46
 
                             branch.bzrdir.root_transport.base)
 
53
                             branch.user_url)
47
54
            del branch
48
55
        except (errors.NotBranchError, errors.IncompatibleRepositories):
49
56
            # might not be a format we can open without upgrading; see e.g.