93
93
except errors.FileExists, err:
94
94
if err.path.endswith('/.bzr'):
95
raise errors.BzrCommandError(
95
raise errors.BzrCommandError(gettext(
96
96
"Target directory %s already contains a .bzr directory, "
97
"but it is not valid." % (location,))
97
"but it is not valid.") % (location,))
98
98
if not use_existing_dir:
99
raise errors.BzrCommandError("Target directory %s"
99
raise errors.BzrCommandError(gettext("Target directory %s"
100
100
" already exists, but does not have a .bzr"
101
101
" directory. Supply --use-existing-dir to push"
102
" there anyway." % location)
102
" there anyway.") % location)
103
103
# This shouldn't occur, but if it does the FileExists error will be
104
104
# more informative than an UnboundLocalError for br_to.
106
106
except errors.NoSuchFile:
107
107
if not create_prefix:
108
raise errors.BzrCommandError("Parent directory of %s"
108
raise errors.BzrCommandError(gettext("Parent directory of %s"
109
109
" does not exist."
110
110
"\nYou may supply --create-prefix to create all"
111
" leading parent directories."
111
" leading parent directories.")
113
113
# This shouldn't occur (because create_prefix is true, so
114
114
# create_clone_on_transport should be catching NoSuchFile and
117
117
# UnboundLocalError for br_to.
119
119
except errors.TooManyRedirections:
120
raise errors.BzrCommandError("Too many redirections trying "
121
"to make %s." % location)
120
raise errors.BzrCommandError(gettext("Too many redirections trying "
121
"to make %s.") % location)
122
122
push_result = PushResult()
123
123
# TODO: Some more useful message about what was copied
142
142
push_result = dir_to.push_branch(br_from, revision_id, overwrite,
143
143
remember, create_prefix)
144
144
except errors.DivergedBranches:
145
raise errors.BzrCommandError('These branches have diverged.'
145
raise errors.BzrCommandError(gettext('These branches have diverged.'
146
146
' See "bzr help diverged-branches"'
147
' for more information.')
147
' for more information.'))
148
148
except errors.NoRoundtrippingSupport, e:
149
raise errors.BzrCommandError("It is not possible to losslessly "
150
"push to %s. You may want to use dpush instead." %
149
raise errors.BzrCommandError(gettext("It is not possible to losslessly "
150
"push to %s. You may want to use dpush instead.") %
151
151
e.target_branch.mapping.vcs.abbreviation)
152
152
except errors.NoRepositoryPresent:
153
153
# we have a bzrdir but no branch or repository
154
154
# XXX: Figure out what to do other than complain.
155
raise errors.BzrCommandError("At %s you have a valid .bzr"
155
raise errors.BzrCommandError(gettext("At %s you have a valid .bzr"
156
156
" control directory, but not a branch or repository. This"
157
157
" is an unsupported configuration. Please move the target"
158
" directory out of the way and try again." % location)
158
" directory out of the way and try again.") % location)
159
159
if push_result.workingtree_updated == False:
160
160
warning("This transport does not update the working "
161
161
"tree of: %s. See 'bzr help working-trees' for "