diff --git a/contrib/synthrepo.py b/contrib/synthrepo.py --- a/contrib/synthrepo.py +++ b/contrib/synthrepo.py @@ -172,13 +172,10 @@ revs = scmutil.revrange(repo, revs) revs.sort() - progress = ui.progress - _analyzing = _('analyzing') - _changesets = _('changesets') - _total = len(revs) - + progress = ui.makeprogress(_('analyzing'), unit=_('changesets'), + total=len(revs)) for i, rev in enumerate(revs): - progress(_analyzing, i, unit=_changesets, total=_total) + progress.update(i) ctx = repo[rev] pl = ctx.parents() pctx = pl[0] @@ -338,7 +335,6 @@ nevertouch = {'.hgsub', '.hgignore', '.hgtags'} - progress = ui.progress _synthesizing = _('synthesizing') _files = _('initial files') _changesets = _('changesets') @@ -362,8 +358,9 @@ path = os.path.dirname(path) return True + progress = ui.makeprogress(_synthesizing, unit=_files, total=initcount) for i in xrange(0, initcount): - ui.progress(_synthesizing, i, unit=_files, total=initcount) + progress.update(i) path = pickpath() while not validpath(path): @@ -378,7 +375,7 @@ def filectxfn(repo, memctx, path): return context.memfilectx(repo, memctx, path, files[path]) - ui.progress(_synthesizing, None) + progress.complete() message = 'synthesized wide repo with %d files' % (len(files),) mc = context.memctx(repo, [pctx.node(), nullid], message, files, filectxfn, ui.username(), @@ -394,8 +391,9 @@ # Synthesize incremental revisions to the repository, adding repo depth. count = int(opts['count']) heads = set(map(repo.changelog.rev, repo.heads())) + progress = ui.makeprogress(_synthesizing, unit=_changesets, total=count) for i in xrange(count): - progress(_synthesizing, i, unit=_changesets, total=count) + progress.update(i) node = repo.changelog.node revs = len(repo)