/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/send.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:
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
 
17
19
import os
18
20
import time
19
21
 
52
54
            mail_client = config_stack.get('mail_client')(config_stack)
53
55
            if (not getattr(mail_client, 'supports_body', False)
54
56
                    and body is not None):
55
 
                raise errors.CommandError(gettext(
 
57
                raise errors.BzrCommandError(gettext(
56
58
                    'Mail client "%s" does not support specifying body') %
57
59
                    mail_client.__class__.__name__)
58
60
        if remember and target_branch is None:
59
 
            raise errors.CommandError(gettext(
 
61
            raise errors.BzrCommandError(gettext(
60
62
                '--remember requires a branch to be specified.'))
61
63
        stored_target_branch = branch.get_submit_branch()
62
64
        remembered_target_branch = None
72
74
            target_branch = branch.get_parent()
73
75
            remembered_target_branch = "parent"
74
76
        if target_branch is None:
75
 
            raise errors.CommandError(gettext('No submit branch known or'
 
77
            raise errors.BzrCommandError(gettext('No submit branch known or'
76
78
                                                 ' specified'))
77
79
        if remembered_target_branch is not None:
78
80
            trace.note(gettext('Using saved {0} location "{1}" to determine '
92
94
                try:
93
95
                    format = format_registry.get(formatname)
94
96
                except KeyError:
95
 
                    raise errors.CommandError(
 
97
                    raise errors.BzrCommandError(
96
98
                        gettext("No such send format '%s'.") % formatname)
97
99
 
98
100
        stored_public_branch = branch.get_public_branch()
103
105
              or (remember is None and stored_public_branch is None)):
104
106
            branch.set_public_branch(public_branch)
105
107
        if no_bundle and public_branch is None:
106
 
            raise errors.CommandError(gettext('No public branch specified or'
 
108
            raise errors.BzrCommandError(gettext('No public branch specified or'
107
109
                                                 ' known'))
108
110
        base_revision_id = None
109
111
        revision_id = None
110
112
        if revision is not None:
111
113
            if len(revision) > 2:
112
 
                raise errors.CommandError(gettext('bzr send takes '
 
114
                raise errors.BzrCommandError(gettext('bzr send takes '
113
115
                                                     'at most two one revision identifiers'))
114
116
            revision_id = revision[-1].as_revision_id(branch)
115
117
            if len(revision) == 2:
122
124
                    more_warning='Uncommitted changes will not be sent.')
123
125
            revision_id = branch.last_revision()
124
126
        if revision_id == NULL_REVISION:
125
 
            raise errors.CommandError(gettext('No revisions to submit.'))
 
127
            raise errors.BzrCommandError(gettext('No revisions to submit.'))
126
128
        if format is None:
127
129
            format = format_registry.get()
128
130
        directive = format(branch, revision_id, target_branch,
134
136
        else:
135
137
            if directive.multiple_output_files:
136
138
                if output == '-':
137
 
                    raise errors.CommandError(gettext('- not supported for '
 
139
                    raise errors.BzrCommandError(gettext('- not supported for '
138
140
                                                         'merge directives that use more than one output file.'))
139
141
                if not os.path.exists(output):
140
142
                    os.mkdir(output, 0o755)
175
177
        if not no_patch:
176
178
            patch_type = 'bundle'
177
179
        else:
178
 
            raise errors.CommandError(gettext('Format 0.9 does not'
 
180
            raise errors.BzrCommandError(gettext('Format 0.9 does not'
179
181
                                                 ' permit bundle with no patch'))
180
182
    else:
181
183
        if not no_patch: