/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-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

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