~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/send.py

  • Committer: Vincent Ladeuil
  • Date: 2012-02-14 17:22:37 UTC
  • mfrom: (6466 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120214172237-7dv7er3n4uy8d5m4
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
def send(target_branch, revision, public_branch, remember,
42
42
         format, no_bundle, no_patch, output, from_, mail_to, message, body,
43
43
         to_file, strict=None):
 
44
    possible_transports = []
44
45
    tree, branch = controldir.ControlDir.open_containing_tree_or_branch(
45
 
        from_)[:2]
46
 
    possible_transports = [tree.bzrdir.transport, branch.bzrdir.transport]
 
46
        from_, possible_transports=possible_transports)[:2]
47
47
    # we may need to write data into branch's repository to calculate
48
48
    # the data to send.
49
49
    branch.lock_write()
50
50
    try:
51
51
        if output is None:
 
52
            config_stack = branch.get_config_stack()
52
53
            if mail_to is None:
53
 
                mail_to = branch.get_config_stack().get('submit_to')
54
 
            mail_client = branch.get_config().get_mail_client()
 
54
                mail_to = config_stack.get('submit_to')
 
55
            mail_client = config_stack.get('mail_client')(config_stack)
55
56
            if (not getattr(mail_client, 'supports_body', False)
56
57
                and body is not None):
57
58
                raise errors.BzrCommandError(gettext(