/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: 2019-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
        from_, possible_transports=possible_transports)[:2]
47
47
    # we may need to write data into branch's repository to calculate
48
48
    # the data to send.
49
 
    with branch.lock_write():
 
49
    branch.lock_write()
 
50
    try:
50
51
        if output is None:
51
52
            config_stack = branch.get_config_stack()
52
53
            if mail_to is None:
142
143
                    os.mkdir(output, 0o755)
143
144
                for (filename, lines) in directive.to_files():
144
145
                    path = os.path.join(output, filename)
145
 
                    with open(path, 'wb') as outfile:
 
146
                    outfile = open(path, 'wb')
 
147
                    try:
146
148
                        outfile.writelines(lines)
 
149
                    finally:
 
150
                        outfile.close()
147
151
            else:
148
152
                if output == '-':
149
153
                    outfile = to_file
154
158
                finally:
155
159
                    if outfile is not to_file:
156
160
                        outfile.close()
 
161
    finally:
 
162
        branch.unlock()
157
163
 
158
164
 
159
165
def _send_4(branch, revision_id, target_branch, public_branch,