Fossil SCM

Do not clutter the output of "test-integrity" with reports of phantoms.

drh 2026-10-16 14:36 UTC trunk
Commit 1cdc7e830db6faae67415f4df3c4831870a58c8c5dbb4ee9ea058c711bfb1525
1 file changed +7 -2
+7 -2
--- src/content.c
+++ src/content.c
@@ -1005,10 +1005,11 @@
10051005
int n1 = 0;
10061006
int n2 = 0;
10071007
int nErr = 0;
10081008
int total;
10091009
int nCA = 0;
1010
+ int nPhantom = 0;
10101011
int anCA[10];
10111012
int bParse = find_option("parse",0,0)!=0;
10121013
int bDbOnly = find_option("db-only","d",0)!=0;
10131014
int bQuick = find_option("quick",0,0)!=0;
10141015
db_find_and_open_repository(OPEN_ANY_SCHEMA, 2);
@@ -1056,11 +1057,11 @@
10561057
int size = db_column_int(&q, 2);
10571058
n1++;
10581059
fossil_print(" %d/%d\r", n1, total);
10591060
fflush(stdout);
10601061
if( size<0 ){
1061
- fossil_print("skip phantom %d %s\n", rid, zUuid);
1062
+ nPhantom++;
10621063
continue; /* Ignore phantoms */
10631064
}
10641065
content_get(rid, &content);
10651066
if( (int)blob_size(&content)!=size ){
10661067
fossil_print("size mismatch on artifact %d: wanted %d but got %d\n",
@@ -1101,12 +1102,16 @@
11011102
blob_reset(&content);
11021103
}
11031104
n2++;
11041105
}
11051106
db_finalize(&q);
1106
- fossil_print("%d non-phantom blobs (out of %d total) checked: %d errors\n",
1107
+ if( nPhantom>0 ){
1108
+ fossil_print("%d non-phantom blobs (out of %d total) checked: %d errors\n",
11071109
n2, n1, nErr);
1110
+ }else{
1111
+ fossil_print("all %d blobs checked: %d errors\n", n1, nErr);
1112
+ }
11081113
if( bParse ){
11091114
static const char *const azType[] = { 0, "manifest", "cluster",
11101115
"control", "wiki", "ticket", "attachment", "event" };
11111116
int i;
11121117
fossil_print("%d total control artifacts\n", nCA);
11131118
--- src/content.c
+++ src/content.c
@@ -1005,10 +1005,11 @@
1005 int n1 = 0;
1006 int n2 = 0;
1007 int nErr = 0;
1008 int total;
1009 int nCA = 0;
 
1010 int anCA[10];
1011 int bParse = find_option("parse",0,0)!=0;
1012 int bDbOnly = find_option("db-only","d",0)!=0;
1013 int bQuick = find_option("quick",0,0)!=0;
1014 db_find_and_open_repository(OPEN_ANY_SCHEMA, 2);
@@ -1056,11 +1057,11 @@
1056 int size = db_column_int(&q, 2);
1057 n1++;
1058 fossil_print(" %d/%d\r", n1, total);
1059 fflush(stdout);
1060 if( size<0 ){
1061 fossil_print("skip phantom %d %s\n", rid, zUuid);
1062 continue; /* Ignore phantoms */
1063 }
1064 content_get(rid, &content);
1065 if( (int)blob_size(&content)!=size ){
1066 fossil_print("size mismatch on artifact %d: wanted %d but got %d\n",
@@ -1101,12 +1102,16 @@
1101 blob_reset(&content);
1102 }
1103 n2++;
1104 }
1105 db_finalize(&q);
1106 fossil_print("%d non-phantom blobs (out of %d total) checked: %d errors\n",
 
1107 n2, n1, nErr);
 
 
 
1108 if( bParse ){
1109 static const char *const azType[] = { 0, "manifest", "cluster",
1110 "control", "wiki", "ticket", "attachment", "event" };
1111 int i;
1112 fossil_print("%d total control artifacts\n", nCA);
1113
--- src/content.c
+++ src/content.c
@@ -1005,10 +1005,11 @@
1005 int n1 = 0;
1006 int n2 = 0;
1007 int nErr = 0;
1008 int total;
1009 int nCA = 0;
1010 int nPhantom = 0;
1011 int anCA[10];
1012 int bParse = find_option("parse",0,0)!=0;
1013 int bDbOnly = find_option("db-only","d",0)!=0;
1014 int bQuick = find_option("quick",0,0)!=0;
1015 db_find_and_open_repository(OPEN_ANY_SCHEMA, 2);
@@ -1056,11 +1057,11 @@
1057 int size = db_column_int(&q, 2);
1058 n1++;
1059 fossil_print(" %d/%d\r", n1, total);
1060 fflush(stdout);
1061 if( size<0 ){
1062 nPhantom++;
1063 continue; /* Ignore phantoms */
1064 }
1065 content_get(rid, &content);
1066 if( (int)blob_size(&content)!=size ){
1067 fossil_print("size mismatch on artifact %d: wanted %d but got %d\n",
@@ -1101,12 +1102,16 @@
1102 blob_reset(&content);
1103 }
1104 n2++;
1105 }
1106 db_finalize(&q);
1107 if( nPhantom>0 ){
1108 fossil_print("%d non-phantom blobs (out of %d total) checked: %d errors\n",
1109 n2, n1, nErr);
1110 }else{
1111 fossil_print("all %d blobs checked: %d errors\n", n1, nErr);
1112 }
1113 if( bParse ){
1114 static const char *const azType[] = { 0, "manifest", "cluster",
1115 "control", "wiki", "ticket", "attachment", "event" };
1116 int i;
1117 fossil_print("%d total control artifacts\n", nCA);
1118

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button