~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Marius Kruger
  • Date: 2007-06-27 18:48:10 UTC
  • mfrom: (2557 +trunk)
  • mto: (2605.1.1 rm-renamed)
  • mto: This revision was merged to the branch mainline in revision 2609.
  • Revision ID: marius.kruger@enerweb.co.za-20070627184810-4jq1y5f20xafow9w
Merge with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
lazy_import(globals(), """
24
24
import codecs
25
25
import errno
26
 
import smtplib
27
26
import sys
28
27
import tempfile
29
28
import time
56
55
from bzrlib.bundle.apply_bundle import install_bundle, merge_bundle
57
56
from bzrlib.conflicts import ConflictList
58
57
from bzrlib.revisionspec import RevisionSpec
 
58
from bzrlib.smtp_connection import SMTPConnection
59
59
from bzrlib.workingtree import WorkingTree
60
60
""")
61
61
 
2472
2472
            clean_selftest_output()
2473
2473
            return 0
2474
2474
        if keep_output:
2475
 
            trace.warning("notice: selftest --keep-output "
2476
 
                          "is no longer supported; "
2477
 
                          "test output is always removed")
 
2475
            warning("notice: selftest --keep-output "
 
2476
                    "is no longer supported; "
 
2477
                    "test output is always removed")
2478
2478
 
2479
2479
        if numbered_dirs is None and sys.platform == 'win32':
2480
2480
            numbered_dirs = True
3536
3536
            help='Message to use when committing this merge')
3537
3537
        ]
3538
3538
 
 
3539
    encoding_type = 'exact'
 
3540
 
3539
3541
    def run(self, submit_branch=None, public_branch=None, patch_type='bundle',
3540
3542
            sign=False, revision=None, mail_to=None, message=None):
3541
3543
        from bzrlib.revision import ensure_null, NULL_REVISION
3584
3586
                self.outf.writelines(directive.to_lines())
3585
3587
        else:
3586
3588
            message = directive.to_email(mail_to, branch, sign)
3587
 
            s = smtplib.SMTP()
3588
 
            server = branch.get_config().get_user_option('smtp_server')
3589
 
            if not server:
3590
 
                server = 'localhost'
3591
 
            s.connect(server)
3592
 
            s.sendmail(message['From'], message['To'], message.as_string())
 
3589
            s = SMTPConnection(branch.get_config())
 
3590
            s.send_email(message)
3593
3591
 
3594
3592
 
3595
3593
class cmd_tag(Command):