/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: Gustav Hartvigsson
  • Date: 2021-01-11 20:19:38 UTC
  • mfrom: (7526.3.2 work)
  • Revision ID: gustav.hartvigsson@gmail.com-20210111201938-omr9wjz3qdgyxe8k
MergedĀ lp:brz

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        if tree is not None:
66
66
            parent_ids = tree.get_parent_ids()
67
67
            if len(parent_ids) > 1:
68
 
                raise errors.BzrCommandError(
 
68
                raise errors.CommandError(
69
69
                    gettext('Pending merges must be '
70
70
                            'committed or reverted before using switch.'))
71
71
 
137
137
            possible_transports = []
138
138
            try:
139
139
                if not force and _any_local_commits(b, possible_transports):
140
 
                    raise errors.BzrCommandError(gettext(
 
140
                    raise errors.CommandError(gettext(
141
141
                        'Cannot switch as local commits found in the checkout. '
142
142
                        'Commit these to the bound branch or use --force to '
143
143
                        'throw them away.'))
144
144
            except errors.BoundBranchConnectionFailure as e:
145
 
                raise errors.BzrCommandError(gettext(
 
145
                raise errors.CommandError(gettext(
146
146
                    'Unable to connect to current master branch %(target)s: '
147
147
                    '%(error)s To switch anyway, use --force.') %
148
148
                    e.__dict__)
163
163
                    b.controldir.destroy_branch()
164
164
                    b.controldir.set_branch_reference(to_branch, name="")
165
165
                else:
166
 
                    raise errors.BzrCommandError(
 
166
                    raise errors.CommandError(
167
167
                        gettext('Cannot switch a branch, only a checkout.'))
168
168
 
169
169