Fossil SCM
Automatically run extra delta-compression and vacuum a repository after a clone. And change the page size to 8192 if there are more than 1000 pages.
Commit
35c25558cbffcb7f5f03d16f584e1898ad76e201
Parent
76e77aba292c7a1…
2 files changed
+10
-2
+1
-1
+10
-2
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -201,15 +201,23 @@ | ||
| 201 | 201 | db_open_repository(g.argv[3]); |
| 202 | 202 | } |
| 203 | 203 | db_begin_transaction(); |
| 204 | 204 | fossil_print("Rebuilding repository meta-data...\n"); |
| 205 | 205 | rebuild_db(0, 1, 0); |
| 206 | - fossil_print("project-id: %s\n", db_get("project-code", 0)); | |
| 206 | + fossil_print("Extra delta compression... "); fflush(stdout); | |
| 207 | + extra_deltification(); | |
| 208 | + db_end_transaction(0); | |
| 209 | + fossil_print("\nVacuuming the database... "); fflush(stdout); | |
| 210 | + if( db_int(0, "PRAGMA page_count")>1000 | |
| 211 | + && db_int(0, "PRAGMA page_size")<8192 ){ | |
| 212 | + db_multi_exec("PRAGMA page_size=8192;"); | |
| 213 | + } | |
| 214 | + db_multi_exec("VACUUM"); | |
| 215 | + fossil_print("\nproject-id: %s\n", db_get("project-code", 0)); | |
| 207 | 216 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 208 | 217 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 209 | 218 | fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword); |
| 210 | - db_end_transaction(0); | |
| 211 | 219 | } |
| 212 | 220 | |
| 213 | 221 | /* |
| 214 | 222 | ** If user chooses to use HTTP Authentication over unencrypted HTTP, |
| 215 | 223 | ** remember decision. Otherwise, if the URL is being changed and no |
| 216 | 224 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -201,15 +201,23 @@ | |
| 201 | db_open_repository(g.argv[3]); |
| 202 | } |
| 203 | db_begin_transaction(); |
| 204 | fossil_print("Rebuilding repository meta-data...\n"); |
| 205 | rebuild_db(0, 1, 0); |
| 206 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 207 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 208 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 209 | fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword); |
| 210 | db_end_transaction(0); |
| 211 | } |
| 212 | |
| 213 | /* |
| 214 | ** If user chooses to use HTTP Authentication over unencrypted HTTP, |
| 215 | ** remember decision. Otherwise, if the URL is being changed and no |
| 216 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -201,15 +201,23 @@ | |
| 201 | db_open_repository(g.argv[3]); |
| 202 | } |
| 203 | db_begin_transaction(); |
| 204 | fossil_print("Rebuilding repository meta-data...\n"); |
| 205 | rebuild_db(0, 1, 0); |
| 206 | fossil_print("Extra delta compression... "); fflush(stdout); |
| 207 | extra_deltification(); |
| 208 | db_end_transaction(0); |
| 209 | fossil_print("\nVacuuming the database... "); fflush(stdout); |
| 210 | if( db_int(0, "PRAGMA page_count")>1000 |
| 211 | && db_int(0, "PRAGMA page_size")<8192 ){ |
| 212 | db_multi_exec("PRAGMA page_size=8192;"); |
| 213 | } |
| 214 | db_multi_exec("VACUUM"); |
| 215 | fossil_print("\nproject-id: %s\n", db_get("project-code", 0)); |
| 216 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 217 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 218 | fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword); |
| 219 | } |
| 220 | |
| 221 | /* |
| 222 | ** If user chooses to use HTTP Authentication over unencrypted HTTP, |
| 223 | ** remember decision. Otherwise, if the URL is being changed and no |
| 224 |
+1
-1
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -439,11 +439,11 @@ | ||
| 439 | 439 | |
| 440 | 440 | /* |
| 441 | 441 | ** Attempt to convert more full-text blobs into delta-blobs for |
| 442 | 442 | ** storage efficiency. |
| 443 | 443 | */ |
| 444 | -static void extra_deltification(void){ | |
| 444 | +void extra_deltification(void){ | |
| 445 | 445 | Stmt q; |
| 446 | 446 | int topid, previd, rid; |
| 447 | 447 | int prevfnid, fnid; |
| 448 | 448 | db_begin_transaction(); |
| 449 | 449 | db_prepare(&q, |
| 450 | 450 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -439,11 +439,11 @@ | |
| 439 | |
| 440 | /* |
| 441 | ** Attempt to convert more full-text blobs into delta-blobs for |
| 442 | ** storage efficiency. |
| 443 | */ |
| 444 | static void extra_deltification(void){ |
| 445 | Stmt q; |
| 446 | int topid, previd, rid; |
| 447 | int prevfnid, fnid; |
| 448 | db_begin_transaction(); |
| 449 | db_prepare(&q, |
| 450 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -439,11 +439,11 @@ | |
| 439 | |
| 440 | /* |
| 441 | ** Attempt to convert more full-text blobs into delta-blobs for |
| 442 | ** storage efficiency. |
| 443 | */ |
| 444 | void extra_deltification(void){ |
| 445 | Stmt q; |
| 446 | int topid, previd, rid; |
| 447 | int prevfnid, fnid; |
| 448 | db_begin_transaction(); |
| 449 | db_prepare(&q, |
| 450 |