/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: 2018-11-11 04:08:32 UTC
  • mto: (7143.16.20 even-more-cleanups)
  • mto: This revision was merged to the branch mainline in revision 7175.
  • Revision ID: jelmer@jelmer.uk-20181111040832-nsljjynzzwmznf3h
Run autopep8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
                mail_to = config_stack.get('submit_to')
55
55
            mail_client = config_stack.get('mail_client')(config_stack)
56
56
            if (not getattr(mail_client, 'supports_body', False)
57
 
                and body is not None):
 
57
                    and body is not None):
58
58
                raise errors.BzrCommandError(gettext(
59
59
                    'Mail client "%s" does not support specifying body') %
60
60
                    mail_client.__class__.__name__)
76
76
            remembered_target_branch = "parent"
77
77
        if target_branch is None:
78
78
            raise errors.BzrCommandError(gettext('No submit branch known or'
79
 
                                         ' specified'))
 
79
                                                 ' specified'))
80
80
        if remembered_target_branch is not None:
81
81
            trace.note(gettext('Using saved {0} location "{1}" to determine '
82
 
                       'what changes to submit.').format(
83
 
                                    remembered_target_branch,
84
 
                                    target_branch))
 
82
                               'what changes to submit.').format(
 
83
                remembered_target_branch,
 
84
                target_branch))
85
85
 
86
86
        submit_branch = Branch.open(target_branch,
87
 
            possible_transports=possible_transports)
 
87
                                    possible_transports=possible_transports)
88
88
        possible_transports.append(submit_branch.controldir.root_transport)
89
89
        if mail_to is None or format is None:
90
90
            if mail_to is None:
107
107
            branch.set_public_branch(public_branch)
108
108
        if no_bundle and public_branch is None:
109
109
            raise errors.BzrCommandError(gettext('No public branch specified or'
110
 
                                         ' known'))
 
110
                                                 ' known'))
111
111
        base_revision_id = None
112
112
        revision_id = None
113
113
        if revision is not None:
114
114
            if len(revision) > 2:
115
115
                raise errors.BzrCommandError(gettext('bzr send takes '
116
 
                    'at most two one revision identifiers'))
 
116
                                                     'at most two one revision identifiers'))
117
117
            revision_id = revision[-1].as_revision_id(branch)
118
118
            if len(revision) == 2:
119
119
                base_revision_id = revision[0].as_revision_id(branch)
129
129
        if format is None:
130
130
            format = format_registry.get()
131
131
        directive = format(branch, revision_id, target_branch,
132
 
            public_branch, no_patch, no_bundle, message, base_revision_id,
133
 
            submit_branch)
 
132
                           public_branch, no_patch, no_bundle, message, base_revision_id,
 
133
                           submit_branch)
134
134
        if output is None:
135
135
            directive.compose_merge_request(mail_client, mail_to, body,
136
136
                                            branch, tree)
138
138
            if directive.multiple_output_files:
139
139
                if output == '-':
140
140
                    raise errors.BzrCommandError(gettext('- not supported for '
141
 
                        'merge directives that use more than one output file.'))
 
141
                                                         'merge directives that use more than one output file.'))
142
142
                if not os.path.exists(output):
143
143
                    os.mkdir(output, 0o755)
144
144
                for (filename, lines) in directive.to_files():
184
184
            patch_type = 'bundle'
185
185
        else:
186
186
            raise errors.BzrCommandError(gettext('Format 0.9 does not'
187
 
                ' permit bundle with no patch'))
 
187
                                                 ' permit bundle with no patch'))
188
188
    else:
189
189
        if not no_patch:
190
190
            patch_type = 'diff'
199
199
 
200
200
 
201
201
format_registry.register('4',
202
 
    _send_4, 'Bundle format 4, Merge Directive 2 (default)')
 
202
                         _send_4, 'Bundle format 4, Merge Directive 2 (default)')
203
203
format_registry.register('0.9',
204
 
    _send_0_9, 'Bundle format 0.9, Merge Directive 1')
 
204
                         _send_0_9, 'Bundle format 0.9, Merge Directive 1')
205
205
format_registry.default_key = '4'