hgext/patchbomb.py
changeset 1672 07f931af5f40
parent 1670 fe19c54ee403
child 1673 bd53710c7780
equal deleted inserted replaced
1670:fe19c54ee403 1672:07f931af5f40
    48 from email.MIMEMultipart import MIMEMultipart
    48 from email.MIMEMultipart import MIMEMultipart
    49 from email.MIMEText import MIMEText
    49 from email.MIMEText import MIMEText
    50 from mercurial import commands
    50 from mercurial import commands
    51 from mercurial import hg
    51 from mercurial import hg
    52 from mercurial import ui
    52 from mercurial import ui
       
    53 from mercurial.i18n import gettext as _
    53 import os
    54 import os
    54 import popen2
    55 import popen2
    55 import smtplib
    56 import smtplib
    56 import socket
    57 import socket
    57 import sys
    58 import sys
    84     finally:
    85     finally:
    85         try: os.unlink(name)
    86         try: os.unlink(name)
    86         except: pass
    87         except: pass
    87 
    88 
    88 def patchbomb(ui, repo, *revs, **opts):
    89 def patchbomb(ui, repo, *revs, **opts):
    89     '''send changesets as a series of patch emails'''
    90     '''send changesets as a series of patch emails
       
    91 
       
    92     The series starts with a "[PATCH 0 of N]" introduction, which
       
    93     describes the series as a whole.
       
    94 
       
    95     Each patch email has a Subject line of "[PATCH M of N] ...", using
       
    96     the first line of the changeset description as the subject text.
       
    97     The message contains two or three body parts.  First, the rest of
       
    98     the changeset description.  Next, (optionally) if the diffstat
       
    99     program is installed, the result of running diffstat on the patch.
       
   100     Finally, the patch itself, as generated by "hg export".'''
    90     def prompt(prompt, default = None, rest = ': ', empty_ok = False):
   101     def prompt(prompt, default = None, rest = ': ', empty_ok = False):
    91         if default: prompt += ' [%s]' % default
   102         if default: prompt += ' [%s]' % default
    92         prompt += rest
   103         prompt += rest
    93         while True:
   104         while True:
    94             r = raw_input(prompt)
   105             r = raw_input(prompt)