From patchwork Tue Jun 19 11:17:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D3802: churn: use progess helper From: phabricator X-Patchwork-Id: 32320 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Tue, 19 Jun 2018 11:17:58 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHG5c0f06a8b497: churn: use progess helper (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3802?vs=9204&id=9218 REVISION DETAIL https://phab.mercurial-scm.org/D3802 AFFECTED FILES hgext/churn.py CHANGE DETAILS To: martinvonz, #hg-reviewers, pulkit Cc: mercurial-devel diff --git a/hgext/churn.py b/hgext/churn.py --- a/hgext/churn.py +++ b/hgext/churn.py @@ -61,7 +61,8 @@ tmpl.show(ctx) return ui.popbuffer() - state = {'count': 0} + progress = ui.makeprogress(_('analyzing'), unit=_('revisions'), + total=len(repo)) rate = {} df = False if opts.get('date'): @@ -87,14 +88,12 @@ lines = changedlines(ui, repo, ctx1, ctx, fns) rate[key] = [r + l for r, l in zip(rate.get(key, (0, 0)), lines)] - state['count'] += 1 - ui.progress(_('analyzing'), state['count'], total=len(repo), - unit=_('revisions')) + progress.increment() for ctx in cmdutil.walkchangerevs(repo, m, opts, prep): continue - ui.progress(_('analyzing'), None) + progress.complete() return rate