~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/msgeditor.py

  • Committer: Jonathan Riddell
  • Date: 2011-06-02 12:46:20 UTC
  • mto: This revision was merged to the branch mainline in revision 5965.
  • Revision ID: jriddell@canonical.com-20110602124620-fbwhv52femfjxi6k
make set_commit_message hook syntax more consistent with generate_commit_message_template

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
hooks = MessageEditorHooks()
325
325
 
326
326
 
327
 
def set_commit_message(commit):
 
327
def set_commit_message(commit, start_message=None):
328
328
    """Sets the commit message.
329
329
    :param commit: Commit object for the active commit.
330
330
    :return: The commit message or None to continue using the message editor
331
331
    """
332
 
    message = None
 
332
    start_message = None
333
333
    for hook in hooks['set_commit_message']:
334
 
        message = hook(message, commit)
335
 
    return message
 
334
        start_message = hook(commit, start_message)
 
335
    return start_message
336
336
 
337
337
def generate_commit_message_template(commit, start_message=None):
338
338
    """Generate a commit message template.