Fossil SCM
Restore "fossil new --empty" and "docker new --docker". Correct help-text for "fossil new"
Commit
68a4c33b2e1c9d98ef43bfacb25d170b14a3c4f6
Parent
18bfcfcf3b0c12e…
1 file changed
+4
-4
M
src/db.c
+4
-4
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1658,27 +1658,27 @@ | ||
| 1658 | 1658 | ** |
| 1659 | 1659 | ** Options: |
| 1660 | 1660 | ** --template FILE copy settings from repository file |
| 1661 | 1661 | ** --admin-user|-A USERNAME select given USERNAME as admin user |
| 1662 | 1662 | ** --date-override DATETIME use DATETIME as time of the initial check-in |
| 1663 | -** (default: do not create an initial check-in) | |
| 1663 | +** --empty do not create an initial check-in | |
| 1664 | 1664 | ** |
| 1665 | 1665 | ** See also: clone |
| 1666 | 1666 | */ |
| 1667 | 1667 | void create_repository_cmd(void){ |
| 1668 | 1668 | char *zPassword; |
| 1669 | 1669 | const char *zTemplate; /* Repository from which to copy settings */ |
| 1670 | 1670 | const char *zDate; /* Date of the initial check-in */ |
| 1671 | 1671 | const char *zDefaultUser; /* Optional name of the default user */ |
| 1672 | 1672 | int makeServerCodes; |
| 1673 | + int makeEmptyRepository; | |
| 1673 | 1674 | |
| 1674 | 1675 | zTemplate = find_option("template",0,1); |
| 1675 | 1676 | zDate = find_option("date-override",0,1); |
| 1676 | 1677 | zDefaultUser = find_option("admin-user","A",1); |
| 1677 | 1678 | makeServerCodes = find_option("docker", 0, 0)==0; |
| 1678 | - | |
| 1679 | - find_option("empty", 0, 0); /* deprecated */ | |
| 1679 | + makeEmptyRepository = (find_option("empty", 0, 0)!=0) || (makeServerCodes==0); | |
| 1680 | 1680 | /* We should be done with options.. */ |
| 1681 | 1681 | verify_all_options(); |
| 1682 | 1682 | |
| 1683 | 1683 | if( g.argc!=3 ){ |
| 1684 | 1684 | usage("REPOSITORY-NAME"); |
| @@ -1691,11 +1691,11 @@ | ||
| 1691 | 1691 | db_create_repository(g.argv[2]); |
| 1692 | 1692 | db_open_repository(g.argv[2]); |
| 1693 | 1693 | db_open_config(0); |
| 1694 | 1694 | if( zTemplate ) db_attach(zTemplate, "settingSrc"); |
| 1695 | 1695 | db_begin_transaction(); |
| 1696 | - if( zDate==0 ) zDate = "now"; | |
| 1696 | + if( zDate==0 && makeEmptyRepository==0 ) zDate = "now"; | |
| 1697 | 1697 | db_initial_setup(zTemplate, zDate, zDefaultUser, makeServerCodes); |
| 1698 | 1698 | db_end_transaction(0); |
| 1699 | 1699 | if( zTemplate ) db_detach("settingSrc"); |
| 1700 | 1700 | if( makeServerCodes ){ |
| 1701 | 1701 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 1702 | 1702 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1658,27 +1658,27 @@ | |
| 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 | ** (default: 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 | |
| 1674 | zTemplate = find_option("template",0,1); |
| 1675 | zDate = find_option("date-override",0,1); |
| 1676 | zDefaultUser = find_option("admin-user","A",1); |
| 1677 | makeServerCodes = find_option("docker", 0, 0)==0; |
| 1678 | |
| 1679 | find_option("empty", 0, 0); /* deprecated */ |
| 1680 | /* We should be done with options.. */ |
| 1681 | verify_all_options(); |
| 1682 | |
| 1683 | if( g.argc!=3 ){ |
| 1684 | usage("REPOSITORY-NAME"); |
| @@ -1691,11 +1691,11 @@ | |
| 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 ) 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 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1658,27 +1658,27 @@ | |
| 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,11 +1691,11 @@ | |
| 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 |