Fossil SCM
Split SCAN_META to SCAN_MTIME and SCAN_SIZE. None of these are in use at the moment.
Commit
2862f1c293af8912e42647582abbd4761611faf6
Parent
8cd81143e767b7f…
1 file changed
+15
-10
+15
-10
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -455,11 +455,12 @@ | ||
| 455 | 455 | ** Values for the scanFlags parameter to vfile_scan(). |
| 456 | 456 | */ |
| 457 | 457 | #define SCAN_ALL 0x001 /* Includes files that begin with "." */ |
| 458 | 458 | #define SCAN_TEMP 0x002 /* Only Fossil-generated files like *-baseline */ |
| 459 | 459 | #define SCAN_NESTED 0x004 /* Scan for empty dirs in nested checkouts */ |
| 460 | -#define SCAN_META 0x008 /* Populate mtime and size columns */ | |
| 460 | +#define SCAN_MTIME 0x008 /* Populate mtime column */ | |
| 461 | +#define SCAN_SIZE 0x010 /* Populate size column */ | |
| 461 | 462 | #endif /* INTERFACE */ |
| 462 | 463 | |
| 463 | 464 | /* |
| 464 | 465 | ** Load into table SFILE the name of every ordinary file in |
| 465 | 466 | ** the directory pPath. Omit the first nPrefix characters of |
| @@ -499,16 +500,18 @@ | ||
| 499 | 500 | } |
| 500 | 501 | if( skipAll ) return; |
| 501 | 502 | |
| 502 | 503 | if( depth==0 ){ |
| 503 | 504 | db_prepare(&ins, |
| 504 | - "INSERT OR IGNORE INTO sfile(pathname%s) SELECT :file%s" | |
| 505 | - " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE" | |
| 506 | - " pathname=:file %s)", | |
| 507 | - scanFlags & SCAN_META ? ", mtime, size" : "", | |
| 508 | - scanFlags & SCAN_META ? ", :mtime, :size" : "", | |
| 509 | - filename_collation() | |
| 505 | + "INSERT OR IGNORE INTO sfile(pathname%s%s) SELECT :file%s%s" | |
| 506 | + " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE" | |
| 507 | + " pathname=:file %s)", | |
| 508 | + scanFlags & SCAN_MTIME ? ", mtime" : "", | |
| 509 | + scanFlags & SCAN_SIZE ? ", size" : "", | |
| 510 | + scanFlags & SCAN_MTIME ? ", :mtime" : "", | |
| 511 | + scanFlags & SCAN_SIZE ? ", :size" : "", | |
| 512 | + filename_collation() | |
| 510 | 513 | ); |
| 511 | 514 | } |
| 512 | 515 | depth++; |
| 513 | 516 | |
| 514 | 517 | zNative = fossil_utf8_to_path(blob_str(pPath), 1); |
| @@ -543,13 +546,15 @@ | ||
| 543 | 546 | #else |
| 544 | 547 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 545 | 548 | #endif |
| 546 | 549 | if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){ |
| 547 | 550 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 548 | - if( scanFlags & SCAN_META ){ | |
| 549 | - db_bind_int(&ins, ":mtime", file_mtime(zPath)); | |
| 550 | - db_bind_int(&ins, ":size", file_size(zPath)); | |
| 551 | + if( scanFlags & SCAN_MTIME ){ | |
| 552 | + db_bind_int(&ins, ":mtime", file_mtime(zPath)); | |
| 553 | + } | |
| 554 | + if( scanFlags & SCAN_SIZE ){ | |
| 555 | + db_bind_int(&ins, ":size", file_size(zPath)); | |
| 551 | 556 | } |
| 552 | 557 | db_step(&ins); |
| 553 | 558 | db_reset(&ins); |
| 554 | 559 | } |
| 555 | 560 | } |
| 556 | 561 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -455,11 +455,12 @@ | |
| 455 | ** Values for the scanFlags parameter to vfile_scan(). |
| 456 | */ |
| 457 | #define SCAN_ALL 0x001 /* Includes files that begin with "." */ |
| 458 | #define SCAN_TEMP 0x002 /* Only Fossil-generated files like *-baseline */ |
| 459 | #define SCAN_NESTED 0x004 /* Scan for empty dirs in nested checkouts */ |
| 460 | #define SCAN_META 0x008 /* Populate mtime and size columns */ |
| 461 | #endif /* INTERFACE */ |
| 462 | |
| 463 | /* |
| 464 | ** Load into table SFILE the name of every ordinary file in |
| 465 | ** the directory pPath. Omit the first nPrefix characters of |
| @@ -499,16 +500,18 @@ | |
| 499 | } |
| 500 | if( skipAll ) return; |
| 501 | |
| 502 | if( depth==0 ){ |
| 503 | db_prepare(&ins, |
| 504 | "INSERT OR IGNORE INTO sfile(pathname%s) SELECT :file%s" |
| 505 | " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE" |
| 506 | " pathname=:file %s)", |
| 507 | scanFlags & SCAN_META ? ", mtime, size" : "", |
| 508 | scanFlags & SCAN_META ? ", :mtime, :size" : "", |
| 509 | filename_collation() |
| 510 | ); |
| 511 | } |
| 512 | depth++; |
| 513 | |
| 514 | zNative = fossil_utf8_to_path(blob_str(pPath), 1); |
| @@ -543,13 +546,15 @@ | |
| 543 | #else |
| 544 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 545 | #endif |
| 546 | if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){ |
| 547 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 548 | if( scanFlags & SCAN_META ){ |
| 549 | db_bind_int(&ins, ":mtime", file_mtime(zPath)); |
| 550 | db_bind_int(&ins, ":size", file_size(zPath)); |
| 551 | } |
| 552 | db_step(&ins); |
| 553 | db_reset(&ins); |
| 554 | } |
| 555 | } |
| 556 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -455,11 +455,12 @@ | |
| 455 | ** Values for the scanFlags parameter to vfile_scan(). |
| 456 | */ |
| 457 | #define SCAN_ALL 0x001 /* Includes files that begin with "." */ |
| 458 | #define SCAN_TEMP 0x002 /* Only Fossil-generated files like *-baseline */ |
| 459 | #define SCAN_NESTED 0x004 /* Scan for empty dirs in nested checkouts */ |
| 460 | #define SCAN_MTIME 0x008 /* Populate mtime column */ |
| 461 | #define SCAN_SIZE 0x010 /* Populate size column */ |
| 462 | #endif /* INTERFACE */ |
| 463 | |
| 464 | /* |
| 465 | ** Load into table SFILE the name of every ordinary file in |
| 466 | ** the directory pPath. Omit the first nPrefix characters of |
| @@ -499,16 +500,18 @@ | |
| 500 | } |
| 501 | if( skipAll ) return; |
| 502 | |
| 503 | if( depth==0 ){ |
| 504 | db_prepare(&ins, |
| 505 | "INSERT OR IGNORE INTO sfile(pathname%s%s) SELECT :file%s%s" |
| 506 | " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE" |
| 507 | " pathname=:file %s)", |
| 508 | scanFlags & SCAN_MTIME ? ", mtime" : "", |
| 509 | scanFlags & SCAN_SIZE ? ", size" : "", |
| 510 | scanFlags & SCAN_MTIME ? ", :mtime" : "", |
| 511 | scanFlags & SCAN_SIZE ? ", :size" : "", |
| 512 | filename_collation() |
| 513 | ); |
| 514 | } |
| 515 | depth++; |
| 516 | |
| 517 | zNative = fossil_utf8_to_path(blob_str(pPath), 1); |
| @@ -543,13 +546,15 @@ | |
| 546 | #else |
| 547 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 548 | #endif |
| 549 | if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){ |
| 550 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 551 | if( scanFlags & SCAN_MTIME ){ |
| 552 | db_bind_int(&ins, ":mtime", file_mtime(zPath)); |
| 553 | } |
| 554 | if( scanFlags & SCAN_SIZE ){ |
| 555 | db_bind_int(&ins, ":size", file_size(zPath)); |
| 556 | } |
| 557 | db_step(&ins); |
| 558 | db_reset(&ins); |
| 559 | } |
| 560 | } |
| 561 |