If you haven't merged already, please apply the attached clean-up patch. It just removes a few lines of "TODO".<br><br><div><span class="gmail_quote">On 10/19/06, <b class="gmail_sendername">Martin Pool</b> <<a href="mailto:mbp@canonical.com">
mbp@canonical.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 19 Oct 2006, Cheuksan Edward Wang <<a href="mailto:wang02139@gmail.com">
wang02139@gmail.com</a>> wrote:<br>> I have modified the code and tests according to your comments except the<br>> 'replace' part. The changeset is attached. I'll see what I can do with 5798.<br><br>Thankyou.<br>
<br>+1 with comments, taking<br><br>> -<br>> +<br>> + # save the commit message and only unlink it if the commit was<br>> + # successful<br>> + try:<br>> + tmp_fileno, msgfilename =
tempfile.mkstemp(prefix='bzr-commit-',<br>> + dir=tree.basedir)<br>> + os.close(tmp_fileno)<br>> + except OSError:<br>> + try:
<br>> + # No access to working dir, try $TMP<br>> + tmp_fileno, msgfilename= tempfile.mkstemp(prefix='bzr-commit-')<br>> + os.close(tmp_fileno)<br>> + except:
<br>> + # We can't create a temp file, try to work without it<br>> + msgfilename = None<br>> + if msgfilename is not None:<br>> + msgfile = open(msgfilename, "wt")
<br>> + try:<br>> + msgfile.write(message.encode(bzrlib.user_encoding, 'replace'))<br>> + finally:<br>> + msgfile.close()<br>> +<br><br>This is large enough and self-contained enough that it should be in a
<br>separate method. If someone else approves it I'll fix that and merge.<br><br><br>--<br>Martin<br><br></blockquote></div><br>