[PATCH 07 of 15 RFC] verify: avoid walking in store area at partial verification

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Wed Oct 3 11:39:04 CDT 2012


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1349281445 -32400
# Node ID 3ed256772546976661ffa4f45b5872aa1f71968f
# Parent  6f11a34c781de8ad21b58e03958474c8d69bdef5
verify: avoid walking in store area at partial verification

Verify module walks through store area to get all data files of
filelog.

Such walking is not needed at partial verification, because only
filelogs related to verification target revisions should be checked in
such case for performance reason.

This patch avoids such walking/verification at partial verification.

diff -r 6f11a34c781d -r 3ed256772546 mercurial/verify.py
--- a/mercurial/verify.py	Thu Oct 04 01:24:05 2012 +0900
+++ b/mercurial/verify.py	Thu Oct 04 01:24:05 2012 +0900
@@ -213,7 +213,11 @@
     ui.status(_("checking files\n"))
 
     storefiles = set()
-    for f, f2, size in repo.store.datafiles():
+    if partially:
+        datafiles = []
+    else:
+        datafiles = repo.store.datafiles()
+    for f, f2, size in datafiles:
         if not f:
             err(None, _("cannot decode filename '%s'") % f2)
         elif size > 0 or not revlogv1:
@@ -240,7 +244,11 @@
             err(lr, _("broken revlog! (%s)") % e, f)
             continue
 
-        for ff in fl.files():
+        if partially:
+            flfiles = []
+        else:
+            flfiles = fl.files()
+        for ff in flfiles:
             try:
                 storefiles.remove(ff)
             except KeyError:


More information about the Mercurial-devel mailing list