Fossil SCM
Add the "test-symlink-list" command.
Commit
de38906fd55f0c44609c9b53855869922728bcb529a54081d13404f7060f57dd
Parent
dba21929b299836…
2 files changed
+2
-2
+35
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1799,19 +1799,19 @@ | ||
| 1799 | 1799 | */ |
| 1800 | 1800 | int db_allow_symlinks_by_default(void){ |
| 1801 | 1801 | #if defined(_WIN32) |
| 1802 | 1802 | return 0; |
| 1803 | 1803 | #else |
| 1804 | - return 1; | |
| 1804 | + return 0; | |
| 1805 | 1805 | #endif |
| 1806 | 1806 | } |
| 1807 | 1807 | |
| 1808 | 1808 | /* |
| 1809 | 1809 | ** Returns non-zero if support for symlinks is currently enabled. |
| 1810 | 1810 | */ |
| 1811 | 1811 | int db_allow_symlinks(void){ |
| 1812 | - return g.allowSymlinks; | |
| 1812 | + return 0; /* g.allowSymlinks; */ | |
| 1813 | 1813 | } |
| 1814 | 1814 | |
| 1815 | 1815 | /* |
| 1816 | 1816 | ** Open the repository database given by zDbName. If zDbName==NULL then |
| 1817 | 1817 | ** get the name from the already open local database. |
| 1818 | 1818 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1799,19 +1799,19 @@ | |
| 1799 | */ |
| 1800 | int db_allow_symlinks_by_default(void){ |
| 1801 | #if defined(_WIN32) |
| 1802 | return 0; |
| 1803 | #else |
| 1804 | return 1; |
| 1805 | #endif |
| 1806 | } |
| 1807 | |
| 1808 | /* |
| 1809 | ** Returns non-zero if support for symlinks is currently enabled. |
| 1810 | */ |
| 1811 | int db_allow_symlinks(void){ |
| 1812 | return g.allowSymlinks; |
| 1813 | } |
| 1814 | |
| 1815 | /* |
| 1816 | ** Open the repository database given by zDbName. If zDbName==NULL then |
| 1817 | ** get the name from the already open local database. |
| 1818 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1799,19 +1799,19 @@ | |
| 1799 | */ |
| 1800 | int db_allow_symlinks_by_default(void){ |
| 1801 | #if defined(_WIN32) |
| 1802 | return 0; |
| 1803 | #else |
| 1804 | return 0; |
| 1805 | #endif |
| 1806 | } |
| 1807 | |
| 1808 | /* |
| 1809 | ** Returns non-zero if support for symlinks is currently enabled. |
| 1810 | */ |
| 1811 | int db_allow_symlinks(void){ |
| 1812 | return 0; /* g.allowSymlinks; */ |
| 1813 | } |
| 1814 | |
| 1815 | /* |
| 1816 | ** Open the repository database given by zDbName. If zDbName==NULL then |
| 1817 | ** get the name from the already open local database. |
| 1818 |
+35
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -3399,5 +3399,40 @@ | ||
| 3399 | 3399 | } |
| 3400 | 3400 | if( g.localOpen ){ |
| 3401 | 3401 | manifest_to_disk(rid); |
| 3402 | 3402 | } |
| 3403 | 3403 | } |
| 3404 | + | |
| 3405 | + | |
| 3406 | +/* | |
| 3407 | +** COMMAND: test-symlink-list | |
| 3408 | +** | |
| 3409 | +** Show all symlinks that have been checked into a Fossil repository. | |
| 3410 | +** | |
| 3411 | +** This command does a linear scan through all check-ins and so might take | |
| 3412 | +** several seconds on a large repository. | |
| 3413 | +*/ | |
| 3414 | +void test_symlink_list_cmd(void){ | |
| 3415 | + Stmt q; | |
| 3416 | + db_find_and_open_repository(0,0); | |
| 3417 | + add_content_sql_commands(g.db); | |
| 3418 | + db_prepare(&q, | |
| 3419 | + "SELECT min(date(e.mtime))," | |
| 3420 | + " b.uuid," | |
| 3421 | + " f.filename," | |
| 3422 | + " content(f.uuid)" | |
| 3423 | + " FROM event AS e, blob AS b, files_of_checkin(b.uuid) AS f" | |
| 3424 | + " WHERE e.type='ci'" | |
| 3425 | + " AND b.rid=e.objid" | |
| 3426 | + " AND f.perm LIKE '%%l%%'" | |
| 3427 | + " GROUP BY 3, 4" | |
| 3428 | + " ORDER BY 1 DESC" | |
| 3429 | + ); | |
| 3430 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 3431 | + fossil_print("%s %.16s %s -> %s\n", | |
| 3432 | + db_column_text(&q,0), | |
| 3433 | + db_column_text(&q,1), | |
| 3434 | + db_column_text(&q,2), | |
| 3435 | + db_column_text(&q,3)); | |
| 3436 | + } | |
| 3437 | + db_finalize(&q); | |
| 3438 | +} | |
| 3404 | 3439 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -3399,5 +3399,40 @@ | |
| 3399 | } |
| 3400 | if( g.localOpen ){ |
| 3401 | manifest_to_disk(rid); |
| 3402 | } |
| 3403 | } |
| 3404 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -3399,5 +3399,40 @@ | |
| 3399 | } |
| 3400 | if( g.localOpen ){ |
| 3401 | manifest_to_disk(rid); |
| 3402 | } |
| 3403 | } |
| 3404 | |
| 3405 | |
| 3406 | /* |
| 3407 | ** COMMAND: test-symlink-list |
| 3408 | ** |
| 3409 | ** Show all symlinks that have been checked into a Fossil repository. |
| 3410 | ** |
| 3411 | ** This command does a linear scan through all check-ins and so might take |
| 3412 | ** several seconds on a large repository. |
| 3413 | */ |
| 3414 | void test_symlink_list_cmd(void){ |
| 3415 | Stmt q; |
| 3416 | db_find_and_open_repository(0,0); |
| 3417 | add_content_sql_commands(g.db); |
| 3418 | db_prepare(&q, |
| 3419 | "SELECT min(date(e.mtime))," |
| 3420 | " b.uuid," |
| 3421 | " f.filename," |
| 3422 | " content(f.uuid)" |
| 3423 | " FROM event AS e, blob AS b, files_of_checkin(b.uuid) AS f" |
| 3424 | " WHERE e.type='ci'" |
| 3425 | " AND b.rid=e.objid" |
| 3426 | " AND f.perm LIKE '%%l%%'" |
| 3427 | " GROUP BY 3, 4" |
| 3428 | " ORDER BY 1 DESC" |
| 3429 | ); |
| 3430 | while( db_step(&q)==SQLITE_ROW ){ |
| 3431 | fossil_print("%s %.16s %s -> %s\n", |
| 3432 | db_column_text(&q,0), |
| 3433 | db_column_text(&q,1), |
| 3434 | db_column_text(&q,2), |
| 3435 | db_column_text(&q,3)); |
| 3436 | } |
| 3437 | db_finalize(&q); |
| 3438 | } |
| 3439 |