##// END OF EJS Templates
remotefilelog: use progress helper in remotefilelogserver...
Martin von Zweigbergk -
r40877:fbd053af default
parent child Browse files
Show More
@@ -388,14 +388,12 b' def gcserver(ui, repo):'
388 days = repo.ui.configint("remotefilelog", "serverexpiration")
388 days = repo.ui.configint("remotefilelog", "serverexpiration")
389 expiration = time.time() - (days * 24 * 60 * 60)
389 expiration = time.time() - (days * 24 * 60 * 60)
390
390
391 _removing = _("removing old server cache")
391 progress = ui.makeprogress(_("removing old server cache"), unit="files")
392 count = 0
392 progress.update(0)
393 ui.progress(_removing, count, unit="files")
394 for root, dirs, files in os.walk(cachepath):
393 for root, dirs, files in os.walk(cachepath):
395 for file in files:
394 for file in files:
396 filepath = os.path.join(root, file)
395 filepath = os.path.join(root, file)
397 count += 1
396 progress.increment()
398 ui.progress(_removing, count, unit="files")
399 if filepath in neededfiles:
397 if filepath in neededfiles:
400 continue
398 continue
401
399
@@ -403,4 +401,4 b' def gcserver(ui, repo):'
403 if stat.st_mtime < expiration:
401 if stat.st_mtime < expiration:
404 os.remove(filepath)
402 os.remove(filepath)
405
403
406 ui.progress(_removing, None)
404 progress.complete()
General Comments 0
You need to be logged in to leave comments. Login now