hgext/patchbomb.py
changeset 36204 33ed8b511185
parent 35674 e711906aa42c
child 36410 67ec4ad815e6
equal deleted inserted replaced
36203:01280638bdb1 36204:33ed8b511185
   263             patchtags = [t for t in repo.nodetags(binnode)
   263             patchtags = [t for t in repo.nodetags(binnode)
   264                          if t.endswith('.patch') or t.endswith('.diff')]
   264                          if t.endswith('.patch') or t.endswith('.diff')]
   265             if patchtags:
   265             if patchtags:
   266                 patchname = patchtags[0]
   266                 patchname = patchtags[0]
   267             elif total > 1:
   267             elif total > 1:
   268                 patchname = cmdutil.makefilename(repo, '%b-%n.patch',
   268                 patchname = cmdutil.makefilename(repo[node], '%b-%n.patch',
   269                                                  binnode, seqno=idx,
   269                                                  seqno=idx, total=total)
   270                                                  total=total)
       
   271             else:
   270             else:
   272                 patchname = cmdutil.makefilename(repo, '%b.patch', binnode)
   271                 patchname = cmdutil.makefilename(repo[node], '%b.patch')
   273         disposition = 'inline'
   272         disposition = 'inline'
   274         if opts.get('attach'):
   273         if opts.get('attach'):
   275             disposition = 'attachment'
   274             disposition = 'attachment'
   276         p['Content-Disposition'] = disposition + '; filename=' + patchname
   275         p['Content-Disposition'] = disposition + '; filename=' + patchname
   277         msg.attach(p)
   276         msg.attach(p)