Mercurial > hg
changeset 9657:96c803e9018f
verify: filter the candidate list for broken linkrevs
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 28 Oct 2009 13:17:03 -0500 |
parents | 2ae3758526d8 |
children | 852b1f3032d2 d942e06d7b14 |
files | mercurial/verify.py |
diffstat | 1 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/verify.py Tue Oct 27 17:14:19 2009 -0500 +++ b/mercurial/verify.py Wed Oct 28 13:17:03 2009 -0500 @@ -27,6 +27,7 @@ ui = repo.ui cl = repo.changelog mf = repo.manifest + lrugetctx = util.lrucachefunc(repo.changectx) if not repo.cancopy(): raise util.Abort(_("cannot verify bundle or remote repos")) @@ -78,6 +79,13 @@ msg = _("rev %d points to unexpected changeset %d") err(None, msg % (i, lr), f) if linkrevs: + if f and len(linkrevs) > 1: + try: + # attempt to filter down to real linkrevs + linkrevs = [l for l in linkrevs + if lrugetctx(l)[f].filenode() == node] + except: + pass warn(_(" (expected %s)") % " ".join(map(str, linkrevs))) lr = None # can't be trusted @@ -136,9 +144,7 @@ if not f: err(lr, _("file without name in manifest")) elif f != "/dev/null": - fns = filenodes.setdefault(f, {}) - if fn not in fns: - fns[fn] = i + filenodes.setdefault(f, {}).setdefault(fn, lr) except Exception, inst: exc(lr, _("reading manifest delta %s") % short(n), inst) @@ -173,7 +179,6 @@ elif size > 0: storefiles.add(f) - lrugetctx = util.lrucachefunc(repo.changectx) files = sorted(set(filenodes) | set(filelinkrevs)) for f in files: try: @@ -250,7 +255,7 @@ # cross-check if f in filenodes: - fns = [(mf.linkrev(l), n) for n,l in filenodes[f].iteritems()] + 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)