hgext/patchbomb.py
branchstable
changeset 17859 d38d90ad5bbf
parent 17178 8308f6284640
child 17880 9f6044119166
equal deleted inserted replaced
17858:acd4577a568d 17859:d38d90ad5bbf
   494         if not parent.startswith('<'):
   494         if not parent.startswith('<'):
   495             parent = '<' + parent
   495             parent = '<' + parent
   496         if not parent.endswith('>'):
   496         if not parent.endswith('>'):
   497             parent += '>'
   497             parent += '>'
   498 
   498 
   499     first = True
       
   500 
       
   501     sender_addr = email.Utils.parseaddr(sender)[1]
   499     sender_addr = email.Utils.parseaddr(sender)[1]
   502     sender = mail.addressencode(ui, sender, _charsets, opts.get('test'))
   500     sender = mail.addressencode(ui, sender, _charsets, opts.get('test'))
   503     sendmail = None
   501     sendmail = None
   504     for i, (m, subj, ds) in enumerate(msgs):
   502     for i, (m, subj, ds) in enumerate(msgs):
   505         try:
   503         try:
   507         except TypeError:
   505         except TypeError:
   508             m['Message-Id'] = genmsgid('patchbomb')
   506             m['Message-Id'] = genmsgid('patchbomb')
   509         if parent:
   507         if parent:
   510             m['In-Reply-To'] = parent
   508             m['In-Reply-To'] = parent
   511             m['References'] = parent
   509             m['References'] = parent
   512         if first:
   510         if not parent or 'X-Mercurial-Node' not in m:
   513             parent = m['Message-Id']
   511             parent = m['Message-Id']
   514             first = False
       
   515 
   512 
   516         m['User-Agent'] = 'Mercurial-patchbomb/%s' % util.version()
   513         m['User-Agent'] = 'Mercurial-patchbomb/%s' % util.version()
   517         m['Date'] = email.Utils.formatdate(start_time[0], localtime=True)
   514         m['Date'] = email.Utils.formatdate(start_time[0], localtime=True)
   518 
   515 
   519         start_time = (start_time[0] + 1, start_time[1])
   516         start_time = (start_time[0] + 1, start_time[1])