Fossil SCM
Partially backout [620783cae23d28bd73959006af71f859e8b7333e|620783cae2] (adapted to current coding style): This brings back the --empty option there once was.
Commit
971a5f513c15647b23d9ad7f8d7eda3b48f4224c5e67e53d5d19d68b79ba76a0
Parent
ea4010d58ac64ea…
1 file changed
+4
-3
M
src/db.c
+4
-3
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2380,10 +2380,11 @@ | ||
| 2380 | 2380 | ** |
| 2381 | 2381 | ** Options: |
| 2382 | 2382 | ** --template FILE Copy settings from repository file |
| 2383 | 2383 | ** --admin-user|-A USERNAME Select given USERNAME as admin user |
| 2384 | 2384 | ** --date-override DATETIME Use DATETIME as time of the initial check-in |
| 2385 | +** --empty do not create an initial check-in | |
| 2385 | 2386 | ** --sha1 Use an initial hash policy of "sha1" |
| 2386 | 2387 | ** |
| 2387 | 2388 | ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in |
| 2388 | 2389 | ** year-month-day form, it may be truncated, the "T" may be replaced by |
| 2389 | 2390 | ** a space, and it may also name a timezone offset from UTC as "-HH:MM" |
| @@ -2396,16 +2397,16 @@ | ||
| 2396 | 2397 | char *zPassword; |
| 2397 | 2398 | const char *zTemplate; /* Repository from which to copy settings */ |
| 2398 | 2399 | const char *zDate; /* Date of the initial check-in */ |
| 2399 | 2400 | const char *zDefaultUser; /* Optional name of the default user */ |
| 2400 | 2401 | int bUseSha1 = 0; /* True to set the hash-policy to sha1 */ |
| 2401 | - | |
| 2402 | - | |
| 2402 | + int bMakeEmpty; | |
| 2403 | 2403 | zTemplate = find_option("template",0,1); |
| 2404 | 2404 | zDate = find_option("date-override",0,1); |
| 2405 | 2405 | zDefaultUser = find_option("admin-user","A",1); |
| 2406 | 2406 | bUseSha1 = find_option("sha1",0,0)!=0; |
| 2407 | + bMakeEmpty = find_option("empty",0,0)!=0; | |
| 2407 | 2408 | /* We should be done with options.. */ |
| 2408 | 2409 | verify_all_options(); |
| 2409 | 2410 | |
| 2410 | 2411 | if( g.argc!=3 ){ |
| 2411 | 2412 | usage("REPOSITORY-NAME"); |
| @@ -2422,11 +2423,11 @@ | ||
| 2422 | 2423 | db_begin_transaction(); |
| 2423 | 2424 | if( bUseSha1 ){ |
| 2424 | 2425 | g.eHashPolicy = HPOLICY_SHA1; |
| 2425 | 2426 | db_set_int("hash-policy", HPOLICY_SHA1, 0); |
| 2426 | 2427 | } |
| 2427 | - if( zDate==0 ) zDate = "now"; | |
| 2428 | + if( zDate==0 && bMakeEmpty==0 ) zDate = "now"; | |
| 2428 | 2429 | db_initial_setup(zTemplate, zDate, zDefaultUser); |
| 2429 | 2430 | db_end_transaction(0); |
| 2430 | 2431 | if( zTemplate ) db_detach("settingSrc"); |
| 2431 | 2432 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 2432 | 2433 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 2433 | 2434 |
| --- 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 |