comparison hgext/patchbomb.py @ 2198:564034552f7f

rename [patchbomb] section to [email] section in hgrc. old name still ok.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Thu, 04 May 2006 12:00:45 -0700
parents d821918e3bee
children 9f43b6e24232
comparison
equal deleted inserted replaced
2197:5de8b44f0446 2198:564034552f7f
42 # password = password # if SMTP authentication required - PLAINTEXT 42 # password = password # if SMTP authentication required - PLAINTEXT
43 # 43 #
44 # To configure other defaults, add a section like this to your hgrc 44 # To configure other defaults, add a section like this to your hgrc
45 # file: 45 # file:
46 # 46 #
47 # [patchbomb] 47 # [email]
48 # from = My Name <my@email> 48 # from = My Name <my@email>
49 # to = recipient1, recipient2, ... 49 # to = recipient1, recipient2, ...
50 # cc = cc1, cc2, ... 50 # cc = cc1, cc2, ...
51 51
52 from mercurial.demandload import * 52 from mercurial.demandload import *
181 181
182 for p, i in zip(patches, range(len(patches))): 182 for p, i in zip(patches, range(len(patches))):
183 jumbo.extend(p) 183 jumbo.extend(p)
184 msgs.append(makepatch(p, i + 1, len(patches))) 184 msgs.append(makepatch(p, i + 1, len(patches)))
185 185
186 sender = (opts['from'] or ui.config('patchbomb', 'from') or 186 sender = (opts['from'] or ui.config('email', 'from') or
187 ui.config('patchbomb', 'from') or
187 prompt('From', ui.username())) 188 prompt('From', ui.username()))
188 189
189 def getaddrs(opt, prpt, default = None): 190 def getaddrs(opt, prpt, default = None):
190 addrs = opts[opt] or (ui.config('patchbomb', opt) or 191 addrs = opts[opt] or (ui.config('email', opt) or
192 ui.config('patchbomb', opt) or
191 prompt(prpt, default = default)).split(',') 193 prompt(prpt, default = default)).split(',')
192 return [a.strip() for a in addrs if a.strip()] 194 return [a.strip() for a in addrs if a.strip()]
193 to = getaddrs('to', 'To') 195 to = getaddrs('to', 'To')
194 cc = getaddrs('cc', 'Cc', '') 196 cc = getaddrs('cc', 'Cc', '')
195 197