Fossil SCM

Add the "test-symlink-list" command.

drh 2020-08-16 23:09 trunk
Commit de38906fd55f0c44609c9b53855869922728bcb529a54081d13404f7060f57dd
2 files changed +2 -2 +35
+2 -2
--- src/db.c
+++ src/db.c
@@ -1799,19 +1799,19 @@
17991799
*/
18001800
int db_allow_symlinks_by_default(void){
18011801
#if defined(_WIN32)
18021802
return 0;
18031803
#else
1804
- return 1;
1804
+ return 0;
18051805
#endif
18061806
}
18071807
18081808
/*
18091809
** Returns non-zero if support for symlinks is currently enabled.
18101810
*/
18111811
int db_allow_symlinks(void){
1812
- return g.allowSymlinks;
1812
+ return 0; /* g.allowSymlinks; */
18131813
}
18141814
18151815
/*
18161816
** Open the repository database given by zDbName. If zDbName==NULL then
18171817
** get the name from the already open local database.
18181818
--- 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 @@
33993399
}
34003400
if( g.localOpen ){
34013401
manifest_to_disk(rid);
34023402
}
34033403
}
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
+}
34043439
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button