tests: use progress helper
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.
Differential Revision: https://phab.mercurial-scm.org/D3812
--- a/tests/test-progress.t Mon Jun 18 15:55:38 2018 -0700
+++ b/tests/test-progress.t Mon Jun 18 16:01:06 2018 -0700
@@ -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):