verify: find correct first corrupted cset for missing/corrupted revlogs
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sat, 07 Mar 2009 20:16:03 +0100
changeset 7833 794def2fe232
parent 7832 1fce19b9b011
child 7834 2444285ec338
child 7837 db39b6c3da48
verify: find correct first corrupted cset for missing/corrupted revlogs
mercurial/verify.py
tests/test-fncache.out
--- a/mercurial/verify.py	Sat Mar 07 20:04:56 2009 +0100
+++ b/mercurial/verify.py	Sat Mar 07 20:16:03 2009 +0100
@@ -172,17 +172,18 @@
 
     files = util.sort(util.unique(filenodes.keys() + filelinkrevs.keys()))
     for f in files:
+        lr = filelinkrevs[f][0]
         try:
             fl = repo.file(f)
         except error.RevlogError, e:
-            err(0, _("broken revlog! (%s)") % e, f)
+            err(lr, _("broken revlog! (%s)") % e, f)
             continue
 
         for ff in fl.files():
             try:
                 del storefiles[ff]
             except KeyError:
-                err(0, _("missing revlog!"), ff)
+                err(lr, _("missing revlog!"), ff)
 
         checklog(fl, f)
         seen = {}
--- a/tests/test-fncache.out	Sat Mar 07 20:04:56 2009 +0100
+++ b/tests/test-fncache.out	Sat Mar 07 20:16:03 2009 +0100
@@ -36,8 +36,8 @@
 crosschecking files in changesets and manifests
 checking files
  data/a.i@0: missing revlog!
- data/a.i.hg.hg/c.i@0: missing revlog!
- data/a.i.hg/b.i@0: missing revlog!
+ data/a.i.hg.hg/c.i@2: missing revlog!
+ data/a.i.hg/b.i@1: missing revlog!
 3 files, 3 changesets, 3 total revisions
 3 integrity errors encountered!
 (first damaged changeset appears to be 0)