Index: src/db.c ================================================================== --- src/db.c +++ src/db.c @@ -929,11 +929,11 @@ ** ** This routine always opens the user database regardless of whether or ** not the repository database is found. If the _FOSSIL_ or .fslckout file ** is found, it is attached to the open database connection too. */ -int db_open_local(void){ +int db_open_local(const char *zDbName){ int i, n; char zPwd[2000]; static const char aDbName[][10] = { "_FOSSIL_", ".fslckout", ".fos" }; if( g.localOpen) return 1; @@ -951,11 +951,11 @@ zPwd[n] = 0; } g.zLocalRoot = mprintf("%s/", zPwd); g.localOpen = 1; db_open_config(0); - db_open_repository(0); + db_open_repository(zDbName); return 1; } } n--; while( n>0 && zPwd[n]!='/' ){ n--; } @@ -1044,11 +1044,11 @@ const char *zRep = find_option("repository", "R", 1); if( zRep==0 && nArgUsed && g.argc==nArgUsed+1 ){ zRep = g.argv[nArgUsed]; } if( zRep==0 ){ - if( db_open_local()==0 ){ + if( db_open_local(0)==0 ){ goto rep_not_found; } zRep = db_repository_filename(); if( zRep==0 ){ goto rep_not_found; @@ -1130,18 +1130,18 @@ Blob repo; char *zRepo; if( g.argc!=3 ){ usage("PATHNAME"); } - if( db_open_local()==0 ){ - fossil_fatal("not in a local checkout"); - return; - } file_canonical_name(g.argv[2], &repo, 0); zRepo = blob_str(&repo); if( file_access(zRepo, 0) ){ fossil_fatal("no such file: %s", zRepo); + } + if( db_open_local(zRepo)==0 ){ + fossil_fatal("not in a local checkout"); + return; } db_open_or_attach(zRepo, "test_repo", 0); db_lset("repository", blob_str(&repo)); db_close(1); } @@ -1149,11 +1149,11 @@ /* ** Open the local database. If unable, exit with an error. */ void db_must_be_within_tree(void){ - if( db_open_local()==0 ){ + if( db_open_local(0)==0 ){ fossil_fatal("current directory is not within an open checkout"); } db_open_repository(0); db_verify_schema(); } @@ -1964,11 +1964,10 @@ ** --nested Allow opening a repository inside an opened checkout ** ** See also: close */ void cmd_open(void){ - Blob path; int vid; int keepFlag; int allowNested; static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 }; @@ -1976,15 +1975,14 @@ keepFlag = find_option("keep",0,0)!=0; allowNested = find_option("nested",0,0)!=0; if( g.argc!=3 && g.argc!=4 ){ usage("REPOSITORY-FILENAME ?VERSION?"); } - if( !allowNested && db_open_local() ){ + if( !allowNested && db_open_local(0) ){ fossil_panic("already within an open tree rooted at %s", g.zLocalRoot); } - file_canonical_name(g.argv[2], &path, 0); - db_open_repository(blob_str(&path)); + db_open_repository(g.argv[2]); #if defined(_WIN32) || defined(__CYGWIN__) # define LOCALDB_NAME "./_FOSSIL_" #else # define LOCALDB_NAME "./.fslckout" #endif @@ -1992,13 +1990,13 @@ #ifdef FOSSIL_LOCAL_WAL "COMMIT; PRAGMA journal_mode=WAL; BEGIN;", #endif (char*)0); db_delete_on_failure(LOCALDB_NAME); - db_open_local(); + db_open_local(0); db_lset("repository", g.argv[2]); - db_record_repository_filename(blob_str(&path)); + db_record_repository_filename(g.argv[2]); vid = db_int(0, "SELECT pid FROM plink y" " WHERE NOT EXISTS(SELECT 1 FROM plink x WHERE x.cid=y.pid)"); if( vid==0 ){ db_lset_int("checkout", 1); }else{ @@ -2342,11 +2340,11 @@ } if( unsetFlag && g.argc!=3 ){ usage("PROPERTY ?-global?"); } if( g.argc==2 ){ - int openLocal = db_open_local(); + int openLocal = db_open_local(0); for(i=0; ctrlSettings[i].name; i++){ print_setting(&ctrlSettings[i], openLocal); } }else if( g.argc==3 || g.argc==4 ){ const char *zName = g.argv[2]; @@ -2366,11 +2364,11 @@ db_unset(ctrlSettings[i].name, globalFlag); }else if( g.argc==4 ){ db_set(ctrlSettings[i].name, g.argv[3], globalFlag); }else{ isManifest = 0; - print_setting(&ctrlSettings[i], db_open_local()); + print_setting(&ctrlSettings[i], db_open_local(0)); } if( isManifest && g.localOpen ){ manifest_to_disk(db_lget_int("checkout", 0)); } }else{ Index: src/doc.c ================================================================== --- src/doc.c +++ src/doc.c @@ -395,11 +395,11 @@ } }else{ goto doc_not_found; } } - if( fossil_strcmp(zBaseline,"ckout")==0 && db_open_local()==0 ){ + if( fossil_strcmp(zBaseline,"ckout")==0 && db_open_local(0)==0 ){ sqlite3_snprintf(sizeof(zBaseline), zBaseline, "tip"); } if( fossil_strcmp(zBaseline,"ckout")==0 ){ /* Read from the local checkout */ char *zFullpath; Index: src/json_status.c ================================================================== --- src/json_status.c +++ src/json_status.c @@ -46,11 +46,11 @@ cson_object * tmpO; char * zTmp; i64 iMtime; cson_array * aFiles; - if(!db_open_local()){ + if(!db_open_local(0)){ json_set_err(FSL_JSON_E_DB_NEEDS_CHECKOUT, NULL); return NULL; } oPay = cson_new_object(); cson_object_set(oPay, "repository", Index: src/setup.c ================================================================== --- src/setup.c +++ src/setup.c @@ -1175,11 +1175,11 @@ if( !g.perm.Setup ){ login_needed(); } style_header("Settings"); - db_open_local(); + db_open_local(0); db_begin_transaction(); @

This page provides a simple interface to the "fossil setting" command. @ See the "fossil help setting" output below for further information on @ the meaning of each setting.


@