# HG changeset patch # User Martin von Zweigbergk # Date 2018-12-05 00:02:56 # Node ID 05afb32e93809d983dbb1e89cec50938a9d59dc0 # Parent dd1006874a5aa49f03955f438fbab7effddecfbf remotefilelog: use progress helper when analyzing repos Differential Revision: https://phab.mercurial-scm.org/D5375 diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py --- a/hgext/remotefilelog/__init__.py +++ b/hgext/remotefilelog/__init__.py @@ -811,14 +811,14 @@ def gcclient(ui, cachepath): validrepos = [] keepkeys = set() - _analyzing = _("analyzing repositories") - sharedcache = None filesrepacked = False count = 0 + progress = ui.makeprogress(_("analyzing repositories"), unit="repos", + total=len(repos)) for path in repos: - ui.progress(_analyzing, count, unit="repos", total=len(repos)) + progress.update(count) count += 1 try: path = ui.expandpath(os.path.normpath(path)) @@ -868,7 +868,7 @@ def gcclient(ui, cachepath): return fileserverclient.getcachekey(reponame, fname, hex(fnode)) keepkeys = repackmod.keepset(repo, keyfn=keyfn, lastkeepkeys=keepkeys) - ui.progress(_analyzing, None) + progress.complete() # write list of valid repos back oldumask = os.umask(0o002)