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.

drh 2011-02-08 14:28 trunk
Commit f15943f3399ae794bfda602074cd8fe122b399d6
1 file changed +5 -2
+5 -2
--- src/db.c
+++ src/db.c
@@ -1508,11 +1508,11 @@
15081508
}
15091509
15101510
/*
15111511
** COMMAND: open
15121512
**
1513
-** Usage: %fossil open FILENAME ?VERSION? ?--keep?
1513
+** Usage: %fossil open FILENAME ?VERSION? ?--keep? ?--nested?
15141514
**
15151515
** Open a connection to the local repository in FILENAME. A checkout
15161516
** for the repository is created with its root at the working directory.
15171517
** If VERSION is specified then that version is checked out. Otherwise
15181518
** the latest version is checked out. No files other than "manifest"
@@ -1522,17 +1522,20 @@
15221522
*/
15231523
void cmd_open(void){
15241524
Blob path;
15251525
int vid;
15261526
int keepFlag;
1527
+ int allowNested;
15271528
static char *azNewArgv[] = { 0, "checkout", "--prompt", "--latest", 0, 0 };
1529
+
15281530
url_proxy_options();
15291531
keepFlag = find_option("keep",0,0)!=0;
1532
+ allowNested = find_option("nested",0,0)!=0;
15301533
if( g.argc!=3 && g.argc!=4 ){
15311534
usage("REPOSITORY-FILENAME ?VERSION?");
15321535
}
1533
- if( db_open_local() ){
1536
+ if( !allowNested && db_open_local() ){
15341537
fossil_panic("already within an open tree rooted at %s", g.zLocalRoot);
15351538
}
15361539
file_canonical_name(g.argv[2], &path);
15371540
db_open_repository(blob_str(&path));
15381541
db_init_database("./_FOSSIL_", zLocalSchema, (char*)0);
15391542
--- 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

Keyboard Shortcuts

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