hgext/patchbomb.py
changeset 31185 bbb5d2aa0bf0
parent 31184 e3ab7c717129
child 31186 83fa357edbd5
equal deleted inserted replaced
31184:e3ab7c717129 31185:bbb5d2aa0bf0
   338     msg = mail.mimeencode(ui, body, _charsets, opts.get('test'))
   338     msg = mail.mimeencode(ui, body, _charsets, opts.get('test'))
   339     msg['Subject'] = mail.headencode(ui, subj, _charsets,
   339     msg['Subject'] = mail.headencode(ui, subj, _charsets,
   340                                      opts.get('test'))
   340                                      opts.get('test'))
   341     return (msg, subj, diffstat)
   341     return (msg, subj, diffstat)
   342 
   342 
   343 def _getpatchmsgs(repo, sender, patches, patchnames=None, **opts):
   343 def _getpatchmsgs(repo, sender, revs, patchnames=None, **opts):
   344     """return a list of emails from a list of patches
   344     """return a list of emails from a list of patches
   345 
   345 
   346     This involves introduction message creation if necessary.
   346     This involves introduction message creation if necessary.
   347 
   347 
   348     This function returns a list of "email" tuples (subject, content, None).
   348     This function returns a list of "email" tuples (subject, content, None).
   349     """
   349     """
   350     ui = repo.ui
   350     ui = repo.ui
   351     _charsets = mail._charsets(ui)
   351     _charsets = mail._charsets(ui)
       
   352     patches = list(_getpatches(repo, revs, **opts))
   352     msgs = []
   353     msgs = []
   353 
   354 
   354     ui.write(_('this patch series consists of %d patches.\n\n')
   355     ui.write(_('this patch series consists of %d patches.\n\n')
   355              % len(patches))
   356              % len(patches))
   356 
   357 
   595         bundledata = _getbundle(repo, dest, **opts)
   596         bundledata = _getbundle(repo, dest, **opts)
   596         bundleopts = opts.copy()
   597         bundleopts = opts.copy()
   597         bundleopts.pop('bundle', None)  # already processed
   598         bundleopts.pop('bundle', None)  # already processed
   598         msgs = _getbundlemsgs(repo, sender, bundledata, **bundleopts)
   599         msgs = _getbundlemsgs(repo, sender, bundledata, **bundleopts)
   599     else:
   600     else:
   600         _patches = list(_getpatches(repo, revs, **opts))
   601         msgs = _getpatchmsgs(repo, sender, revs, **opts)
   601         msgs = _getpatchmsgs(repo, sender, _patches, **opts)
       
   602 
   602 
   603     showaddrs = []
   603     showaddrs = []
   604 
   604 
   605     def getaddrs(header, ask=False, default=None):
   605     def getaddrs(header, ask=False, default=None):
   606         configkey = header.lower()
   606         configkey = header.lower()