Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Proposed fix for ticket: test-move-repository requires access to original repository |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | fix-test-move-repository |
| Files: | files | file ages | folders |
| SHA1: |
1b61defd58092e375cc3fd4857138bf8 |
| User & Date: | jan.nijtmans 2013-03-04 10:25:34.850 |
Context
|
2013-03-06
| ||
| 14:40 | merge trunk check-in: 7aa9f66f92 user: jan.nijtmans tags: fix-test-move-repository | |
| 14:22 | merge trunk (committed to wrong branch) Closed-Leaf check-in: aeb1cfe112 user: jan.nijtmans tags: mistake | |
|
2013-03-04
| ||
| 10:25 | Proposed fix for ticket: test-move-repository requires access to original repository check-in: 1b61defd58 user: jan.nijtmans tags: fix-test-move-repository | |
|
2013-03-03
| ||
| 15:39 | minor cut/paste error check-in: b163569a8c user: jan.nijtmans tags: trunk | |
Changes
Changes to src/db.c.
| ︙ | ︙ | |||
933 934 935 936 937 938 939 | ** to the root of the repository tree and this routine returns 1. If ** no database is found, then this routine return 0. ** ** This routine always opens the user database regardless of whether or ** not the repository database is found. If the _FOSSIL_ or .fos file ** is found, it is attached to the open database connection too. */ | | | 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 |
** to the root of the repository tree and this routine returns 1. If
** no database is found, then this routine return 0.
**
** This routine always opens the user database regardless of whether or
** not the repository database is found. If the _FOSSIL_ or .fos file
** is found, it is attached to the open database connection too.
*/
int db_open_local(const char *zDbName){
int i, n;
char zPwd[2000];
static const char *const aDbName[] = { "/_FOSSIL_", "/.fslckout", "/.fos" };
if( g.localOpen) return 1;
file_getcwd(zPwd, sizeof(zPwd)-20);
n = strlen(zPwd);
|
| ︙ | ︙ | |||
956 957 958 959 960 961 962 |
while( n>1 && zPwd[n-1]=='/' ){
n--;
zPwd[n] = 0;
}
g.zLocalRoot = mprintf("%s/", zPwd);
g.localOpen = 1;
db_open_config(0);
| | | 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 |
while( n>1 && zPwd[n-1]=='/' ){
n--;
zPwd[n] = 0;
}
g.zLocalRoot = mprintf("%s/", zPwd);
g.localOpen = 1;
db_open_config(0);
db_open_repository(zDbName);
return 1;
}
}
n--;
while( n>0 && zPwd[n]!='/' ){ n--; }
while( n>0 && zPwd[n-1]=='/' ){ n--; }
zPwd[n] = 0;
|
| ︙ | ︙ | |||
1049 1050 1051 1052 1053 1054 1055 |
*/
void db_find_and_open_repository(int bFlags, int nArgUsed){
const char *zRep = find_option("repository", "R", 1);
if( zRep==0 && nArgUsed && g.argc==nArgUsed+1 ){
zRep = g.argv[nArgUsed];
}
if( zRep==0 ){
| | | 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 |
*/
void db_find_and_open_repository(int bFlags, int nArgUsed){
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)==0 ){
goto rep_not_found;
}
zRep = db_repository_filename();
if( zRep==0 ){
goto rep_not_found;
}
}
|
| ︙ | ︙ | |||
1135 1136 1137 1138 1139 1140 1141 |
*/
void move_repo_cmd(void){
Blob repo;
char *zRepo;
if( g.argc!=3 ){
usage("PATHNAME");
}
| < < < < > > > > | | 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 |
*/
void move_repo_cmd(void){
Blob repo;
char *zRepo;
if( g.argc!=3 ){
usage("PATHNAME");
}
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);
}
/*
** Open the local database. If unable, exit with an error.
*/
void db_must_be_within_tree(void){
if( db_open_local(0)==0 ){
fossil_fatal("current directory is not within an open checkout");
}
db_open_repository(0);
db_verify_schema();
}
/*
|
| ︙ | ︙ | |||
1969 1970 1971 1972 1973 1974 1975 |
** Options:
** --keep Only modify the manifest and manifest.uuid files
** --nested Allow opening a repository inside an opened checkout
**
** See also: close
*/
void cmd_open(void){
| < | < | | | | 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 |
** Options:
** --keep Only modify the manifest and manifest.uuid files
** --nested Allow opening a repository inside an opened checkout
**
** See also: close
*/
void cmd_open(void){
int vid;
int keepFlag;
int allowNested;
static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 };
url_proxy_options();
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(0) ){
fossil_panic("already within an open tree rooted at %s", g.zLocalRoot);
}
db_open_repository(g.argv[2]);
#if defined(_WIN32) || defined(__CYGWIN__)
# define LOCALDB_NAME "./_FOSSIL_"
#else
# define LOCALDB_NAME "./.fslckout"
#endif
db_init_database(LOCALDB_NAME, zLocalSchema,
#ifdef FOSSIL_LOCAL_WAL
"COMMIT; PRAGMA journal_mode=WAL; BEGIN;",
#endif
(char*)0);
db_delete_on_failure(LOCALDB_NAME);
db_open_local(0);
db_lset("repository", g.argv[2]);
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{
char **oldArgv = g.argv;
int oldArgc = g.argc;
|
| ︙ | ︙ | |||
2347 2348 2349 2350 2351 2352 2353 |
if( !g.repositoryOpen ){
globalFlag = 1;
}
if( unsetFlag && g.argc!=3 ){
usage("PROPERTY ?-global?");
}
if( g.argc==2 ){
| | | 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 |
if( !g.repositoryOpen ){
globalFlag = 1;
}
if( unsetFlag && g.argc!=3 ){
usage("PROPERTY ?-global?");
}
if( g.argc==2 ){
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];
int isManifest;
int n = strlen(zName);
|
| ︙ | ︙ | |||
2371 2372 2373 2374 2375 2376 2377 |
}
if( unsetFlag ){
db_unset(ctrlSettings[i].name, globalFlag);
}else if( g.argc==4 ){
db_set(ctrlSettings[i].name, g.argv[3], globalFlag);
}else{
isManifest = 0;
| | | 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 |
}
if( unsetFlag ){
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(0));
}
if( isManifest && g.localOpen ){
manifest_to_disk(db_lget_int("checkout", 0));
}
}else{
usage("?PROPERTY? ?VALUE?");
}
|
| ︙ | ︙ |
Changes to src/doc.c.
| ︙ | ︙ | |||
393 394 395 396 397 398 399 |
if( !file_is_simple_pathname(zName, 1) ){
goto doc_not_found;
}
}else{
goto doc_not_found;
}
}
| | | 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
if( !file_is_simple_pathname(zName, 1) ){
goto doc_not_found;
}
}else{
goto doc_not_found;
}
}
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;
db_must_be_within_tree();
zFullpath = mprintf("%s/%s", g.zLocalRoot, zName);
|
| ︙ | ︙ |
Changes to src/json_status.c.
| ︙ | ︙ | |||
45 46 47 48 49 50 51 | /*cson_object * files;*/ int vid, nErr = 0; cson_object * tmpO; char * zTmp; i64 iMtime; cson_array * aFiles; | | | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
/*cson_object * files;*/
int vid, nErr = 0;
cson_object * tmpO;
char * zTmp;
i64 iMtime;
cson_array * aFiles;
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",
json_new_string(db_repository_filename()));
cson_object_set(oPay, "localRoot",
|
| ︙ | ︙ |
Changes to src/setup.c.
| ︙ | ︙ | |||
1173 1174 1175 1176 1177 1178 1179 |
login_check_credentials();
if( !g.perm.Setup ){
login_needed();
}
style_header("Settings");
| | | 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 |
login_check_credentials();
if( !g.perm.Setup ){
login_needed();
}
style_header("Settings");
db_open_local(0);
db_begin_transaction();
@ <p>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.</p><hr />
@ <form action="%s(g.zTop)/setup_settings" method="post"><div>
@ <table border="0"><tr><td valign="top">
login_insert_csrf_secret();
|
| ︙ | ︙ |