Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0.1, 1.0.2, and 1.0.3

stable hgemail: set "from" address in the same manner as patchbomb

patchbomb falls back to ui.username() if email.from not specified.

Changeset 74162cb38473

Parent 2f7e2d68dc1e

by Yuya Nishihara

Changes to one file · Browse files at 74162cb38473 Showing diff from parent 2f7e2d68dc1e Diff from another changeset...

 
211
212
213
 
 
 
 
 
 
 
 
 
 
214
215
216
217
218
 
219
220
221
 
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
 
228
229
230
231
@@ -211,11 +211,21 @@
  self.repo = None   return   + def getfromaddr(ui): + """Get sender address in the same manner as patchbomb""" + addr = ui.config('email', 'from') or ui.config('patchbomb', 'from') + if addr: + return addr + try: + return repo.ui.username() + except error.Abort: + return '' +   if initial:   # Only zap these fields at startup   self._tobox.child.set_text(hglib.fromutf(repo.ui.config('email', 'to', '')))   self._ccbox.child.set_text(hglib.fromutf(repo.ui.config('email', 'cc', ''))) - self._frombox.child.set_text(hglib.fromutf(repo.ui.config('email', 'from', ''))) + self._frombox.child.set_text(hglib.fromutf(getfromaddr(repo.ui)))   self._subjbox.child.set_text(hglib.fromutf(repo.ui.config('email', 'subject', '')))   self.tooltips.set_tip(self._eventbox,   _('Patch series description is sent in initial summary'