~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

(jameinel) Allow 'bzr serve' to interpret SIGHUP as a graceful shutdown.
 (bug #795025) (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""bzr upgrade logic."""
18
18
 
19
 
from __future__ import absolute_import
20
19
 
21
20
from bzrlib import (
22
21
    errors,
24
23
    ui,
25
24
    urlutils,
26
25
    )
27
 
from bzrlib.controldir import (
28
 
    ControlDir,
 
26
from bzrlib.bzrdir import (
 
27
    BzrDir,
29
28
    format_registry,
30
29
    )
31
30
from bzrlib.i18n import gettext
55
54
        if control_dir is not None:
56
55
            self.bzrdir = control_dir
57
56
        else:
58
 
            self.bzrdir = ControlDir.open_unsupported(url)
 
57
            self.bzrdir = BzrDir.open_unsupported(url)
59
58
        if isinstance(self.bzrdir, RemoteBzrDir):
60
59
            self.bzrdir._ensure_real()
61
60
            self.bzrdir = self.bzrdir._real_bzrdir
140
139
    :param dry_run: show what would happen but don't actually do any upgrades
141
140
    :return: the list of exceptions encountered
142
141
    """
143
 
    control_dirs = [ControlDir.open_unsupported(url)]
 
142
    control_dirs = [BzrDir.open_unsupported(url)]
144
143
    attempted, succeeded, exceptions = smart_upgrade(control_dirs,
145
144
        format, clean_up=clean_up, dry_run=dry_run)
146
145
    if len(attempted) > 1:
285
284
        try:
286
285
            if not dry_run:
287
286
                cv = Convert(control_dir=control_dir, format=format)
288
 
        except errors.UpToDateFormat, ex:
289
 
            ui.ui_factory.note(str(ex))
290
 
            succeeded.append(control_dir)
291
 
            continue
292
287
        except Exception, ex:
293
288
            trace.warning('conversion error: %s' % ex)
294
289
            exceptions.append(ex)