# HG changeset patch # User Martin von Zweigbergk # Date 1529362866 25200 # Node ID 26523316e4d076c244edd4e4d093ccdb15824dcb # Parent 1c5c4a5dd86d02670f907f12403e92cee05674fb 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 diff -r 1c5c4a5dd86d -r 26523316e4d0 tests/test-progress.t --- 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):