Fossil SCM

Split SCAN_META to SCAN_MTIME and SCAN_SIZE. None of these are in use at the moment.

andygoth 2016-11-06 22:55 UTC andygoth-changes
Commit 2862f1c293af8912e42647582abbd4761611faf6
1 file changed +15 -10
+15 -10
--- src/vfile.c
+++ src/vfile.c
@@ -455,11 +455,12 @@
455455
** Values for the scanFlags parameter to vfile_scan().
456456
*/
457457
#define SCAN_ALL 0x001 /* Includes files that begin with "." */
458458
#define SCAN_TEMP 0x002 /* Only Fossil-generated files like *-baseline */
459459
#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 */
461462
#endif /* INTERFACE */
462463
463464
/*
464465
** Load into table SFILE the name of every ordinary file in
465466
** the directory pPath. Omit the first nPrefix characters of
@@ -499,16 +500,18 @@
499500
}
500501
if( skipAll ) return;
501502
502503
if( depth==0 ){
503504
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()
510513
);
511514
}
512515
depth++;
513516
514517
zNative = fossil_utf8_to_path(blob_str(pPath), 1);
@@ -543,13 +546,15 @@
543546
#else
544547
}else if( file_wd_isfile_or_link(zPath) ){
545548
#endif
546549
if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
547550
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));
551556
}
552557
db_step(&ins);
553558
db_reset(&ins);
554559
}
555560
}
556561
--- 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

Keyboard Shortcuts

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