~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

(gz) Fix test failure on alpha by correcting format string for
 gc_chk_sha1_record (Martin [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2011 Canonical Ltd
 
1
# Copyright (C) 2007-2010 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,
27
26
    errors,
28
27
    gpg,
29
28
    hooks,
37
36
from bzrlib.bundle import (
38
37
    serializer as bundle_serializer,
39
38
    )
 
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, "bzrlib.merge_directive", "BaseMergeDirective.hooks")
63
 
        self.add_hook('merge_request_body',
 
62
        hooks.Hooks.__init__(self)
 
63
        self.create_hook(hooks.HookPoint('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))
 
67
            " provided to the next.", (1, 15, 0), False))
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 = email_message.EmailMessage(mail_from, mail_to, subject,
270
 
            body)
 
269
        message = EmailMessage(mail_from, mail_to, subject, body)
271
270
        return message
272
271
 
273
272
    def install_revisions(self, target_repo):