Fossil SCM
Add the --nested option to the "open" command to allow checkouts from one repository to be created inside the checkout of another respository.
Commit
f15943f3399ae794bfda602074cd8fe122b399d6
Parent
6502627a3ec4b67…
1 file changed
+5
-2
M
src/db.c
+5
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1508,11 +1508,11 @@ | ||
| 1508 | 1508 | } |
| 1509 | 1509 | |
| 1510 | 1510 | /* |
| 1511 | 1511 | ** COMMAND: open |
| 1512 | 1512 | ** |
| 1513 | -** Usage: %fossil open FILENAME ?VERSION? ?--keep? | |
| 1513 | +** Usage: %fossil open FILENAME ?VERSION? ?--keep? ?--nested? | |
| 1514 | 1514 | ** |
| 1515 | 1515 | ** Open a connection to the local repository in FILENAME. A checkout |
| 1516 | 1516 | ** for the repository is created with its root at the working directory. |
| 1517 | 1517 | ** If VERSION is specified then that version is checked out. Otherwise |
| 1518 | 1518 | ** the latest version is checked out. No files other than "manifest" |
| @@ -1522,17 +1522,20 @@ | ||
| 1522 | 1522 | */ |
| 1523 | 1523 | void cmd_open(void){ |
| 1524 | 1524 | Blob path; |
| 1525 | 1525 | int vid; |
| 1526 | 1526 | int keepFlag; |
| 1527 | + int allowNested; | |
| 1527 | 1528 | static char *azNewArgv[] = { 0, "checkout", "--prompt", "--latest", 0, 0 }; |
| 1529 | + | |
| 1528 | 1530 | url_proxy_options(); |
| 1529 | 1531 | keepFlag = find_option("keep",0,0)!=0; |
| 1532 | + allowNested = find_option("nested",0,0)!=0; | |
| 1530 | 1533 | if( g.argc!=3 && g.argc!=4 ){ |
| 1531 | 1534 | usage("REPOSITORY-FILENAME ?VERSION?"); |
| 1532 | 1535 | } |
| 1533 | - if( db_open_local() ){ | |
| 1536 | + if( !allowNested && db_open_local() ){ | |
| 1534 | 1537 | fossil_panic("already within an open tree rooted at %s", g.zLocalRoot); |
| 1535 | 1538 | } |
| 1536 | 1539 | file_canonical_name(g.argv[2], &path); |
| 1537 | 1540 | db_open_repository(blob_str(&path)); |
| 1538 | 1541 | db_init_database("./_FOSSIL_", zLocalSchema, (char*)0); |
| 1539 | 1542 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1508,11 +1508,11 @@ | |
| 1508 | } |
| 1509 | |
| 1510 | /* |
| 1511 | ** COMMAND: open |
| 1512 | ** |
| 1513 | ** Usage: %fossil open FILENAME ?VERSION? ?--keep? |
| 1514 | ** |
| 1515 | ** Open a connection to the local repository in FILENAME. A checkout |
| 1516 | ** for the repository is created with its root at the working directory. |
| 1517 | ** If VERSION is specified then that version is checked out. Otherwise |
| 1518 | ** the latest version is checked out. No files other than "manifest" |
| @@ -1522,17 +1522,20 @@ | |
| 1522 | */ |
| 1523 | void cmd_open(void){ |
| 1524 | Blob path; |
| 1525 | int vid; |
| 1526 | int keepFlag; |
| 1527 | static char *azNewArgv[] = { 0, "checkout", "--prompt", "--latest", 0, 0 }; |
| 1528 | url_proxy_options(); |
| 1529 | keepFlag = find_option("keep",0,0)!=0; |
| 1530 | if( g.argc!=3 && g.argc!=4 ){ |
| 1531 | usage("REPOSITORY-FILENAME ?VERSION?"); |
| 1532 | } |
| 1533 | if( db_open_local() ){ |
| 1534 | fossil_panic("already within an open tree rooted at %s", g.zLocalRoot); |
| 1535 | } |
| 1536 | file_canonical_name(g.argv[2], &path); |
| 1537 | db_open_repository(blob_str(&path)); |
| 1538 | db_init_database("./_FOSSIL_", zLocalSchema, (char*)0); |
| 1539 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1508,11 +1508,11 @@ | |
| 1508 | } |
| 1509 | |
| 1510 | /* |
| 1511 | ** COMMAND: open |
| 1512 | ** |
| 1513 | ** Usage: %fossil open FILENAME ?VERSION? ?--keep? ?--nested? |
| 1514 | ** |
| 1515 | ** Open a connection to the local repository in FILENAME. A checkout |
| 1516 | ** for the repository is created with its root at the working directory. |
| 1517 | ** If VERSION is specified then that version is checked out. Otherwise |
| 1518 | ** the latest version is checked out. No files other than "manifest" |
| @@ -1522,17 +1522,20 @@ | |
| 1522 | */ |
| 1523 | void cmd_open(void){ |
| 1524 | Blob path; |
| 1525 | int vid; |
| 1526 | int keepFlag; |
| 1527 | int allowNested; |
| 1528 | static char *azNewArgv[] = { 0, "checkout", "--prompt", "--latest", 0, 0 }; |
| 1529 | |
| 1530 | url_proxy_options(); |
| 1531 | keepFlag = find_option("keep",0,0)!=0; |
| 1532 | allowNested = find_option("nested",0,0)!=0; |
| 1533 | if( g.argc!=3 && g.argc!=4 ){ |
| 1534 | usage("REPOSITORY-FILENAME ?VERSION?"); |
| 1535 | } |
| 1536 | if( !allowNested && db_open_local() ){ |
| 1537 | fossil_panic("already within an open tree rooted at %s", g.zLocalRoot); |
| 1538 | } |
| 1539 | file_canonical_name(g.argv[2], &path); |
| 1540 | db_open_repository(blob_str(&path)); |
| 1541 | db_init_database("./_FOSSIL_", zLocalSchema, (char*)0); |
| 1542 |