~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-10 07:46:15 UTC
  • mfrom: (5844 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5845.
  • Revision ID: jelmer@samba.org-20110510074615-eptod049ndjxc4i7
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2007-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
23
23
from bzrlib import (
24
24
    branch as _mod_branch,
25
25
    diff,
 
26
    email_message,
26
27
    errors,
27
28
    gpg,
28
29
    hooks,
36
37
from bzrlib.bundle import (
37
38
    serializer as bundle_serializer,
38
39
    )
39
 
from bzrlib.email_message import EmailMessage
40
40
""")
41
41
 
42
42
 
59
59
    """Hooks for MergeDirective classes."""
60
60
 
61
61
    def __init__(self):
62
 
        hooks.Hooks.__init__(self)
63
 
        self.create_hook(hooks.HookPoint('merge_request_body',
 
62
        hooks.Hooks.__init__(self, "bzrlib.merge_directive", "BaseMergeDirective.hooks")
 
63
        self.add_hook('merge_request_body',
64
64
            "Called with a MergeRequestBodyParams when a body is needed for"
65
65
            " a merge request.  Callbacks must return a body.  If more"
66
66
            " than one callback is registered, the output of one callback is"
67
 
            " provided to the next.", (1, 15, 0), False))
 
67
            " provided to the next.", (1, 15, 0))
68
68
 
69
69
 
70
70
class BaseMergeDirective(object):
266
266
            body = self.to_signed(branch)
267
267
        else:
268
268
            body = ''.join(self.to_lines())
269
 
        message = EmailMessage(mail_from, mail_to, subject, body)
 
269
        message = email_message.EmailMessage(mail_from, mail_to, subject,
 
270
            body)
270
271
        return message
271
272
 
272
273
    def install_revisions(self, target_repo):