/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/switch.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-07-28 02:47:10 UTC
  • mfrom: (7519.1.1 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200728024710-a2ylds219f1lsl62
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/388173

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
# Original author: David Allouche
20
18
 
21
19
from . import (
67
65
        if tree is not None:
68
66
            parent_ids = tree.get_parent_ids()
69
67
            if len(parent_ids) > 1:
70
 
                raise errors.BzrCommandError(
 
68
                raise errors.CommandError(
71
69
                    gettext('Pending merges must be '
72
70
                            'committed or reverted before using switch.'))
73
71
 
139
137
            possible_transports = []
140
138
            try:
141
139
                if not force and _any_local_commits(b, possible_transports):
142
 
                    raise errors.BzrCommandError(gettext(
 
140
                    raise errors.CommandError(gettext(
143
141
                        'Cannot switch as local commits found in the checkout. '
144
142
                        'Commit these to the bound branch or use --force to '
145
143
                        'throw them away.'))
146
144
            except errors.BoundBranchConnectionFailure as e:
147
 
                raise errors.BzrCommandError(gettext(
 
145
                raise errors.CommandError(gettext(
148
146
                    'Unable to connect to current master branch %(target)s: '
149
147
                    '%(error)s To switch anyway, use --force.') %
150
148
                    e.__dict__)
165
163
                    b.controldir.destroy_branch()
166
164
                    b.controldir.set_branch_reference(to_branch, name="")
167
165
                else:
168
 
                    raise errors.BzrCommandError(
 
166
                    raise errors.CommandError(
169
167
                        gettext('Cannot switch a branch, only a checkout.'))
170
168
 
171
169