/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: Jelmer Vernooij
  • Date: 2020-02-13 23:57:28 UTC
  • mfrom: (7490 work)
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200213235728-m6ds0mm3mbs4y182
Merge trunk.

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
 
17
19
# Original author: David Allouche
18
20
 
19
21
from . import (
65
67
        if tree is not None:
66
68
            parent_ids = tree.get_parent_ids()
67
69
            if len(parent_ids) > 1:
68
 
                raise errors.CommandError(
 
70
                raise errors.BzrCommandError(
69
71
                    gettext('Pending merges must be '
70
72
                            'committed or reverted before using switch.'))
71
73
 
137
139
            possible_transports = []
138
140
            try:
139
141
                if not force and _any_local_commits(b, possible_transports):
140
 
                    raise errors.CommandError(gettext(
 
142
                    raise errors.BzrCommandError(gettext(
141
143
                        'Cannot switch as local commits found in the checkout. '
142
144
                        'Commit these to the bound branch or use --force to '
143
145
                        'throw them away.'))
144
146
            except errors.BoundBranchConnectionFailure as e:
145
 
                raise errors.CommandError(gettext(
 
147
                raise errors.BzrCommandError(gettext(
146
148
                    'Unable to connect to current master branch %(target)s: '
147
149
                    '%(error)s To switch anyway, use --force.') %
148
150
                    e.__dict__)
163
165
                    b.controldir.destroy_branch()
164
166
                    b.controldir.set_branch_reference(to_branch, name="")
165
167
                else:
166
 
                    raise errors.CommandError(
 
168
                    raise errors.BzrCommandError(
167
169
                        gettext('Cannot switch a branch, only a checkout.'))
168
170
 
169
171