Overview
SHA1 Hash: | e38fc922a5bff1f8b22c6cb9b80f481bb616877c |
---|---|
Date: | 2007-10-11 01:17:20 |
User: | drh |
Comment: | Remove unused hard-coded tags from the schema. Output a row count as a status indicator when doing a rebuild. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/construct.c from [8121471811] to [e55d0051c5].
@@ -154,15 +154,15 @@ printf("imported: %d %s\n", fileCnt, fileCnt == 1 ? "file" : "files"); /* Finalize the repository, rebuild the derived tables */ - errCnt = rebuild_db(0); + errCnt = rebuild_db(0, 0); if( errCnt ){ printf("%d %s. Rolling back changes.\n", errCnt, errCnt == 1 ? "error" : "errors"); db_end_transaction(1); }else{ db_end_transaction(0); } }
Modified src/rebuild.c from [6f9e0bad18] to [45d87035e5].
@@ -37,14 +37,15 @@ ** If the randomize parameter is true, then the BLOBs are deliberately ** extracted in a random order. This feature is used to test the ** ability of fossil to accept records in any order and still ** construct a sane repository. */ -int rebuild_db(int randomize){ +int rebuild_db(int randomize, int ttyOutput){ Stmt s; int errCnt = 0; char *zTable; + int cnt = 0; db_multi_exec( "CREATE INDEX IF NOT EXISTS delta_i1 ON delta(srcid);" "CREATE TABLE IF NOT EXISTS shun(uuid UNIQUE);" ); @@ -75,16 +76,25 @@ while( db_step(&s)==SQLITE_ROW ){ int rid = db_column_int(&s, 0); int size = db_column_int(&s, 1); if( size>=0 ){ Blob content; + if( ttyOutput ){ + cnt++; + printf("%d...\r", cnt); + fflush(stdout); + } content_get(rid, &content); manifest_crosslink(rid, &content); blob_reset(&content); }else{ db_multi_exec("INSERT OR IGNORE INTO phantom VALUES(%d)", rid); } + } + db_finalize(&s); + if( ttyOutput ){ + printf("\n"); } return errCnt; } /* @@ -106,14 +116,14 @@ if( g.argc!=3 ){ usage("REPOSITORY-FILENAME"); } db_open_repository(g.argv[2]); db_begin_transaction(); - errCnt = rebuild_db(randomizeFlag); + errCnt = rebuild_db(randomizeFlag, 1); if( errCnt && !forceFlag ){ printf("%d errors. Rolling back changes. Use --force to force a commit.\n", errCnt); db_end_transaction(1); }else{ db_end_transaction(0); } }
Modified src/schema.c from [f8f803b8a2] to [3e36e323dc].
@@ -218,12 +218,10 @@ @ ); @ INSERT INTO tag VALUES(1, 'bgcolor'); -- TAG_BGCOLOR @ INSERT INTO tag VALUES(2, 'comment'); -- TAG_COMMENT @ INSERT INTO tag VALUES(3, 'user'); -- TAG_USER @ INSERT INTO tag VALUES(4, 'hidden'); -- TAG_HIDDEN -@ INSERT INTO tag VALUES(5, 'readonly'); -- TAG_READONLY -@ INSERT INTO tag VALUES(6, 'appendonly'); -- TAG_APPENDONLY @ @ -- Assignments of tags to baselines. Note that we allow tags to @ -- have values assigned to them. So we are not really dealing with @ -- tags here. These are really properties. But we are going to @ -- keep calling them tags because in many cases the value is ignored. @@ -246,12 +244,10 @@ #if INTERFACE # define TAG_BGCOLOR 1 # define TAG_COMMENT 2 # define TAG_USER 3 # define TAG_HIDDEN 4 -# define TAG_READONLY 5 -# define TAG_APPENDONLY 6 #endif /* ** The schema for the locate FOSSIL database file found at the root ** of very check-out. This database contains the complete state of