Attachment "verify_at_commit.diff" to
ticket [76d3ecfd]
added by
anonymous
2010-10-03 04:00:09.
Index: src/verify.c
===================================================================
--- src/verify.c
+++ src/verify.c
@@ -69,18 +69,34 @@
**
** Invoke verify_rid() on every record that has been added or modified
** in the repository, in order to make sure that the repository is sane.
*/
static int verify_at_commit(void){
- int rid;
+ int rid, log_progress, count, total;
content_clear_cache();
inFinalVerify = 1;
+ count = 0;
+ total = bag_count(&toVerify);
+ if (!g.fQuiet && total > 1000) {
+ log_progress = 1;
+ } else {
+ log_progress = 0;
+ }
+
rid = bag_first(&toVerify);
while( rid>0 ){
+ if (log_progress) {
+ printf("%d (%d%%)...\r", count, (count * 100) / total);
+ fflush(stdout);
+ }
+ ++count;
verify_rid(rid);
rid = bag_next(&toVerify, rid);
}
+ if (log_progress)
+ printf("\n");
+
bag_clear(&toVerify);
inFinalVerify = 0;
return 0;
}