~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2007-08-09 19:30:31 UTC
  • mto: (2681.5.3 bzr-mail)
  • mto: This revision was merged to the branch mainline in revision 2736.
  • Revision ID: abentley@panoramicfeedback.com-20070809193031-efscxiwt74sxk5o1
Add Thunderbird support to bzr send

Show diffs side-by-side

added added

removed removed

Lines of Context:
3836
3836
    def run(self, submit_branch=None, public_branch=None, no_bundle=False,
3837
3837
            no_patch=False, revision=None, remember=False, output=None,
3838
3838
            format='4', **kwargs):
3839
 
        if output is None:
3840
 
            raise errors.BzrCommandError('File must be specified with'
3841
 
                                         ' --output')
3842
3839
        return self._run(submit_branch, revision, public_branch, remember,
3843
3840
                         format, no_bundle, no_patch, output,
3844
3841
                         kwargs.get('from', '.'))
3846
3843
    def _run(self, submit_branch, revision, public_branch, remember, format,
3847
3844
             no_bundle, no_patch, output, from_,):
3848
3845
        from bzrlib.revision import ensure_null, NULL_REVISION
3849
 
        if output == '-':
 
3846
        if output is None:
 
3847
            outfile = StringIO()
 
3848
        elif output == '-':
3850
3849
            outfile = self.outf
3851
3850
        else:
3852
3851
            outfile = open(output, 'wb')
3920
3919
                    message=None)
3921
3920
 
3922
3921
            outfile.writelines(directive.to_lines())
 
3922
            if output is None:
 
3923
                branch.get_config().get_mail_client().compose(None, None,
 
3924
                    outfile.getvalue())
3923
3925
        finally:
3924
3926
            if output != '-':
3925
3927
                outfile.close()