Patchwork D3812: tests: use progress helper

login
register
mail settings
Submitter phabricator
Date June 19, 2018, 12:45 a.m.
Message ID <differential-rev-PHID-DREV-l5wqc3lzrpw254m2eq4g-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/32318/
State Superseded
Headers show

Comments

phabricator - June 19, 2018, 12:45 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  With this commit, the only in-tree caller of ui.progress() is
  scmutil.progress(). That means that we could deprecate it. It also
  means that we can considering inlining it in scmutil.progress.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-progress.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-progress.t b/tests/test-progress.t
--- a/tests/test-progress.t
+++ b/tests/test-progress.t
@@ -33,20 +33,22 @@ 
   >         nested = True
   >     loops = abs(loops)
   > 
+  >     progress = ui.makeprogress(topiclabel, unit='loopnum', total=total)
+  >     other = ui.makeprogress('other', unit='othernum', total=total)
   >     for i in range(loops):
-  >         ui.progress(topiclabel, i, getloopitem(i), 'loopnum', total)
+  >         progress.update(i, item=getloopitem(i))
   >         if opts.get('parallel'):
-  >             ui.progress('other', i, 'other.%d' % i, 'othernum', total)
+  >             other.update(i, item='other.%d' % i)
   >         if nested:
   >             nested_steps = 2
   >             if i and i % 4 == 0:
   >                 nested_steps = 5
+  >             nested = ui.makeprogress('nested', unit='nestnum',
+  >                                      total=nested_steps)
   >             for j in range(nested_steps):
-  >                 ui.progress(
-  >                   'nested', j, 'nested.%d' % j, 'nestnum', nested_steps)
-  >             ui.progress(
-  >               'nested', None, 'nested.done', 'nestnum', nested_steps)
-  >     ui.progress(topiclabel, None, 'loop.done', 'loopnum', total)
+  >                 nested.update(j, item='nested.%d' % j)
+  >             nested.complete()
+  >     progress.complete()
   > 
   > topiclabel = 'loop'
   > def getloopitem(i):