Fossil SCM

Remove the --empty and --docker options from "fossil init". The creation of incompatible Fossil repositories is prohibited.

drh 2015-03-13 14:01 trunk
Commit 620783cae23d28bd73959006af71f859e8b7333e
1 file changed +4 -11
+4 -11
--- src/db.c
+++ src/db.c
@@ -1658,27 +1658,22 @@
16581658
**
16591659
** Options:
16601660
** --template FILE copy settings from repository file
16611661
** --admin-user|-A USERNAME select given USERNAME as admin user
16621662
** --date-override DATETIME use DATETIME as time of the initial check-in
1663
-** --empty do not create an initial check-in
16641663
**
16651664
** See also: clone
16661665
*/
16671666
void create_repository_cmd(void){
16681667
char *zPassword;
16691668
const char *zTemplate; /* Repository from which to copy settings */
16701669
const char *zDate; /* Date of the initial check-in */
16711670
const char *zDefaultUser; /* Optional name of the default user */
1672
- int makeServerCodes;
1673
- int makeEmptyRepository;
16741671
16751672
zTemplate = find_option("template",0,1);
16761673
zDate = find_option("date-override",0,1);
16771674
zDefaultUser = find_option("admin-user","A",1);
1678
- makeServerCodes = find_option("docker", 0, 0)==0;
1679
- makeEmptyRepository = (find_option("empty", 0, 0)!=0) || (makeServerCodes==0);
16801675
/* We should be done with options.. */
16811676
verify_all_options();
16821677
16831678
if( g.argc!=3 ){
16841679
usage("REPOSITORY-NAME");
@@ -1691,18 +1686,16 @@
16911686
db_create_repository(g.argv[2]);
16921687
db_open_repository(g.argv[2]);
16931688
db_open_config(0);
16941689
if( zTemplate ) db_attach(zTemplate, "settingSrc");
16951690
db_begin_transaction();
1696
- if( zDate==0 && makeEmptyRepository==0 ) zDate = "now";
1697
- db_initial_setup(zTemplate, zDate, zDefaultUser, makeServerCodes);
1691
+ if( zDate==0 ) zDate = "now";
1692
+ db_initial_setup(zTemplate, zDate, zDefaultUser, 1);
16981693
db_end_transaction(0);
16991694
if( zTemplate ) db_detach("settingSrc");
1700
- if( makeServerCodes ){
1701
- fossil_print("project-id: %s\n", db_get("project-code", 0));
1702
- fossil_print("server-id: %s\n", db_get("server-code", 0));
1703
- }
1695
+ fossil_print("project-id: %s\n", db_get("project-code", 0));
1696
+ fossil_print("server-id: %s\n", db_get("server-code", 0));
17041697
zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
17051698
fossil_print("admin-user: %s (initial password is \"%s\")\n",
17061699
g.zLogin, zPassword);
17071700
}
17081701
17091702
--- src/db.c
+++ src/db.c
@@ -1658,27 +1658,22 @@
1658 **
1659 ** Options:
1660 ** --template FILE copy settings from repository file
1661 ** --admin-user|-A USERNAME select given USERNAME as admin user
1662 ** --date-override DATETIME use DATETIME as time of the initial check-in
1663 ** --empty do not create an initial check-in
1664 **
1665 ** See also: clone
1666 */
1667 void create_repository_cmd(void){
1668 char *zPassword;
1669 const char *zTemplate; /* Repository from which to copy settings */
1670 const char *zDate; /* Date of the initial check-in */
1671 const char *zDefaultUser; /* Optional name of the default user */
1672 int makeServerCodes;
1673 int makeEmptyRepository;
1674
1675 zTemplate = find_option("template",0,1);
1676 zDate = find_option("date-override",0,1);
1677 zDefaultUser = find_option("admin-user","A",1);
1678 makeServerCodes = find_option("docker", 0, 0)==0;
1679 makeEmptyRepository = (find_option("empty", 0, 0)!=0) || (makeServerCodes==0);
1680 /* We should be done with options.. */
1681 verify_all_options();
1682
1683 if( g.argc!=3 ){
1684 usage("REPOSITORY-NAME");
@@ -1691,18 +1686,16 @@
1691 db_create_repository(g.argv[2]);
1692 db_open_repository(g.argv[2]);
1693 db_open_config(0);
1694 if( zTemplate ) db_attach(zTemplate, "settingSrc");
1695 db_begin_transaction();
1696 if( zDate==0 && makeEmptyRepository==0 ) zDate = "now";
1697 db_initial_setup(zTemplate, zDate, zDefaultUser, makeServerCodes);
1698 db_end_transaction(0);
1699 if( zTemplate ) db_detach("settingSrc");
1700 if( makeServerCodes ){
1701 fossil_print("project-id: %s\n", db_get("project-code", 0));
1702 fossil_print("server-id: %s\n", db_get("server-code", 0));
1703 }
1704 zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
1705 fossil_print("admin-user: %s (initial password is \"%s\")\n",
1706 g.zLogin, zPassword);
1707 }
1708
1709
--- src/db.c
+++ src/db.c
@@ -1658,27 +1658,22 @@
1658 **
1659 ** Options:
1660 ** --template FILE copy settings from repository file
1661 ** --admin-user|-A USERNAME select given USERNAME as admin user
1662 ** --date-override DATETIME use DATETIME as time of the initial check-in
 
1663 **
1664 ** See also: clone
1665 */
1666 void create_repository_cmd(void){
1667 char *zPassword;
1668 const char *zTemplate; /* Repository from which to copy settings */
1669 const char *zDate; /* Date of the initial check-in */
1670 const char *zDefaultUser; /* Optional name of the default user */
 
 
1671
1672 zTemplate = find_option("template",0,1);
1673 zDate = find_option("date-override",0,1);
1674 zDefaultUser = find_option("admin-user","A",1);
 
 
1675 /* We should be done with options.. */
1676 verify_all_options();
1677
1678 if( g.argc!=3 ){
1679 usage("REPOSITORY-NAME");
@@ -1691,18 +1686,16 @@
1686 db_create_repository(g.argv[2]);
1687 db_open_repository(g.argv[2]);
1688 db_open_config(0);
1689 if( zTemplate ) db_attach(zTemplate, "settingSrc");
1690 db_begin_transaction();
1691 if( zDate==0 ) zDate = "now";
1692 db_initial_setup(zTemplate, zDate, zDefaultUser, 1);
1693 db_end_transaction(0);
1694 if( zTemplate ) db_detach("settingSrc");
1695 fossil_print("project-id: %s\n", db_get("project-code", 0));
1696 fossil_print("server-id: %s\n", db_get("server-code", 0));
 
 
1697 zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
1698 fossil_print("admin-user: %s (initial password is \"%s\")\n",
1699 g.zLogin, zPassword);
1700 }
1701
1702

Keyboard Shortcuts

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