Fossil SCM

Add the --no-rebuild and --no-vacuum options to the "fossil import" command.

drh 2015-12-29 20:18 trunk
Commit 219f967cd7ac7c438944706e9c8fc8cd1c7c4a86
1 file changed +18 -8
+18 -8
--- src/import.c
+++ src/import.c
@@ -1511,23 +1511,26 @@
15111511
**
15121512
** Common Options:
15131513
** -i|--incremental allow importing into an existing repository
15141514
** -f|--force overwrite repository if already exist
15151515
** -q|--quiet omit progress output
1516
+** --no-rebuild skip the "rebuilding metadata" step
1517
+** --no-vacuum skip the final VACUUM of the database file
15161518
**
15171519
** The --incremental option allows an existing repository to be extended
15181520
** with new content.
1519
-**
15201521
**
15211522
** See also: export
15221523
*/
15231524
void import_cmd(void){
15241525
char *zPassword;
15251526
FILE *pIn;
15261527
Stmt q;
15271528
int forceFlag = find_option("force", "f", 0)!=0;
15281529
int svnFlag = find_option("svn", 0, 0)!=0;
1530
+ int omitRebuild = find_option("no-rebuild",0,0)!=0;
1531
+ int omitVacuum = find_option("no-vacuum",0,0)!=0;
15291532
15301533
/* Options common to all input formats */
15311534
int incrFlag = find_option("incremental", "i", 0)!=0;
15321535
15331536
/* Options for --svn only */
@@ -1661,20 +1664,27 @@
16611664
manifest_crosslink_end(MC_NONE);
16621665
}
16631666
16641667
verify_cancel();
16651668
db_end_transaction(0);
1666
- db_begin_transaction();
1667
- fossil_print("Rebuilding repository meta-data...\n");
1668
- rebuild_db(0, 1, !incrFlag);
1669
- verify_cancel();
1670
- db_end_transaction(0);
1671
- fossil_print("Vacuuming..."); fflush(stdout);
1672
- db_multi_exec("VACUUM");
1669
+ fossil_print(" \r");
1670
+ if( omitRebuild ){
1671
+ omitVacuum = 1;
1672
+ }else{
1673
+ db_begin_transaction();
1674
+ fossil_print("Rebuilding repository meta-data...\n");
1675
+ rebuild_db(0, 1, !incrFlag);
1676
+ verify_cancel();
1677
+ db_end_transaction(0);
1678
+ }
1679
+ if( !omitVacuum ){
1680
+ fossil_print("Vacuuming..."); fflush(stdout);
1681
+ db_multi_exec("VACUUM");
1682
+ }
16731683
fossil_print(" ok\n");
16741684
if( !incrFlag ){
16751685
fossil_print("project-id: %s\n", db_get("project-code", 0));
16761686
fossil_print("server-id: %s\n", db_get("server-code", 0));
16771687
zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
16781688
fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword);
16791689
}
16801690
}
16811691
--- src/import.c
+++ src/import.c
@@ -1511,23 +1511,26 @@
1511 **
1512 ** Common Options:
1513 ** -i|--incremental allow importing into an existing repository
1514 ** -f|--force overwrite repository if already exist
1515 ** -q|--quiet omit progress output
 
 
1516 **
1517 ** The --incremental option allows an existing repository to be extended
1518 ** with new content.
1519 **
1520 **
1521 ** See also: export
1522 */
1523 void import_cmd(void){
1524 char *zPassword;
1525 FILE *pIn;
1526 Stmt q;
1527 int forceFlag = find_option("force", "f", 0)!=0;
1528 int svnFlag = find_option("svn", 0, 0)!=0;
 
 
1529
1530 /* Options common to all input formats */
1531 int incrFlag = find_option("incremental", "i", 0)!=0;
1532
1533 /* Options for --svn only */
@@ -1661,20 +1664,27 @@
1661 manifest_crosslink_end(MC_NONE);
1662 }
1663
1664 verify_cancel();
1665 db_end_transaction(0);
1666 db_begin_transaction();
1667 fossil_print("Rebuilding repository meta-data...\n");
1668 rebuild_db(0, 1, !incrFlag);
1669 verify_cancel();
1670 db_end_transaction(0);
1671 fossil_print("Vacuuming..."); fflush(stdout);
1672 db_multi_exec("VACUUM");
 
 
 
 
 
 
 
1673 fossil_print(" ok\n");
1674 if( !incrFlag ){
1675 fossil_print("project-id: %s\n", db_get("project-code", 0));
1676 fossil_print("server-id: %s\n", db_get("server-code", 0));
1677 zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
1678 fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword);
1679 }
1680 }
1681
--- src/import.c
+++ src/import.c
@@ -1511,23 +1511,26 @@
1511 **
1512 ** Common Options:
1513 ** -i|--incremental allow importing into an existing repository
1514 ** -f|--force overwrite repository if already exist
1515 ** -q|--quiet omit progress output
1516 ** --no-rebuild skip the "rebuilding metadata" step
1517 ** --no-vacuum skip the final VACUUM of the database file
1518 **
1519 ** The --incremental option allows an existing repository to be extended
1520 ** with new content.
 
1521 **
1522 ** See also: export
1523 */
1524 void import_cmd(void){
1525 char *zPassword;
1526 FILE *pIn;
1527 Stmt q;
1528 int forceFlag = find_option("force", "f", 0)!=0;
1529 int svnFlag = find_option("svn", 0, 0)!=0;
1530 int omitRebuild = find_option("no-rebuild",0,0)!=0;
1531 int omitVacuum = find_option("no-vacuum",0,0)!=0;
1532
1533 /* Options common to all input formats */
1534 int incrFlag = find_option("incremental", "i", 0)!=0;
1535
1536 /* Options for --svn only */
@@ -1661,20 +1664,27 @@
1664 manifest_crosslink_end(MC_NONE);
1665 }
1666
1667 verify_cancel();
1668 db_end_transaction(0);
1669 fossil_print(" \r");
1670 if( omitRebuild ){
1671 omitVacuum = 1;
1672 }else{
1673 db_begin_transaction();
1674 fossil_print("Rebuilding repository meta-data...\n");
1675 rebuild_db(0, 1, !incrFlag);
1676 verify_cancel();
1677 db_end_transaction(0);
1678 }
1679 if( !omitVacuum ){
1680 fossil_print("Vacuuming..."); fflush(stdout);
1681 db_multi_exec("VACUUM");
1682 }
1683 fossil_print(" ok\n");
1684 if( !incrFlag ){
1685 fossil_print("project-id: %s\n", db_get("project-code", 0));
1686 fossil_print("server-id: %s\n", db_get("server-code", 0));
1687 zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
1688 fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword);
1689 }
1690 }
1691

Keyboard Shortcuts

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