Fossil SCM
Enable symlinks by default on non-Windows platforms and make sure that the 'open' command honors the global 'allow-symlinks' setting in addition to the versioned and per-repository ones.
Commit
9ecbfb372498ae6d770b92f77257b1dc15d4d5ee
Parent
c985d905c67d993…
1 file changed
+9
-6
M
src/db.c
+9
-6
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2247,16 +2247,10 @@ | ||
| 2247 | 2247 | }else if( db_exists("SELECT 1 FROM event WHERE type='ci'") ){ |
| 2248 | 2248 | g.zOpenRevision = db_get("main-branch", "trunk"); |
| 2249 | 2249 | } |
| 2250 | 2250 | } |
| 2251 | 2251 | |
| 2252 | - if( g.zOpenRevision ){ | |
| 2253 | - /* Since the repository is open and we know the revision now, | |
| 2254 | - ** refresh the allow-symlinks flag. */ | |
| 2255 | - g.allowSymlinks = db_get_boolean("allow-symlinks", 0); | |
| 2256 | - } | |
| 2257 | - | |
| 2258 | 2252 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 2259 | 2253 | # define LOCALDB_NAME "./_FOSSIL_" |
| 2260 | 2254 | #else |
| 2261 | 2255 | # define LOCALDB_NAME "./.fslckout" |
| 2262 | 2256 | #endif |
| @@ -2265,10 +2259,15 @@ | ||
| 2265 | 2259 | "COMMIT; PRAGMA journal_mode=WAL; BEGIN;", |
| 2266 | 2260 | #endif |
| 2267 | 2261 | (char*)0); |
| 2268 | 2262 | db_delete_on_failure(LOCALDB_NAME); |
| 2269 | 2263 | db_open_local(0); |
| 2264 | + if( g.zOpenRevision ){ | |
| 2265 | + /* Since the repository is open and we know the revision now, | |
| 2266 | + ** refresh the allow-symlinks flag. */ | |
| 2267 | + g.allowSymlinks = db_get_boolean("allow-symlinks", 0); | |
| 2268 | + } | |
| 2270 | 2269 | db_lset("repository", g.argv[2]); |
| 2271 | 2270 | db_record_repository_filename(g.argv[2]); |
| 2272 | 2271 | db_lset_int("checkout", 0); |
| 2273 | 2272 | azNewArgv[0] = g.argv[0]; |
| 2274 | 2273 | g.argv = azNewArgv; |
| @@ -2356,11 +2355,15 @@ | ||
| 2356 | 2355 | #endif /* INTERFACE */ |
| 2357 | 2356 | |
| 2358 | 2357 | const Setting aSetting[] = { |
| 2359 | 2358 | { "access-log", 0, 0, 0, 0, "off" }, |
| 2360 | 2359 | { "admin-log", 0, 0, 0, 0, "off" }, |
| 2360 | +#if defined(_WIN32) | |
| 2361 | 2361 | { "allow-symlinks", 0, 0, 1, 0, "off" }, |
| 2362 | +#else | |
| 2363 | + { "allow-symlinks", 0, 0, 1, 0, "on" }, | |
| 2364 | +#endif | |
| 2362 | 2365 | { "auto-captcha", "autocaptcha", 0, 0, 0, "on" }, |
| 2363 | 2366 | { "auto-hyperlink", 0, 0, 0, 0, "on", }, |
| 2364 | 2367 | { "auto-shun", 0, 0, 0, 0, "on" }, |
| 2365 | 2368 | { "autosync", 0, 0, 0, 0, "on" }, |
| 2366 | 2369 | { "autosync-tries", 0, 16, 0, 0, "1" }, |
| 2367 | 2370 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2247,16 +2247,10 @@ | |
| 2247 | }else if( db_exists("SELECT 1 FROM event WHERE type='ci'") ){ |
| 2248 | g.zOpenRevision = db_get("main-branch", "trunk"); |
| 2249 | } |
| 2250 | } |
| 2251 | |
| 2252 | if( g.zOpenRevision ){ |
| 2253 | /* Since the repository is open and we know the revision now, |
| 2254 | ** refresh the allow-symlinks flag. */ |
| 2255 | g.allowSymlinks = db_get_boolean("allow-symlinks", 0); |
| 2256 | } |
| 2257 | |
| 2258 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 2259 | # define LOCALDB_NAME "./_FOSSIL_" |
| 2260 | #else |
| 2261 | # define LOCALDB_NAME "./.fslckout" |
| 2262 | #endif |
| @@ -2265,10 +2259,15 @@ | |
| 2265 | "COMMIT; PRAGMA journal_mode=WAL; BEGIN;", |
| 2266 | #endif |
| 2267 | (char*)0); |
| 2268 | db_delete_on_failure(LOCALDB_NAME); |
| 2269 | db_open_local(0); |
| 2270 | db_lset("repository", g.argv[2]); |
| 2271 | db_record_repository_filename(g.argv[2]); |
| 2272 | db_lset_int("checkout", 0); |
| 2273 | azNewArgv[0] = g.argv[0]; |
| 2274 | g.argv = azNewArgv; |
| @@ -2356,11 +2355,15 @@ | |
| 2356 | #endif /* INTERFACE */ |
| 2357 | |
| 2358 | const Setting aSetting[] = { |
| 2359 | { "access-log", 0, 0, 0, 0, "off" }, |
| 2360 | { "admin-log", 0, 0, 0, 0, "off" }, |
| 2361 | { "allow-symlinks", 0, 0, 1, 0, "off" }, |
| 2362 | { "auto-captcha", "autocaptcha", 0, 0, 0, "on" }, |
| 2363 | { "auto-hyperlink", 0, 0, 0, 0, "on", }, |
| 2364 | { "auto-shun", 0, 0, 0, 0, "on" }, |
| 2365 | { "autosync", 0, 0, 0, 0, "on" }, |
| 2366 | { "autosync-tries", 0, 16, 0, 0, "1" }, |
| 2367 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2247,16 +2247,10 @@ | |
| 2247 | }else if( db_exists("SELECT 1 FROM event WHERE type='ci'") ){ |
| 2248 | g.zOpenRevision = db_get("main-branch", "trunk"); |
| 2249 | } |
| 2250 | } |
| 2251 | |
| 2252 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 2253 | # define LOCALDB_NAME "./_FOSSIL_" |
| 2254 | #else |
| 2255 | # define LOCALDB_NAME "./.fslckout" |
| 2256 | #endif |
| @@ -2265,10 +2259,15 @@ | |
| 2259 | "COMMIT; PRAGMA journal_mode=WAL; BEGIN;", |
| 2260 | #endif |
| 2261 | (char*)0); |
| 2262 | db_delete_on_failure(LOCALDB_NAME); |
| 2263 | db_open_local(0); |
| 2264 | if( g.zOpenRevision ){ |
| 2265 | /* Since the repository is open and we know the revision now, |
| 2266 | ** refresh the allow-symlinks flag. */ |
| 2267 | g.allowSymlinks = db_get_boolean("allow-symlinks", 0); |
| 2268 | } |
| 2269 | db_lset("repository", g.argv[2]); |
| 2270 | db_record_repository_filename(g.argv[2]); |
| 2271 | db_lset_int("checkout", 0); |
| 2272 | azNewArgv[0] = g.argv[0]; |
| 2273 | g.argv = azNewArgv; |
| @@ -2356,11 +2355,15 @@ | |
| 2355 | #endif /* INTERFACE */ |
| 2356 | |
| 2357 | const Setting aSetting[] = { |
| 2358 | { "access-log", 0, 0, 0, 0, "off" }, |
| 2359 | { "admin-log", 0, 0, 0, 0, "off" }, |
| 2360 | #if defined(_WIN32) |
| 2361 | { "allow-symlinks", 0, 0, 1, 0, "off" }, |
| 2362 | #else |
| 2363 | { "allow-symlinks", 0, 0, 1, 0, "on" }, |
| 2364 | #endif |
| 2365 | { "auto-captcha", "autocaptcha", 0, 0, 0, "on" }, |
| 2366 | { "auto-hyperlink", 0, 0, 0, 0, "on", }, |
| 2367 | { "auto-shun", 0, 0, 0, 0, "on" }, |
| 2368 | { "autosync", 0, 0, 0, 0, "on" }, |
| 2369 | { "autosync-tries", 0, 16, 0, 0, "1" }, |
| 2370 |