/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/push.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:
16
16
 
17
17
"""UI helper for the push command."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
from . import (
20
22
    branch as _mod_branch,
21
23
    controldir,
93
95
                                                      create_prefix=create_prefix, use_existing_dir=use_existing_dir,
94
96
                                                      no_tree=no_tree)
95
97
        except errors.AlreadyControlDirError:
96
 
            raise errors.CommandError(gettext(
 
98
            raise errors.BzrCommandError(gettext(
97
99
                "Target directory %s already contains a .bzr directory, "
98
100
                "but it is not valid.") % (location,))
99
101
        except errors.FileExists:
100
102
            if not use_existing_dir:
101
 
                raise errors.CommandError(gettext("Target directory %s"
 
103
                raise errors.BzrCommandError(gettext("Target directory %s"
102
104
                                                     " already exists, but does not have a .bzr"
103
105
                                                     " directory. Supply --use-existing-dir to push"
104
106
                                                     " there anyway.") % location)
107
109
            raise
108
110
        except errors.NoSuchFile:
109
111
            if not create_prefix:
110
 
                raise errors.CommandError(gettext("Parent directory of %s"
 
112
                raise errors.BzrCommandError(gettext("Parent directory of %s"
111
113
                                                     " does not exist."
112
114
                                                     "\nYou may supply --create-prefix to create all"
113
115
                                                     " leading parent directories.")
119
121
            # UnboundLocalError for br_to.
120
122
            raise
121
123
        except errors.TooManyRedirections:
122
 
            raise errors.CommandError(gettext("Too many redirections trying "
 
124
            raise errors.BzrCommandError(gettext("Too many redirections trying "
123
125
                                                 "to make %s.") % location)
124
126
        push_result = PushResult()
125
127
        # TODO: Some more useful message about what was copied
145
147
            push_result = dir_to.push_branch(br_from, revision_id, overwrite,
146
148
                                             remember, create_prefix, lossy=lossy)
147
149
        except errors.DivergedBranches:
148
 
            raise errors.CommandError(gettext('These branches have diverged.'
 
150
            raise errors.BzrCommandError(gettext('These branches have diverged.'
149
151
                                                 '  See "brz help diverged-branches"'
150
152
                                                 ' for more information.'))
151
153
        except errors.NoRoundtrippingSupport as e:
152
 
            raise errors.CommandError(
 
154
            raise errors.BzrCommandError(
153
155
                gettext("It is not possible to losslessly "
154
156
                        "push to %s. You may want to use --lossy.") %
155
157
                e.target_branch.mapping.vcs.abbreviation)
156
158
        except errors.NoRepositoryPresent:
157
159
            # we have a controldir but no branch or repository
158
160
            # XXX: Figure out what to do other than complain.
159
 
            raise errors.CommandError(gettext("At %s you have a valid .bzr"
 
161
            raise errors.BzrCommandError(gettext("At %s you have a valid .bzr"
160
162
                                                 " control directory, but not a branch or repository. This"
161
163
                                                 " is an unsupported configuration. Please move the target"
162
164
                                                 " directory out of the way and try again.") % location)