# HG changeset patch # User Martin von Zweigbergk # Date 2018-06-18 21:34:07 # Node ID 8ce3f91d5f6f93718d1cdff99de7b108216bd30c # Parent 457fa4056286484228e733034856e12fe1d44627 patchbomb: use progress helper Differential Revision: https://phab.mercurial-scm.org/D3804 diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -751,6 +751,7 @@ def email(ui, repo, *revs, **opts): 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,8 +792,7 @@ def email(ui, repo, *revs, **opts): 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'] @@ -801,4 +801,4 @@ def email(ui, repo, *revs, **opts): generator.flatten(m, 0) sendmail(sender_addr, to + bcc + cc, fp.getvalue()) - ui.progress(_('sending'), None) + progress.complete()