Comments
Patch
@@ -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()