72
72
def post_commit(branch, revision_id):
73
73
"""This is the post_commit hook that should get run after commit."""
74
74
from . import emailer
75
emailer.EmailSender(branch, revision_id, branch.get_config_stack()).send_maybe()
75
emailer.EmailSender(branch, revision_id,
76
branch.get_config_stack()).send_maybe()
78
79
def branch_commit_hook(local, master, old_revno, old_revid, new_revno, new_revid):
87
88
# (branch, old_revno, new_revno, old_revid, new_revid)
88
89
from . import emailer
89
90
emailer.EmailSender(params.branch, params.new_revid,
90
params.branch.get_config_stack(), local_branch=None, op='change').send_maybe()
91
params.branch.get_config_stack(), local_branch=None, op='change').send_maybe()
101
102
option_registry.register_lazy("post_commit_body",
102
"breezy.plugins.email.emailer", "opt_post_commit_body")
103
"breezy.plugins.email.emailer", "opt_post_commit_body")
103
104
option_registry.register_lazy("post_commit_subject",
104
"breezy.plugins.email.emailer", "opt_post_commit_subject")
105
"breezy.plugins.email.emailer", "opt_post_commit_subject")
105
106
option_registry.register_lazy("post_commit_log_format",
106
"breezy.plugins.email.emailer", "opt_post_commit_log_format")
107
"breezy.plugins.email.emailer", "opt_post_commit_log_format")
107
108
option_registry.register_lazy("post_commit_difflimit",
108
"breezy.plugins.email.emailer", "opt_post_commit_difflimit")
109
"breezy.plugins.email.emailer", "opt_post_commit_difflimit")
109
110
option_registry.register_lazy("post_commit_push_pull",
110
"breezy.plugins.email.emailer", "opt_post_commit_push_pull")
111
"breezy.plugins.email.emailer", "opt_post_commit_push_pull")
111
112
option_registry.register_lazy("post_commit_diffoptions",
112
"breezy.plugins.email.emailer", "opt_post_commit_diffoptions")
113
"breezy.plugins.email.emailer", "opt_post_commit_diffoptions")
113
114
option_registry.register_lazy("post_commit_sender",
114
"breezy.plugins.email.emailer", "opt_post_commit_sender")
115
"breezy.plugins.email.emailer", "opt_post_commit_sender")
115
116
option_registry.register_lazy("post_commit_to",
116
"breezy.plugins.email.emailer", "opt_post_commit_to")
117
"breezy.plugins.email.emailer", "opt_post_commit_to")
117
118
option_registry.register_lazy("post_commit_mailer",
118
"breezy.plugins.email.emailer", "opt_post_commit_mailer")
119
"breezy.plugins.email.emailer", "opt_post_commit_mailer")
119
120
option_registry.register_lazy("revision_mail_headers",
120
"breezy.plugins.email.emailer", "opt_revision_mail_headers")
121
"breezy.plugins.email.emailer", "opt_revision_mail_headers")
122
123
from ...hooks import install_lazy_named_hook
123
124
install_lazy_named_hook("breezy.branch", "Branch.hooks", 'post_commit',
124
branch_commit_hook, 'bzr-email')
125
branch_commit_hook, 'bzr-email')
125
126
install_lazy_named_hook("breezy.branch", "Branch.hooks",
126
'post_change_branch_tip', branch_post_change_hook, 'bzr-email')
127
'post_change_branch_tip', branch_post_change_hook, 'bzr-email')