# HG changeset patch # User bos@serpentine.internal.keyresearch.com # Date 1125342937 25200 # Node ID c3cb9f39a91f893e803c011afb3e602531a0963d # Parent fa9ae7df88a94498ed1dfdaf90c5444176b944e4 patchbomb: fix up confusion between strings and lists of strings. diff -r fa9ae7df88a9 -r c3cb9f39a91f contrib/patchbomb --- a/contrib/patchbomb Mon Aug 29 20:37:07 2005 +0200 +++ b/contrib/patchbomb Mon Aug 29 12:15:37 2005 -0700 @@ -172,11 +172,13 @@ len(patches), opts['subject'] or prompt('Subject:', rest = ' [PATCH 0 of %d] ' % len(patches))) - to = opts['to'] or ui.config('patchbomb', 'to') or prompt('To') - to = [t.strip() for t in to.split(',')] - cc = (opts['cc'] or ui.config('patchbomb', 'cc') or - prompt('Cc', default = '')) - cc = (cc and [c.strip() for c in cc.split(',')]) or [] + + def getaddrs(opt, prpt, default = None): + addrs = opts[opt] or (ui.config('patchbomb', opt) or + prompt(prpt, default = default)).split(',') + return [a.strip() for a in addrs if a.strip()] + to = getaddrs('to', 'To') + cc = getaddrs('cc', 'Cc', '') ui.write('Finish with ^D or a dot on a line by itself.\n\n')