~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

[merge] Robey Pointer - some sftp fixes, and an http patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1236
1236
                StrictCommitFailed)
1237
1237
        from bzrlib.msgeditor import edit_commit_message
1238
1238
        from bzrlib.status import show_status
1239
 
        from tempfile import TemporaryFile
1240
 
        import codecs
 
1239
        from cStringIO import StringIO
1241
1240
 
1242
 
        # TODO: do more checks that the commit will succeed before 
1243
 
        # spending the user's valuable time typing a commit message.
1244
 
        #
1245
 
        # TODO: if the commit *does* happen to fail, then save the commit 
1246
 
        # message to a temporary file where it can be recovered
1247
1241
        tree, selected_list = tree_files(selected_list)
1248
1242
        if message is None and not file:
1249
 
            template = make_commit_message_template(tree)
1250
 
            message = edit_commit_message(template)
 
1243
            catcher = StringIO()
 
1244
            show_status(tree.branch, specific_files=selected_list,
 
1245
                        to_file=catcher)
 
1246
            message = edit_commit_message(catcher.getvalue())
 
1247
 
1251
1248
            if message is None:
1252
1249
                raise BzrCommandError("please specify a commit message"
1253
1250
                                      " with either --message or --file")