/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/switch.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
# Original author: David Allouche
20
20
 
21
 
from bzrlib import (
 
21
from . import (
22
22
    errors,
23
23
    lock,
24
24
    merge,
25
25
    revision
26
26
    )
27
 
from bzrlib.branch import Branch
28
 
from bzrlib.i18n import gettext
29
 
from bzrlib.trace import note
 
27
from .branch import Branch
 
28
from .i18n import gettext
 
29
from .trace import note
30
30
 
31
31
def _run_post_switch_hooks(control_dir, to_branch, force, revision_id):
32
 
    from bzrlib.branch import SwitchHookParams
 
32
    from .branch import SwitchHookParams
33
33
    hooks = Branch.hooks['post_switch']
34
34
    if not hooks:
35
35
        return
72
72
    """
73
73
    try:
74
74
        tree = control.open_workingtree()
75
 
    except errors.NotBranchError, ex:
 
75
    except errors.NotBranchError as ex:
76
76
        # Lightweight checkout and branch is no longer there
77
77
        if force:
78
78
            return
111
111
                        'Cannot switch as local commits found in the checkout. '
112
112
                        'Commit these to the bound branch or use --force to '
113
113
                        'throw them away.'))
114
 
            except errors.BoundBranchConnectionFailure, e:
 
114
            except errors.BoundBranchConnectionFailure as e:
115
115
                raise errors.BzrCommandError(gettext(
116
116
                        'Unable to connect to current master branch %(target)s: '
117
117
                        '%(error)s To switch anyway, use --force.') %