Fossil SCM
Do not clutter the output of "test-integrity" with reports of phantoms.
Commit
1cdc7e830db6faae67415f4df3c4831870a58c8c5dbb4ee9ea058c711bfb1525
Parent
ebbb8a084b47f9c…
1 file changed
+7
-2
+7
-2
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -1005,10 +1005,11 @@ | ||
| 1005 | 1005 | int n1 = 0; |
| 1006 | 1006 | int n2 = 0; |
| 1007 | 1007 | int nErr = 0; |
| 1008 | 1008 | int total; |
| 1009 | 1009 | int nCA = 0; |
| 1010 | + int nPhantom = 0; | |
| 1010 | 1011 | int anCA[10]; |
| 1011 | 1012 | int bParse = find_option("parse",0,0)!=0; |
| 1012 | 1013 | int bDbOnly = find_option("db-only","d",0)!=0; |
| 1013 | 1014 | int bQuick = find_option("quick",0,0)!=0; |
| 1014 | 1015 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 2); |
| @@ -1056,11 +1057,11 @@ | ||
| 1056 | 1057 | int size = db_column_int(&q, 2); |
| 1057 | 1058 | n1++; |
| 1058 | 1059 | fossil_print(" %d/%d\r", n1, total); |
| 1059 | 1060 | fflush(stdout); |
| 1060 | 1061 | if( size<0 ){ |
| 1061 | - fossil_print("skip phantom %d %s\n", rid, zUuid); | |
| 1062 | + nPhantom++; | |
| 1062 | 1063 | continue; /* Ignore phantoms */ |
| 1063 | 1064 | } |
| 1064 | 1065 | content_get(rid, &content); |
| 1065 | 1066 | if( (int)blob_size(&content)!=size ){ |
| 1066 | 1067 | fossil_print("size mismatch on artifact %d: wanted %d but got %d\n", |
| @@ -1101,12 +1102,16 @@ | ||
| 1101 | 1102 | blob_reset(&content); |
| 1102 | 1103 | } |
| 1103 | 1104 | n2++; |
| 1104 | 1105 | } |
| 1105 | 1106 | 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", | |
| 1107 | 1109 | n2, n1, nErr); |
| 1110 | + }else{ | |
| 1111 | + fossil_print("all %d blobs checked: %d errors\n", n1, nErr); | |
| 1112 | + } | |
| 1108 | 1113 | if( bParse ){ |
| 1109 | 1114 | static const char *const azType[] = { 0, "manifest", "cluster", |
| 1110 | 1115 | "control", "wiki", "ticket", "attachment", "event" }; |
| 1111 | 1116 | int i; |
| 1112 | 1117 | fossil_print("%d total control artifacts\n", nCA); |
| 1113 | 1118 |
| --- 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 |