/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Martin Pool
  • Date: 2011-05-20 14:46:02 UTC
  • mto: This revision was merged to the branch mainline in revision 5923.
  • Revision ID: mbp@canonical.com-20110520144602-bqli0t6dj01gl0pv
Various pyflakes import fixes.

Some modules were used for subclassing or at module load time, so there is no
point loading them lazily.

Some were not imported when they should be.

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
18
18
from StringIO import StringIO
19
19
import re
20
20
 
 
21
from bzrlib import lazy_import
 
22
lazy_import.lazy_import(globals(), """
21
23
from bzrlib import (
22
24
    branch as _mod_branch,
23
25
    diff,
 
26
    email_message,
24
27
    errors,
25
28
    gpg,
26
29
    hooks,
34
37
from bzrlib.bundle import (
35
38
    serializer as bundle_serializer,
36
39
    )
37
 
from bzrlib.email_message import EmailMessage
 
40
""")
38
41
 
39
42
 
40
43
class MergeRequestBodyParams(object):
56
59
    """Hooks for MergeDirective classes."""
57
60
 
58
61
    def __init__(self):
59
 
        hooks.Hooks.__init__(self)
60
 
        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',
61
64
            "Called with a MergeRequestBodyParams when a body is needed for"
62
65
            " a merge request.  Callbacks must return a body.  If more"
63
66
            " than one callback is registered, the output of one callback is"
64
 
            " provided to the next.", (1, 15, 0), False))
 
67
            " provided to the next.", (1, 15, 0))
65
68
 
66
69
 
67
70
class BaseMergeDirective(object):
263
266
            body = self.to_signed(branch)
264
267
        else:
265
268
            body = ''.join(self.to_lines())
266
 
        message = EmailMessage(mail_from, mail_to, subject, body)
 
269
        message = email_message.EmailMessage(mail_from, mail_to, subject,
 
270
            body)
267
271
        return message
268
272
 
269
273
    def install_revisions(self, target_repo):