# HG changeset patch # User Augie Fackler # Date 2010-02-11 00:46:19 # Node ID 767fbacb3ddc83cb2243e7595835a2b892393248 # Parent 8a8030fc57d61648afb44f767323dc4f72760986 verify: call ui.progress() diff --git a/mercurial/verify.py b/mercurial/verify.py --- a/mercurial/verify.py +++ b/mercurial/verify.py @@ -120,7 +120,9 @@ def _verify(repo): ui.status(_("checking changesets\n")) seen = {} checklog(cl, "changelog", 0) + total = len(repo) for i in repo: + ui.progress('changelog', i, total=total) n = cl.node(i) checkentry(cl, i, n, seen, [i], "changelog") @@ -131,11 +133,14 @@ def _verify(repo): filelinkrevs.setdefault(f, []).append(i) except Exception, inst: exc(i, _("unpacking changeset %s") % short(n), inst) + ui.progress('changelog', None) ui.status(_("checking manifests\n")) seen = {} checklog(mf, "manifest", 0) + total = len(mf) for i in mf: + ui.progress('manifests', i, total=total) n = mf.node(i) lr = checkentry(mf, i, n, seen, mflinkrevs.get(n, []), "manifest") if n in mflinkrevs: @@ -151,22 +156,31 @@ def _verify(repo): filenodes.setdefault(f, {}).setdefault(fn, lr) except Exception, inst: exc(lr, _("reading manifest delta %s") % short(n), inst) + ui.progress('manifests', None) ui.status(_("crosschecking files in changesets and manifests\n")) + total = len(mflinkrevs) + len(filelinkrevs) + len(filenodes) + count = 0 if havemf: for c, m in sorted([(c, m) for m in mflinkrevs for c in mflinkrevs[m]]): + count += 1 + ui.progress('crosscheck', count, total=total) err(c, _("changeset refers to unknown manifest %s") % short(m)) mflinkrevs = None # del is bad here due to scope issues for f in sorted(filelinkrevs): + count += 1 + ui.progress('crosscheck', count, total=total) if f not in filenodes: lr = filelinkrevs[f][0] err(lr, _("in changeset but not in manifest"), f) if havecl: for f in sorted(filenodes): + count += 1 + ui.progress('crosscheck', count, total=total) if f not in filelinkrevs: try: fl = repo.file(f) @@ -175,6 +189,8 @@ def _verify(repo): lr = None err(lr, _("in manifest but not in changeset"), f) + ui.progress('crosscheck', None) + ui.status(_("checking files\n")) storefiles = set() @@ -185,7 +201,9 @@ def _verify(repo): storefiles.add(f) files = sorted(set(filenodes) | set(filelinkrevs)) - for f in files: + total = len(files) + for i, f in enumerate(files): + ui.progress('files', i, item=f, total=total) try: linkrevs = filelinkrevs[f] except KeyError: @@ -263,6 +281,7 @@ def _verify(repo): fns = [(lr, n) for n, lr in filenodes[f].iteritems()] for lr, node in sorted(fns): err(lr, _("%s in manifests not found") % short(node), f) + ui.progress('files', None) for f in storefiles: warn(_("warning: orphan revlog '%s'") % f)