Fossil SCM

Remove unused randomize flag to rebuild_db(), per /chat discussion, along with the no-op --randomize flag to the rebuild command.

stephan 2021-11-19 12:29 trunk
Commit 298ccff06c487d035a736f8c47a9a7dd8a19983151ad44b4fb938fc41621304f
+1 -1
--- src/clone.c
+++ src/clone.c
@@ -270,11 +270,11 @@
270270
if( db_exists("SELECT 1 FROM delta WHERE srcId IN phantom") ){
271271
fossil_fatal("there are unresolved deltas -"
272272
" the clone is probably incomplete and unusable.");
273273
}
274274
fossil_print("Rebuilding repository meta-data...\n");
275
- rebuild_db(0, 1, 0);
275
+ rebuild_db(1, 0);
276276
if( !noCompress ){
277277
fossil_print("Extra delta compression... "); fflush(stdout);
278278
extra_deltification();
279279
fossil_print("\n");
280280
}
281281
--- src/clone.c
+++ src/clone.c
@@ -270,11 +270,11 @@
270 if( db_exists("SELECT 1 FROM delta WHERE srcId IN phantom") ){
271 fossil_fatal("there are unresolved deltas -"
272 " the clone is probably incomplete and unusable.");
273 }
274 fossil_print("Rebuilding repository meta-data...\n");
275 rebuild_db(0, 1, 0);
276 if( !noCompress ){
277 fossil_print("Extra delta compression... "); fflush(stdout);
278 extra_deltification();
279 fossil_print("\n");
280 }
281
--- src/clone.c
+++ src/clone.c
@@ -270,11 +270,11 @@
270 if( db_exists("SELECT 1 FROM delta WHERE srcId IN phantom") ){
271 fossil_fatal("there are unresolved deltas -"
272 " the clone is probably incomplete and unusable.");
273 }
274 fossil_print("Rebuilding repository meta-data...\n");
275 rebuild_db(1, 0);
276 if( !noCompress ){
277 fossil_print("Extra delta compression... "); fflush(stdout);
278 extra_deltification();
279 fossil_print("\n");
280 }
281
+1 -1
--- src/import.c
+++ src/import.c
@@ -2008,11 +2008,11 @@
20082008
if( omitRebuild ){
20092009
omitVacuum = 1;
20102010
}else{
20112011
db_begin_transaction();
20122012
fossil_print("Rebuilding repository meta-data...\n");
2013
- rebuild_db(0, 1, !incrFlag);
2013
+ rebuild_db(1, !incrFlag);
20142014
verify_cancel();
20152015
db_end_transaction(0);
20162016
}
20172017
if( !omitVacuum ){
20182018
fossil_print("Vacuuming..."); fflush(stdout);
20192019
--- src/import.c
+++ src/import.c
@@ -2008,11 +2008,11 @@
2008 if( omitRebuild ){
2009 omitVacuum = 1;
2010 }else{
2011 db_begin_transaction();
2012 fossil_print("Rebuilding repository meta-data...\n");
2013 rebuild_db(0, 1, !incrFlag);
2014 verify_cancel();
2015 db_end_transaction(0);
2016 }
2017 if( !omitVacuum ){
2018 fossil_print("Vacuuming..."); fflush(stdout);
2019
--- src/import.c
+++ src/import.c
@@ -2008,11 +2008,11 @@
2008 if( omitRebuild ){
2009 omitVacuum = 1;
2010 }else{
2011 db_begin_transaction();
2012 fossil_print("Rebuilding repository meta-data...\n");
2013 rebuild_db(1, !incrFlag);
2014 verify_cancel();
2015 db_end_transaction(0);
2016 }
2017 if( !omitVacuum ){
2018 fossil_print("Vacuuming..."); fflush(stdout);
2019
+4 -12
--- src/rebuild.c
+++ src/rebuild.c
@@ -368,17 +368,12 @@
368368
** Core function to rebuild the information in the derived tables of a
369369
** fossil repository from the blobs. This function is shared between
370370
** 'rebuild_database' ('rebuild') and 'reconstruct_cmd'
371371
** ('reconstruct'), both of which have to regenerate this information
372372
** from scratch.
373
-**
374
-** If the randomize parameter is true, then the BLOBs are deliberately
375
-** extracted in a random order. This feature is used to test the
376
-** ability of fossil to accept records in any order and still
377
-** construct a sane repository.
378373
*/
379
-int rebuild_db(int randomize, int doOut, int doClustering){
374
+int rebuild_db(int doOut, int doClustering){
380375
Stmt s, q;
381376
int errCnt = 0;
382377
int incrSize;
383378
Blob sql;
384379
@@ -605,18 +600,16 @@
605600
** --index Always add in the full-text search index
606601
** --noverify Skip the verification of changes to the BLOB table
607602
** --noindex Always omit the full-text search index
608603
** --pagesize N Set the database pagesize to N. (512..65536 and power of 2)
609604
** --quiet Only show output if there are errors
610
-** --randomize Scan artifacts in a random order
611605
** --stats Show artifact statistics after rebuilding
612606
** --vacuum Run VACUUM on the database after rebuilding
613607
** --wal Set Write-Ahead-Log journalling mode on the database
614608
*/
615609
void rebuild_database(void){
616610
int forceFlag;
617
- int randomizeFlag;
618611
int errCnt = 0;
619612
int omitVerify;
620613
int doClustering;
621614
const char *zPagesize;
622615
int newPagesize = 0;
@@ -632,11 +625,10 @@
632625
int optIfNeeded;
633626
int compressOnlyFlag;
634627
635628
omitVerify = find_option("noverify",0,0)!=0;
636629
forceFlag = find_option("force","f",0)!=0;
637
- randomizeFlag = find_option("randomize", 0, 0)!=0;
638630
doClustering = find_option("cluster", 0, 0)!=0;
639631
runVacuum = find_option("vacuum",0,0)!=0;
640632
runDeanalyze = find_option("deanalyze",0,0)!=0;
641633
runAnalyze = find_option("analyze",0,0)!=0;
642634
runCompress = find_option("compress",0,0)!=0;
@@ -679,11 +671,11 @@
679671
db_begin_transaction();
680672
db_unprotect(PROTECT_ALL);
681673
if( !compressOnlyFlag ){
682674
search_drop_index();
683675
ttyOutput = 1;
684
- errCnt = rebuild_db(randomizeFlag, 1, doClustering);
676
+ errCnt = rebuild_db(1, doClustering);
685677
reconstruct_private_table();
686678
}
687679
db_multi_exec(
688680
"REPLACE INTO config(name,value,mtime) VALUES('content-schema',%Q,now());"
689681
"REPLACE INTO config(name,value,mtime) VALUES('aux-schema',%Q,now());"
@@ -963,11 +955,11 @@
963955
db_end_transaction(0);
964956
db_unprotect(PROTECT_ALL);
965957
db_multi_exec("VACUUM;");
966958
db_protect_pop();
967959
}else{
968
- rebuild_db(0, 1, 0);
960
+ rebuild_db(1, 0);
969961
db_end_transaction(0);
970962
}
971963
}
972964
973965
/*
@@ -1255,11 +1247,11 @@
12551247
12561248
fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]);
12571249
recon_read_dir(g.argv[3]);
12581250
fossil_print("\nBuilding the Fossil repository...\n");
12591251
1260
- rebuild_db(0, 1, 1);
1252
+ rebuild_db(1, 1);
12611253
12621254
/* Backwards compatibility: Mark check-ins with "+private" tags as private. */
12631255
reconstruct_private_table();
12641256
/* Newer method: Import the list of private artifacts to the PRIVATE table. */
12651257
if( fKeepPrivate ){
12661258
--- src/rebuild.c
+++ src/rebuild.c
@@ -368,17 +368,12 @@
368 ** Core function to rebuild the information in the derived tables of a
369 ** fossil repository from the blobs. This function is shared between
370 ** 'rebuild_database' ('rebuild') and 'reconstruct_cmd'
371 ** ('reconstruct'), both of which have to regenerate this information
372 ** from scratch.
373 **
374 ** If the randomize parameter is true, then the BLOBs are deliberately
375 ** extracted in a random order. This feature is used to test the
376 ** ability of fossil to accept records in any order and still
377 ** construct a sane repository.
378 */
379 int rebuild_db(int randomize, int doOut, int doClustering){
380 Stmt s, q;
381 int errCnt = 0;
382 int incrSize;
383 Blob sql;
384
@@ -605,18 +600,16 @@
605 ** --index Always add in the full-text search index
606 ** --noverify Skip the verification of changes to the BLOB table
607 ** --noindex Always omit the full-text search index
608 ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2)
609 ** --quiet Only show output if there are errors
610 ** --randomize Scan artifacts in a random order
611 ** --stats Show artifact statistics after rebuilding
612 ** --vacuum Run VACUUM on the database after rebuilding
613 ** --wal Set Write-Ahead-Log journalling mode on the database
614 */
615 void rebuild_database(void){
616 int forceFlag;
617 int randomizeFlag;
618 int errCnt = 0;
619 int omitVerify;
620 int doClustering;
621 const char *zPagesize;
622 int newPagesize = 0;
@@ -632,11 +625,10 @@
632 int optIfNeeded;
633 int compressOnlyFlag;
634
635 omitVerify = find_option("noverify",0,0)!=0;
636 forceFlag = find_option("force","f",0)!=0;
637 randomizeFlag = find_option("randomize", 0, 0)!=0;
638 doClustering = find_option("cluster", 0, 0)!=0;
639 runVacuum = find_option("vacuum",0,0)!=0;
640 runDeanalyze = find_option("deanalyze",0,0)!=0;
641 runAnalyze = find_option("analyze",0,0)!=0;
642 runCompress = find_option("compress",0,0)!=0;
@@ -679,11 +671,11 @@
679 db_begin_transaction();
680 db_unprotect(PROTECT_ALL);
681 if( !compressOnlyFlag ){
682 search_drop_index();
683 ttyOutput = 1;
684 errCnt = rebuild_db(randomizeFlag, 1, doClustering);
685 reconstruct_private_table();
686 }
687 db_multi_exec(
688 "REPLACE INTO config(name,value,mtime) VALUES('content-schema',%Q,now());"
689 "REPLACE INTO config(name,value,mtime) VALUES('aux-schema',%Q,now());"
@@ -963,11 +955,11 @@
963 db_end_transaction(0);
964 db_unprotect(PROTECT_ALL);
965 db_multi_exec("VACUUM;");
966 db_protect_pop();
967 }else{
968 rebuild_db(0, 1, 0);
969 db_end_transaction(0);
970 }
971 }
972
973 /*
@@ -1255,11 +1247,11 @@
1255
1256 fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]);
1257 recon_read_dir(g.argv[3]);
1258 fossil_print("\nBuilding the Fossil repository...\n");
1259
1260 rebuild_db(0, 1, 1);
1261
1262 /* Backwards compatibility: Mark check-ins with "+private" tags as private. */
1263 reconstruct_private_table();
1264 /* Newer method: Import the list of private artifacts to the PRIVATE table. */
1265 if( fKeepPrivate ){
1266
--- src/rebuild.c
+++ src/rebuild.c
@@ -368,17 +368,12 @@
368 ** Core function to rebuild the information in the derived tables of a
369 ** fossil repository from the blobs. This function is shared between
370 ** 'rebuild_database' ('rebuild') and 'reconstruct_cmd'
371 ** ('reconstruct'), both of which have to regenerate this information
372 ** from scratch.
 
 
 
 
 
373 */
374 int rebuild_db(int doOut, int doClustering){
375 Stmt s, q;
376 int errCnt = 0;
377 int incrSize;
378 Blob sql;
379
@@ -605,18 +600,16 @@
600 ** --index Always add in the full-text search index
601 ** --noverify Skip the verification of changes to the BLOB table
602 ** --noindex Always omit the full-text search index
603 ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2)
604 ** --quiet Only show output if there are errors
 
605 ** --stats Show artifact statistics after rebuilding
606 ** --vacuum Run VACUUM on the database after rebuilding
607 ** --wal Set Write-Ahead-Log journalling mode on the database
608 */
609 void rebuild_database(void){
610 int forceFlag;
 
611 int errCnt = 0;
612 int omitVerify;
613 int doClustering;
614 const char *zPagesize;
615 int newPagesize = 0;
@@ -632,11 +625,10 @@
625 int optIfNeeded;
626 int compressOnlyFlag;
627
628 omitVerify = find_option("noverify",0,0)!=0;
629 forceFlag = find_option("force","f",0)!=0;
 
630 doClustering = find_option("cluster", 0, 0)!=0;
631 runVacuum = find_option("vacuum",0,0)!=0;
632 runDeanalyze = find_option("deanalyze",0,0)!=0;
633 runAnalyze = find_option("analyze",0,0)!=0;
634 runCompress = find_option("compress",0,0)!=0;
@@ -679,11 +671,11 @@
671 db_begin_transaction();
672 db_unprotect(PROTECT_ALL);
673 if( !compressOnlyFlag ){
674 search_drop_index();
675 ttyOutput = 1;
676 errCnt = rebuild_db(1, doClustering);
677 reconstruct_private_table();
678 }
679 db_multi_exec(
680 "REPLACE INTO config(name,value,mtime) VALUES('content-schema',%Q,now());"
681 "REPLACE INTO config(name,value,mtime) VALUES('aux-schema',%Q,now());"
@@ -963,11 +955,11 @@
955 db_end_transaction(0);
956 db_unprotect(PROTECT_ALL);
957 db_multi_exec("VACUUM;");
958 db_protect_pop();
959 }else{
960 rebuild_db(1, 0);
961 db_end_transaction(0);
962 }
963 }
964
965 /*
@@ -1255,11 +1247,11 @@
1247
1248 fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]);
1249 recon_read_dir(g.argv[3]);
1250 fossil_print("\nBuilding the Fossil repository...\n");
1251
1252 rebuild_db(1, 1);
1253
1254 /* Backwards compatibility: Mark check-ins with "+private" tags as private. */
1255 reconstruct_private_table();
1256 /* Newer method: Import the list of private artifacts to the PRIVATE table. */
1257 if( fKeepPrivate ){
1258
+1 -1
--- src/shun.c
+++ src/shun.c
@@ -60,11 +60,11 @@
6060
}
6161
if( P("rebuild") ){
6262
db_close(1);
6363
db_open_repository(g.zRepositoryName);
6464
db_begin_transaction();
65
- rebuild_db(0, 0, 0);
65
+ rebuild_db(0, 0);
6666
admin_log("Rebuilt database.");
6767
db_end_transaction(0);
6868
}
6969
if( zUuid ){
7070
char *p;
7171
--- src/shun.c
+++ src/shun.c
@@ -60,11 +60,11 @@
60 }
61 if( P("rebuild") ){
62 db_close(1);
63 db_open_repository(g.zRepositoryName);
64 db_begin_transaction();
65 rebuild_db(0, 0, 0);
66 admin_log("Rebuilt database.");
67 db_end_transaction(0);
68 }
69 if( zUuid ){
70 char *p;
71
--- src/shun.c
+++ src/shun.c
@@ -60,11 +60,11 @@
60 }
61 if( P("rebuild") ){
62 db_close(1);
63 db_open_repository(g.zRepositoryName);
64 db_begin_transaction();
65 rebuild_db(0, 0);
66 admin_log("Rebuilt database.");
67 db_end_transaction(0);
68 }
69 if( zUuid ){
70 char *p;
71

Keyboard Shortcuts

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