1
# Copyright (C) 2009 Canonical Ltd
1
# Copyright (C) 2009, 2010 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
135
135
directive.compose_merge_request(mail_client, mail_to, body,
138
if directive.multiple_output_files:
140
raise errors.BzrCommandError('- not supported for '
141
'merge directives that use more than one output file.')
142
if not os.path.exists(output):
143
os.mkdir(output, 0755)
144
for (filename, lines) in directive.to_files():
145
path = os.path.join(output, filename)
146
outfile = open(path, 'wb')
148
outfile.writelines(lines)
141
outfile = open(output, 'wb')
143
outfile.writelines(directive.to_lines())
145
if outfile is not to_file:
155
outfile = open(output, 'wb')
157
outfile.writelines(directive.to_lines())
159
if outfile is not to_file:
151
165
def _send_4(branch, revision_id, submit_branch, public_branch,
152
166
no_patch, no_bundle, message, base_revision_id):
167
from bzrlib import merge_directive
153
168
return merge_directive.MergeDirective2.from_objects(
154
169
branch.repository, revision_id, time.time(),
155
170
osutils.local_time_offset(), submit_branch,
171
186
patch_type = 'diff'
173
188
patch_type = None
189
from bzrlib import merge_directive
174
190
return merge_directive.MergeDirective.from_objects(
175
191
branch.repository, revision_id, time.time(),
176
192
osutils.local_time_offset(), submit_branch,