~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/msgeditor.py

  • Committer: ghigo
  • Date: 2007-08-13 17:13:44 UTC
  • mto: (2772.1.1 show-diff)
  • mto: This revision was merged to the branch mainline in revision 2773.
  • Revision ID: ghigo@venice-20070813171344-1qd4y1a70gav4gde
updates on the basis of Jhon email

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
                               ignoreline,
107
107
                               start_message)
108
108
 
 
109
 
109
110
def edit_commit_message_encoded(infotext, ignoreline=DEFAULT_IGNORE_LINE,
110
111
                        start_message=None):
111
112
    """Let the user edit a commit message in a temp file.
254
255
    from StringIO import StringIO       # must be unicode-safe
255
256
    from bzrlib.diff import show_diff_trees
256
257
 
 
258
    if output_encoding is None:
 
259
        output_encoding = 'utf-8'
 
260
 
257
261
    template = make_commit_message_template(working_tree, specific_files).encode(output_encoding, "replace")
258
262
 
259
263
    if diff:
260
264
        stream = StringIO()
261
 
        template += "\n"
262
265
        show_diff_trees(working_tree.basis_tree(),
263
266
                working_tree, stream, specific_files,
264
267
                path_encoding=output_encoding)
265
 
        template = template + stream.getvalue()
 
268
        template = template + '\n' + stream.getvalue()
266
269
 
267
270
    return template