Patchwork D5377: remotefilelog: use progress helper in remotefilelogserver

login
register
mail settings
Submitter phabricator
Date Dec. 6, 2018, 11:41 a.m.
Message ID <30c93fc521b2d3e98f35733d19a168a1@localhost.localdomain>
Download mbox | patch
Permalink /patch/37007/
State Not Applicable
Headers show

Comments

phabricator - Dec. 6, 2018, 11:41 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfbd053af2eda: remotefilelog: use progress helper in remotefilelogserver (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5377?vs=12716&id=12738

REVISION DETAIL
  https://phab.mercurial-scm.org/D5377

AFFECTED FILES
  hgext/remotefilelog/remotefilelogserver.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/remotefilelog/remotefilelogserver.py b/hgext/remotefilelog/remotefilelogserver.py
--- a/hgext/remotefilelog/remotefilelogserver.py
+++ b/hgext/remotefilelog/remotefilelogserver.py
@@ -388,19 +388,17 @@ 
     days = repo.ui.configint("remotefilelog", "serverexpiration")
     expiration = time.time() - (days * 24 * 60 * 60)
 
-    _removing = _("removing old server cache")
-    count = 0
-    ui.progress(_removing, count, unit="files")
+    progress = ui.makeprogress(_("removing old server cache"), unit="files")
+    progress.update(0)
     for root, dirs, files in os.walk(cachepath):
         for file in files:
             filepath = os.path.join(root, file)
-            count += 1
-            ui.progress(_removing, count, unit="files")
+            progress.increment()
             if filepath in neededfiles:
                 continue
 
             stat = os.stat(filepath)
             if stat.st_mtime < expiration:
                 os.remove(filepath)
 
-    ui.progress(_removing, None)
+    progress.complete()