# HG changeset patch # User Martin von Zweigbergk # Date 2018-06-18 23:01:06 # 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 --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):