Fossil SCM

Partially backout [620783cae23d28bd73959006af71f859e8b7333e|620783cae2] (adapted to current coding style): This brings back the --empty option there once was.

jan.nijtmans 2020-07-03 13:52 trunk
Commit 971a5f513c15647b23d9ad7f8d7eda3b48f4224c5e67e53d5d19d68b79ba76a0
1 file changed +4 -3
+4 -3
--- src/db.c
+++ src/db.c
@@ -2380,10 +2380,11 @@
23802380
**
23812381
** Options:
23822382
** --template FILE Copy settings from repository file
23832383
** --admin-user|-A USERNAME Select given USERNAME as admin user
23842384
** --date-override DATETIME Use DATETIME as time of the initial check-in
2385
+** --empty do not create an initial check-in
23852386
** --sha1 Use an initial hash policy of "sha1"
23862387
**
23872388
** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
23882389
** year-month-day form, it may be truncated, the "T" may be replaced by
23892390
** a space, and it may also name a timezone offset from UTC as "-HH:MM"
@@ -2396,16 +2397,16 @@
23962397
char *zPassword;
23972398
const char *zTemplate; /* Repository from which to copy settings */
23982399
const char *zDate; /* Date of the initial check-in */
23992400
const char *zDefaultUser; /* Optional name of the default user */
24002401
int bUseSha1 = 0; /* True to set the hash-policy to sha1 */
2401
-
2402
-
2402
+ int bMakeEmpty;
24032403
zTemplate = find_option("template",0,1);
24042404
zDate = find_option("date-override",0,1);
24052405
zDefaultUser = find_option("admin-user","A",1);
24062406
bUseSha1 = find_option("sha1",0,0)!=0;
2407
+ bMakeEmpty = find_option("empty",0,0)!=0;
24072408
/* We should be done with options.. */
24082409
verify_all_options();
24092410
24102411
if( g.argc!=3 ){
24112412
usage("REPOSITORY-NAME");
@@ -2422,11 +2423,11 @@
24222423
db_begin_transaction();
24232424
if( bUseSha1 ){
24242425
g.eHashPolicy = HPOLICY_SHA1;
24252426
db_set_int("hash-policy", HPOLICY_SHA1, 0);
24262427
}
2427
- if( zDate==0 ) zDate = "now";
2428
+ if( zDate==0 && bMakeEmpty==0 ) zDate = "now";
24282429
db_initial_setup(zTemplate, zDate, zDefaultUser);
24292430
db_end_transaction(0);
24302431
if( zTemplate ) db_detach("settingSrc");
24312432
fossil_print("project-id: %s\n", db_get("project-code", 0));
24322433
fossil_print("server-id: %s\n", db_get("server-code", 0));
24332434
--- src/db.c
+++ src/db.c
@@ -2380,10 +2380,11 @@
2380 **
2381 ** Options:
2382 ** --template FILE Copy settings from repository file
2383 ** --admin-user|-A USERNAME Select given USERNAME as admin user
2384 ** --date-override DATETIME Use DATETIME as time of the initial check-in
 
2385 ** --sha1 Use an initial hash policy of "sha1"
2386 **
2387 ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
2388 ** year-month-day form, it may be truncated, the "T" may be replaced by
2389 ** a space, and it may also name a timezone offset from UTC as "-HH:MM"
@@ -2396,16 +2397,16 @@
2396 char *zPassword;
2397 const char *zTemplate; /* Repository from which to copy settings */
2398 const char *zDate; /* Date of the initial check-in */
2399 const char *zDefaultUser; /* Optional name of the default user */
2400 int bUseSha1 = 0; /* True to set the hash-policy to sha1 */
2401
2402
2403 zTemplate = find_option("template",0,1);
2404 zDate = find_option("date-override",0,1);
2405 zDefaultUser = find_option("admin-user","A",1);
2406 bUseSha1 = find_option("sha1",0,0)!=0;
 
2407 /* We should be done with options.. */
2408 verify_all_options();
2409
2410 if( g.argc!=3 ){
2411 usage("REPOSITORY-NAME");
@@ -2422,11 +2423,11 @@
2422 db_begin_transaction();
2423 if( bUseSha1 ){
2424 g.eHashPolicy = HPOLICY_SHA1;
2425 db_set_int("hash-policy", HPOLICY_SHA1, 0);
2426 }
2427 if( zDate==0 ) zDate = "now";
2428 db_initial_setup(zTemplate, zDate, zDefaultUser);
2429 db_end_transaction(0);
2430 if( zTemplate ) db_detach("settingSrc");
2431 fossil_print("project-id: %s\n", db_get("project-code", 0));
2432 fossil_print("server-id: %s\n", db_get("server-code", 0));
2433
--- src/db.c
+++ src/db.c
@@ -2380,10 +2380,11 @@
2380 **
2381 ** Options:
2382 ** --template FILE Copy settings from repository file
2383 ** --admin-user|-A USERNAME Select given USERNAME as admin user
2384 ** --date-override DATETIME Use DATETIME as time of the initial check-in
2385 ** --empty do not create an initial check-in
2386 ** --sha1 Use an initial hash policy of "sha1"
2387 **
2388 ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
2389 ** year-month-day form, it may be truncated, the "T" may be replaced by
2390 ** a space, and it may also name a timezone offset from UTC as "-HH:MM"
@@ -2396,16 +2397,16 @@
2397 char *zPassword;
2398 const char *zTemplate; /* Repository from which to copy settings */
2399 const char *zDate; /* Date of the initial check-in */
2400 const char *zDefaultUser; /* Optional name of the default user */
2401 int bUseSha1 = 0; /* True to set the hash-policy to sha1 */
2402 int bMakeEmpty;
 
2403 zTemplate = find_option("template",0,1);
2404 zDate = find_option("date-override",0,1);
2405 zDefaultUser = find_option("admin-user","A",1);
2406 bUseSha1 = find_option("sha1",0,0)!=0;
2407 bMakeEmpty = find_option("empty",0,0)!=0;
2408 /* We should be done with options.. */
2409 verify_all_options();
2410
2411 if( g.argc!=3 ){
2412 usage("REPOSITORY-NAME");
@@ -2422,11 +2423,11 @@
2423 db_begin_transaction();
2424 if( bUseSha1 ){
2425 g.eHashPolicy = HPOLICY_SHA1;
2426 db_set_int("hash-policy", HPOLICY_SHA1, 0);
2427 }
2428 if( zDate==0 && bMakeEmpty==0 ) zDate = "now";
2429 db_initial_setup(zTemplate, zDate, zDefaultUser);
2430 db_end_transaction(0);
2431 if( zTemplate ) db_detach("settingSrc");
2432 fossil_print("project-id: %s\n", db_get("project-code", 0));
2433 fossil_print("server-id: %s\n", db_get("server-code", 0));
2434

Keyboard Shortcuts

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