Patchwork D3804: patchbomb: use progress helper

login
register
mail settings
Submitter phabricator
Date June 19, 2018, 11:18 a.m.
Message ID <af10dbc7caa1bc1ce8ab06a3d84d7401@localhost.localdomain>
Download mbox | patch
Permalink /patch/32322/
State Not Applicable
Headers show

Comments

phabricator - June 19, 2018, 11:18 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG8ce3f91d5f6f: patchbomb: use progress helper (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3804?vs=9206&id=9220

REVISION DETAIL
  https://phab.mercurial-scm.org/D3804

AFFECTED FILES
  hgext/patchbomb.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -751,6 +751,7 @@ 
     sender = mail.addressencode(ui, sender, _charsets, opts.get('test'))
     sendmail = None
     firstpatch = None
+    progress = ui.makeprogress(_('sending'), unit=_('emails'), total=len(msgs))
     for i, (m, subj, ds) in enumerate(msgs):
         try:
             m['Message-Id'] = genmsgid(m['X-Mercurial-Node'])
@@ -791,14 +792,13 @@ 
             if not sendmail:
                 sendmail = mail.connect(ui, mbox=mbox)
             ui.status(_('sending '), subj, ' ...\n')
-            ui.progress(_('sending'), i, item=subj, total=len(msgs),
-                        unit=_('emails'))
+            progress.update(i, item=subj)
             if not mbox:
                 # Exim does not remove the Bcc field
                 del m['Bcc']
             fp = stringio()
             generator = emailgen.Generator(fp, mangle_from_=False)
             generator.flatten(m, 0)
             sendmail(sender_addr, to + bcc + cc, fp.getvalue())
 
-    ui.progress(_('sending'), None)
+    progress.complete()