| | @@ -1469,23 +1469,25 @@ |
| 1469 | 1469 | ** Options: |
| 1470 | 1470 | ** --template FILE copy settings from repository file |
| 1471 | 1471 | ** --admin-user|-A USERNAME select given USERNAME as admin user |
| 1472 | 1472 | ** --date-override DATETIME use DATETIME as time of the initial checkin |
| 1473 | 1473 | ** (default: do not create an initial checkin) |
| 1474 | +** --empty create repository without project-id/server-id |
| 1474 | 1475 | ** |
| 1475 | 1476 | ** See also: clone |
| 1476 | 1477 | */ |
| 1477 | 1478 | void create_repository_cmd(void){ |
| 1478 | 1479 | char *zPassword; |
| 1479 | 1480 | const char *zTemplate; /* Repository from which to copy settings */ |
| 1480 | 1481 | const char *zDate; /* Date of the initial check-in */ |
| 1481 | 1482 | const char *zDefaultUser; /* Optional name of the default user */ |
| 1483 | + int makeServerCodes; |
| 1482 | 1484 | |
| 1483 | 1485 | zTemplate = find_option("template",0,1); |
| 1484 | 1486 | zDate = find_option("date-override",0,1); |
| 1485 | 1487 | zDefaultUser = find_option("admin-user","A",1); |
| 1486 | | - find_option("empty", 0, 0); /* deprecated */ |
| 1488 | + makeServerCodes = find_option("empty", 0, 0)==0; |
| 1487 | 1489 | |
| 1488 | 1490 | /* We should be done with options.. */ |
| 1489 | 1491 | verify_all_options(); |
| 1490 | 1492 | |
| 1491 | 1493 | if( g.argc!=3 ){ |
| | @@ -1494,15 +1496,17 @@ |
| 1494 | 1496 | db_create_repository(g.argv[2]); |
| 1495 | 1497 | db_open_repository(g.argv[2]); |
| 1496 | 1498 | db_open_config(0); |
| 1497 | 1499 | if( zTemplate ) db_attach(zTemplate, "settingSrc"); |
| 1498 | 1500 | db_begin_transaction(); |
| 1499 | | - db_initial_setup(zTemplate, zDate, zDefaultUser, 1); |
| 1501 | + db_initial_setup(zTemplate, zDate, zDefaultUser, makeServerCodes); |
| 1500 | 1502 | db_end_transaction(0); |
| 1501 | 1503 | if( zTemplate ) db_detach("settingSrc"); |
| 1502 | | - fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 1503 | | - fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 1504 | + if( makeServerCodes ){ |
| 1505 | + fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 1506 | + fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 1507 | + } |
| 1504 | 1508 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 1505 | 1509 | fossil_print("admin-user: %s (initial password is \"%s\")\n", |
| 1506 | 1510 | g.zLogin, zPassword); |
| 1507 | 1511 | } |
| 1508 | 1512 | |
| 1509 | 1513 | |