Fossil SCM
Remove traces. Waiting approval to merge on trunk..
Commit
84abd455338f32e7bf68f72f3d5298465247da80
Parent
be993c47d5dd6d3…
1 file changed
-10
M
src/db.c
-10
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -934,22 +934,18 @@ | ||
| 934 | 934 | ** |
| 935 | 935 | ** This routine always opens the user database regardless of whether or |
| 936 | 936 | ** not the repository database is found. If the _FOSSIL_ or .fslckout file |
| 937 | 937 | ** is found, it is attached to the open database connection too. |
| 938 | 938 | */ |
| 939 | -/* #define DBG_CHECKOUT_ON_ROOT_FIX 1 */ | |
| 940 | 939 | int db_open_local(const char *zDbName){ |
| 941 | 940 | int i, n; |
| 942 | 941 | char zPwd[2000]; |
| 943 | 942 | static const char aDbName[][10] = { "_FOSSIL_", ".fslckout", ".fos" }; |
| 944 | 943 | |
| 945 | 944 | if( g.localOpen) return 1; |
| 946 | 945 | file_getcwd(zPwd, sizeof(zPwd)-20); |
| 947 | 946 | n = strlen(zPwd); |
| 948 | -#ifdef DBG_CHECKOUT_ON_ROOT_FIX | |
| 949 | - fossil_trace("---> DEBUG: zPwd: %s, n: %d\n", zPwd, n); | |
| 950 | -#endif | |
| 951 | 947 | while( n>0 ){ |
| 952 | 948 | for(i=0; i<count(aDbName); i++){ |
| 953 | 949 | sqlite3_snprintf(sizeof(zPwd)-n, &zPwd[n], "/%s", aDbName[i]); |
| 954 | 950 | if( isValidLocalDb(zPwd) ){ |
| 955 | 951 | /* Found a valid checkout database file */ |
| @@ -957,13 +953,10 @@ | ||
| 957 | 953 | while( n>0 && zPwd[n-1]=='/' ){ |
| 958 | 954 | n--; |
| 959 | 955 | zPwd[n] = 0; |
| 960 | 956 | } |
| 961 | 957 | g.zLocalRoot = mprintf("%s/", zPwd); |
| 962 | -#ifdef DBG_CHECKOUT_ON_ROOT_FIX | |
| 963 | - fossil_trace("---> DEBUG: g.zLocalRoot: %s\n", g.zLocalRoot); | |
| 964 | -#endif | |
| 965 | 958 | g.localOpen = 1; |
| 966 | 959 | db_open_config(0); |
| 967 | 960 | db_open_repository(zDbName); |
| 968 | 961 | return 1; |
| 969 | 962 | } |
| @@ -970,13 +963,10 @@ | ||
| 970 | 963 | } |
| 971 | 964 | n--; |
| 972 | 965 | while( n>1 && zPwd[n]!='/' ){ n--; } |
| 973 | 966 | while( n>1 && zPwd[n-1]=='/' ){ n--; } |
| 974 | 967 | zPwd[n] = 0; |
| 975 | -#ifdef DBG_CHECKOUT_ON_ROOT_FIX | |
| 976 | - fossil_trace("---> DEBUG: next zPwd: %s, n: %d\n", zPwd, n); | |
| 977 | -#endif | |
| 978 | 968 | } |
| 979 | 969 | |
| 980 | 970 | /* A checkout database file could not be found */ |
| 981 | 971 | return 0; |
| 982 | 972 | } |
| 983 | 973 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -934,22 +934,18 @@ | |
| 934 | ** |
| 935 | ** This routine always opens the user database regardless of whether or |
| 936 | ** not the repository database is found. If the _FOSSIL_ or .fslckout file |
| 937 | ** is found, it is attached to the open database connection too. |
| 938 | */ |
| 939 | /* #define DBG_CHECKOUT_ON_ROOT_FIX 1 */ |
| 940 | int db_open_local(const char *zDbName){ |
| 941 | int i, n; |
| 942 | char zPwd[2000]; |
| 943 | static const char aDbName[][10] = { "_FOSSIL_", ".fslckout", ".fos" }; |
| 944 | |
| 945 | if( g.localOpen) return 1; |
| 946 | file_getcwd(zPwd, sizeof(zPwd)-20); |
| 947 | n = strlen(zPwd); |
| 948 | #ifdef DBG_CHECKOUT_ON_ROOT_FIX |
| 949 | fossil_trace("---> DEBUG: zPwd: %s, n: %d\n", zPwd, n); |
| 950 | #endif |
| 951 | while( n>0 ){ |
| 952 | for(i=0; i<count(aDbName); i++){ |
| 953 | sqlite3_snprintf(sizeof(zPwd)-n, &zPwd[n], "/%s", aDbName[i]); |
| 954 | if( isValidLocalDb(zPwd) ){ |
| 955 | /* Found a valid checkout database file */ |
| @@ -957,13 +953,10 @@ | |
| 957 | while( n>0 && zPwd[n-1]=='/' ){ |
| 958 | n--; |
| 959 | zPwd[n] = 0; |
| 960 | } |
| 961 | g.zLocalRoot = mprintf("%s/", zPwd); |
| 962 | #ifdef DBG_CHECKOUT_ON_ROOT_FIX |
| 963 | fossil_trace("---> DEBUG: g.zLocalRoot: %s\n", g.zLocalRoot); |
| 964 | #endif |
| 965 | g.localOpen = 1; |
| 966 | db_open_config(0); |
| 967 | db_open_repository(zDbName); |
| 968 | return 1; |
| 969 | } |
| @@ -970,13 +963,10 @@ | |
| 970 | } |
| 971 | n--; |
| 972 | while( n>1 && zPwd[n]!='/' ){ n--; } |
| 973 | while( n>1 && zPwd[n-1]=='/' ){ n--; } |
| 974 | zPwd[n] = 0; |
| 975 | #ifdef DBG_CHECKOUT_ON_ROOT_FIX |
| 976 | fossil_trace("---> DEBUG: next zPwd: %s, n: %d\n", zPwd, n); |
| 977 | #endif |
| 978 | } |
| 979 | |
| 980 | /* A checkout database file could not be found */ |
| 981 | return 0; |
| 982 | } |
| 983 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -934,22 +934,18 @@ | |
| 934 | ** |
| 935 | ** This routine always opens the user database regardless of whether or |
| 936 | ** not the repository database is found. If the _FOSSIL_ or .fslckout file |
| 937 | ** is found, it is attached to the open database connection too. |
| 938 | */ |
| 939 | int db_open_local(const char *zDbName){ |
| 940 | int i, n; |
| 941 | char zPwd[2000]; |
| 942 | static const char aDbName[][10] = { "_FOSSIL_", ".fslckout", ".fos" }; |
| 943 | |
| 944 | if( g.localOpen) return 1; |
| 945 | file_getcwd(zPwd, sizeof(zPwd)-20); |
| 946 | n = strlen(zPwd); |
| 947 | while( n>0 ){ |
| 948 | for(i=0; i<count(aDbName); i++){ |
| 949 | sqlite3_snprintf(sizeof(zPwd)-n, &zPwd[n], "/%s", aDbName[i]); |
| 950 | if( isValidLocalDb(zPwd) ){ |
| 951 | /* Found a valid checkout database file */ |
| @@ -957,13 +953,10 @@ | |
| 953 | while( n>0 && zPwd[n-1]=='/' ){ |
| 954 | n--; |
| 955 | zPwd[n] = 0; |
| 956 | } |
| 957 | g.zLocalRoot = mprintf("%s/", zPwd); |
| 958 | g.localOpen = 1; |
| 959 | db_open_config(0); |
| 960 | db_open_repository(zDbName); |
| 961 | return 1; |
| 962 | } |
| @@ -970,13 +963,10 @@ | |
| 963 | } |
| 964 | n--; |
| 965 | while( n>1 && zPwd[n]!='/' ){ n--; } |
| 966 | while( n>1 && zPwd[n-1]=='/' ){ n--; } |
| 967 | zPwd[n] = 0; |
| 968 | } |
| 969 | |
| 970 | /* A checkout database file could not be found */ |
| 971 | return 0; |
| 972 | } |
| 973 |