##// END OF EJS Templates
verify: show progress while verifying dirlogs...
verify: show progress while verifying dirlogs In repos with treemanifests, the non-root-directory dirlogs often have many more total revisions than the root manifest log has. This change adds progress out to that part of 'hg verify'. Since the verification is recursive along the directory tree, we don't know how many total revisions there are at the beginning of the command, so instead we report progress in units of directories, much like we report progress for verification of files today. I'm not very happy with passing both 'storefiles' and 'progress' into the recursive calls. I tried passing in just a 'visitdir(dir)' callback, but the results did not seem better overall. I'm happy to update if anyone has better ideas.

File last commit:

r25979:b723f05e default
r28205:53f42c8d default
Show More
strutil.py
36 lines | 953 B | text/x-python | PythonLexer
# strutil.py - string utilities for Mercurial
#
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
def findall(haystack, needle, start=0, end=None):
if end is None:
end = len(haystack)
if end < 0:
end += len(haystack)
if start < 0:
start += len(haystack)
while start < end:
c = haystack.find(needle, start, end)
if c == -1:
break
yield c
start = c + 1
def rfindall(haystack, needle, start=0, end=None):
if end is None:
end = len(haystack)
if end < 0:
end += len(haystack)
if start < 0:
start += len(haystack)
while end >= 0:
c = haystack.rfind(needle, start, end)
if c == -1:
break
yield c
end = c - 1