~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

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