Mercurial > hg-stable
changeset 38417:26523316e4d0
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 18 Jun 2018 16:01:06 -0700 |
parents | 1c5c4a5dd86d |
children | a0e185f10454 |
files | tests/test-progress.t |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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):