hgext/patchbomb.py
changeset 31194 e3ab7c717129
parent 31193 8018b90f8307
child 31195 bbb5d2aa0bf0
equal deleted inserted replaced
31193:8018b90f8307 31194:e3ab7c717129
   512     bundle = opts.get('bundle')
   512     bundle = opts.get('bundle')
   513     date = opts.get('date')
   513     date = opts.get('date')
   514     mbox = opts.get('mbox')
   514     mbox = opts.get('mbox')
   515     outgoing = opts.get('outgoing')
   515     outgoing = opts.get('outgoing')
   516     rev = opts.get('rev')
   516     rev = opts.get('rev')
   517     # internal option used by pbranches
       
   518     patches = opts.get('patches')
       
   519 
   517 
   520     if not (opts.get('test') or mbox):
   518     if not (opts.get('test') or mbox):
   521         # really sending
   519         # really sending
   522         mail.validateconfig(ui)
   520         mail.validateconfig(ui)
   523 
   521 
   524     if not (revs or rev or outgoing or bundle or patches):
   522     if not (revs or rev or outgoing or bundle):
   525         raise error.Abort(_('specify at least one changeset with -r or -o'))
   523         raise error.Abort(_('specify at least one changeset with -r or -o'))
   526 
   524 
   527     if outgoing and bundle:
   525     if outgoing and bundle:
   528         raise error.Abort(_("--outgoing mode always on with --bundle;"
   526         raise error.Abort(_("--outgoing mode always on with --bundle;"
   529                            " do not re-specify --outgoing"))
   527                            " do not re-specify --outgoing"))
   591     # deprecated config: patchbomb.from
   589     # deprecated config: patchbomb.from
   592     sender = (opts.get('from') or ui.config('email', 'from') or
   590     sender = (opts.get('from') or ui.config('email', 'from') or
   593               ui.config('patchbomb', 'from') or
   591               ui.config('patchbomb', 'from') or
   594               prompt(ui, 'From', ui.username()))
   592               prompt(ui, 'From', ui.username()))
   595 
   593 
   596     if patches:
   594     if bundle:
   597         msgs = _getpatchmsgs(repo, sender, patches, opts.get('patchnames'),
       
   598                              **opts)
       
   599     elif bundle:
       
   600         bundledata = _getbundle(repo, dest, **opts)
   595         bundledata = _getbundle(repo, dest, **opts)
   601         bundleopts = opts.copy()
   596         bundleopts = opts.copy()
   602         bundleopts.pop('bundle', None)  # already processed
   597         bundleopts.pop('bundle', None)  # already processed
   603         msgs = _getbundlemsgs(repo, sender, bundledata, **bundleopts)
   598         msgs = _getbundlemsgs(repo, sender, bundledata, **bundleopts)
   604     else:
   599     else: