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