Fossil SCM

Restore "fossil new --empty" and "docker new --docker". Correct help-text for "fossil new"

jan.nijtmans 2015-03-13 09:11 trunk
Commit 68a4c33b2e1c9d98ef43bfacb25d170b14a3c4f6
1 file changed +4 -4
+4 -4
--- src/db.c
+++ src/db.c
@@ -1658,27 +1658,27 @@
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
-** (default: do not create an initial check-in)
1663
+** --empty do not create an initial check-in
16641664
**
16651665
** See also: clone
16661666
*/
16671667
void create_repository_cmd(void){
16681668
char *zPassword;
16691669
const char *zTemplate; /* Repository from which to copy settings */
16701670
const char *zDate; /* Date of the initial check-in */
16711671
const char *zDefaultUser; /* Optional name of the default user */
16721672
int makeServerCodes;
1673
+ int makeEmptyRepository;
16731674
16741675
zTemplate = find_option("template",0,1);
16751676
zDate = find_option("date-override",0,1);
16761677
zDefaultUser = find_option("admin-user","A",1);
16771678
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);
16801680
/* We should be done with options.. */
16811681
verify_all_options();
16821682
16831683
if( g.argc!=3 ){
16841684
usage("REPOSITORY-NAME");
@@ -1691,11 +1691,11 @@
16911691
db_create_repository(g.argv[2]);
16921692
db_open_repository(g.argv[2]);
16931693
db_open_config(0);
16941694
if( zTemplate ) db_attach(zTemplate, "settingSrc");
16951695
db_begin_transaction();
1696
- if( zDate==0 ) zDate = "now";
1696
+ if( zDate==0 && makeEmptyRepository==0 ) zDate = "now";
16971697
db_initial_setup(zTemplate, zDate, zDefaultUser, makeServerCodes);
16981698
db_end_transaction(0);
16991699
if( zTemplate ) db_detach("settingSrc");
17001700
if( makeServerCodes ){
17011701
fossil_print("project-id: %s\n", db_get("project-code", 0));
17021702
--- 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

Keyboard Shortcuts

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