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.

drh 2015-02-28 14:15 trunk
Commit 35c25558cbffcb7f5f03d16f584e1898ad76e201
2 files changed +10 -2 +1 -1
+10 -2
--- src/clone.c
+++ src/clone.c
@@ -201,15 +201,23 @@
201201
db_open_repository(g.argv[3]);
202202
}
203203
db_begin_transaction();
204204
fossil_print("Rebuilding repository meta-data...\n");
205205
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));
207216
fossil_print("server-id: %s\n", db_get("server-code", 0));
208217
zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
209218
fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword);
210
- db_end_transaction(0);
211219
}
212220
213221
/*
214222
** If user chooses to use HTTP Authentication over unencrypted HTTP,
215223
** remember decision. Otherwise, if the URL is being changed and no
216224
--- 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 @@
439439
440440
/*
441441
** Attempt to convert more full-text blobs into delta-blobs for
442442
** storage efficiency.
443443
*/
444
-static void extra_deltification(void){
444
+void extra_deltification(void){
445445
Stmt q;
446446
int topid, previd, rid;
447447
int prevfnid, fnid;
448448
db_begin_transaction();
449449
db_prepare(&q,
450450
--- 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

Keyboard Shortcuts

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