Fossil SCM

Fix [85017e9273]: Under Windows, renamed file keeps getting "ADDED".

jan.nijtmans 2013-04-17 09:30 trunk merge
Commit e8e444eceb2628b2caf8443a443b3be827ed7bde
+2 -2
--- src/add.c
+++ src/add.c
@@ -287,11 +287,11 @@
287287
288288
file_canonical_name(g.argv[i], &fullName, 0);
289289
zName = blob_str(&fullName);
290290
isDir = file_wd_isdir(zName);
291291
if( isDir==1 ){
292
- vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore);
292
+ vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore, caseSensitive);
293293
}else if( isDir==0 ){
294294
fossil_warning("not found: %s", zName);
295295
}else if( file_access(zName, R_OK) ){
296296
fossil_fatal("cannot open %s", zName);
297297
}else{
@@ -516,11 +516,11 @@
516516
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
517517
n = strlen(g.zLocalRoot);
518518
blob_init(&path, g.zLocalRoot, n-1);
519519
/* now we read the complete file structure into a temp table */
520520
pIgnore = glob_create(zIgnoreFlag);
521
- vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
521
+ vfile_scan(&path, blob_size(&path), scanFlags, pIgnore, caseSensitive);
522522
glob_free(pIgnore);
523523
nAdd = add_files_in_sfile(vid, caseSensitive);
524524
525525
/* step 2: search for missing files */
526526
db_prepare(&q,
527527
--- src/add.c
+++ src/add.c
@@ -287,11 +287,11 @@
287
288 file_canonical_name(g.argv[i], &fullName, 0);
289 zName = blob_str(&fullName);
290 isDir = file_wd_isdir(zName);
291 if( isDir==1 ){
292 vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore);
293 }else if( isDir==0 ){
294 fossil_warning("not found: %s", zName);
295 }else if( file_access(zName, R_OK) ){
296 fossil_fatal("cannot open %s", zName);
297 }else{
@@ -516,11 +516,11 @@
516 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
517 n = strlen(g.zLocalRoot);
518 blob_init(&path, g.zLocalRoot, n-1);
519 /* now we read the complete file structure into a temp table */
520 pIgnore = glob_create(zIgnoreFlag);
521 vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
522 glob_free(pIgnore);
523 nAdd = add_files_in_sfile(vid, caseSensitive);
524
525 /* step 2: search for missing files */
526 db_prepare(&q,
527
--- src/add.c
+++ src/add.c
@@ -287,11 +287,11 @@
287
288 file_canonical_name(g.argv[i], &fullName, 0);
289 zName = blob_str(&fullName);
290 isDir = file_wd_isdir(zName);
291 if( isDir==1 ){
292 vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore, caseSensitive);
293 }else if( isDir==0 ){
294 fossil_warning("not found: %s", zName);
295 }else if( file_access(zName, R_OK) ){
296 fossil_fatal("cannot open %s", zName);
297 }else{
@@ -516,11 +516,11 @@
516 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
517 n = strlen(g.zLocalRoot);
518 blob_init(&path, g.zLocalRoot, n-1);
519 /* now we read the complete file structure into a temp table */
520 pIgnore = glob_create(zIgnoreFlag);
521 vfile_scan(&path, blob_size(&path), scanFlags, pIgnore, caseSensitive);
522 glob_free(pIgnore);
523 nAdd = add_files_in_sfile(vid, caseSensitive);
524
525 /* step 2: search for missing files */
526 db_prepare(&q,
527
+2 -2
--- src/add.c
+++ src/add.c
@@ -287,11 +287,11 @@
287287
288288
file_canonical_name(g.argv[i], &fullName, 0);
289289
zName = blob_str(&fullName);
290290
isDir = file_wd_isdir(zName);
291291
if( isDir==1 ){
292
- vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore);
292
+ vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore, caseSensitive);
293293
}else if( isDir==0 ){
294294
fossil_warning("not found: %s", zName);
295295
}else if( file_access(zName, R_OK) ){
296296
fossil_fatal("cannot open %s", zName);
297297
}else{
@@ -516,11 +516,11 @@
516516
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
517517
n = strlen(g.zLocalRoot);
518518
blob_init(&path, g.zLocalRoot, n-1);
519519
/* now we read the complete file structure into a temp table */
520520
pIgnore = glob_create(zIgnoreFlag);
521
- vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
521
+ vfile_scan(&path, blob_size(&path), scanFlags, pIgnore, caseSensitive);
522522
glob_free(pIgnore);
523523
nAdd = add_files_in_sfile(vid, caseSensitive);
524524
525525
/* step 2: search for missing files */
526526
db_prepare(&q,
527527
--- src/add.c
+++ src/add.c
@@ -287,11 +287,11 @@
287
288 file_canonical_name(g.argv[i], &fullName, 0);
289 zName = blob_str(&fullName);
290 isDir = file_wd_isdir(zName);
291 if( isDir==1 ){
292 vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore);
293 }else if( isDir==0 ){
294 fossil_warning("not found: %s", zName);
295 }else if( file_access(zName, R_OK) ){
296 fossil_fatal("cannot open %s", zName);
297 }else{
@@ -516,11 +516,11 @@
516 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
517 n = strlen(g.zLocalRoot);
518 blob_init(&path, g.zLocalRoot, n-1);
519 /* now we read the complete file structure into a temp table */
520 pIgnore = glob_create(zIgnoreFlag);
521 vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
522 glob_free(pIgnore);
523 nAdd = add_files_in_sfile(vid, caseSensitive);
524
525 /* step 2: search for missing files */
526 db_prepare(&q,
527
--- src/add.c
+++ src/add.c
@@ -287,11 +287,11 @@
287
288 file_canonical_name(g.argv[i], &fullName, 0);
289 zName = blob_str(&fullName);
290 isDir = file_wd_isdir(zName);
291 if( isDir==1 ){
292 vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore, caseSensitive);
293 }else if( isDir==0 ){
294 fossil_warning("not found: %s", zName);
295 }else if( file_access(zName, R_OK) ){
296 fossil_fatal("cannot open %s", zName);
297 }else{
@@ -516,11 +516,11 @@
516 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
517 n = strlen(g.zLocalRoot);
518 blob_init(&path, g.zLocalRoot, n-1);
519 /* now we read the complete file structure into a temp table */
520 pIgnore = glob_create(zIgnoreFlag);
521 vfile_scan(&path, blob_size(&path), scanFlags, pIgnore, caseSensitive);
522 glob_free(pIgnore);
523 nAdd = add_files_in_sfile(vid, caseSensitive);
524
525 /* step 2: search for missing files */
526 db_prepare(&q,
527
+10 -2
--- src/checkin.c
+++ src/checkin.c
@@ -314,10 +314,11 @@
314314
** Pathnames are displayed according to the "relative-paths" setting,
315315
** unless overridden by the --abs-paths or --rel-paths options.
316316
**
317317
** Options:
318318
** --abs-paths Display absolute pathnames.
319
+** --case-sensitive <BOOL> override case-sensitive setting
319320
** --dotfiles include files beginning with a dot (".")
320321
** --ignore <CSG> ignore files matching patterns from the argument
321322
** --rel-paths Display pathnames relative to the current working
322323
** directory.
323324
**
@@ -331,23 +332,26 @@
331332
unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
332333
int cwdRelative = 0;
333334
Glob *pIgnore;
334335
Blob rewrittenPathname;
335336
const char *zPathname, *zDisplayName;
337
+ int caseSensitive;
336338
337339
if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
340
+ capture_case_sensitive_option();
338341
db_must_be_within_tree();
342
+ caseSensitive = filenames_are_case_sensitive();
339343
cwdRelative = determine_cwd_relative_option();
340344
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
341345
filename_collation());
342346
n = strlen(g.zLocalRoot);
343347
blob_init(&path, g.zLocalRoot, n-1);
344348
if( zIgnoreFlag==0 ){
345349
zIgnoreFlag = db_get("ignore-glob", 0);
346350
}
347351
pIgnore = glob_create(zIgnoreFlag);
348
- vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
352
+ vfile_scan(&path, blob_size(&path), scanFlags, pIgnore, caseSensitive);
349353
glob_free(pIgnore);
350354
db_prepare(&q,
351355
"SELECT x FROM sfile"
352356
" WHERE x NOT IN (%s)"
353357
" ORDER BY 1",
@@ -391,10 +395,11 @@
391395
** The GLOBPATTERN is a comma-separated list of GLOB expressions for
392396
** files that are ignored. The GLOBPATTERN specified by the "ignore-glob"
393397
** is used if the --ignore option is omitted.
394398
**
395399
** Options:
400
+** --case-sensitive <BOOL> override case-sensitive setting
396401
** --dotfiles include files beginning with a dot (".")
397402
** --force Remove files without prompting
398403
** --ignore <CSG> ignore files matching patterns from the
399404
** comma separated list of glob patterns.
400405
** --temp Remove only Fossil-generated temporary files
@@ -408,26 +413,29 @@
408413
Blob path, repo;
409414
Stmt q;
410415
int n;
411416
Glob *pIgnore;
412417
int testFlag = 0;
418
+ int caseSensitive;
413419
414420
allFlag = find_option("force","f",0)!=0;
415421
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
416422
if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
417423
zIgnoreFlag = find_option("ignore",0,1);
418424
testFlag = find_option("test",0,0)!=0;
425
+ capture_case_sensitive_option();
419426
db_must_be_within_tree();
427
+ caseSensitive = filenames_are_case_sensitive();
420428
if( zIgnoreFlag==0 ){
421429
zIgnoreFlag = db_get("ignore-glob", 0);
422430
}
423431
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
424432
filename_collation());
425433
n = strlen(g.zLocalRoot);
426434
blob_init(&path, g.zLocalRoot, n-1);
427435
pIgnore = glob_create(zIgnoreFlag);
428
- vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
436
+ vfile_scan(&path, blob_size(&path), scanFlags, pIgnore, caseSensitive);
429437
glob_free(pIgnore);
430438
db_prepare(&q,
431439
"SELECT %Q || x FROM sfile"
432440
" WHERE x NOT IN (%s)"
433441
" ORDER BY 1",
434442
--- src/checkin.c
+++ src/checkin.c
@@ -314,10 +314,11 @@
314 ** Pathnames are displayed according to the "relative-paths" setting,
315 ** unless overridden by the --abs-paths or --rel-paths options.
316 **
317 ** Options:
318 ** --abs-paths Display absolute pathnames.
 
319 ** --dotfiles include files beginning with a dot (".")
320 ** --ignore <CSG> ignore files matching patterns from the argument
321 ** --rel-paths Display pathnames relative to the current working
322 ** directory.
323 **
@@ -331,23 +332,26 @@
331 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
332 int cwdRelative = 0;
333 Glob *pIgnore;
334 Blob rewrittenPathname;
335 const char *zPathname, *zDisplayName;
 
336
337 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
 
338 db_must_be_within_tree();
 
339 cwdRelative = determine_cwd_relative_option();
340 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
341 filename_collation());
342 n = strlen(g.zLocalRoot);
343 blob_init(&path, g.zLocalRoot, n-1);
344 if( zIgnoreFlag==0 ){
345 zIgnoreFlag = db_get("ignore-glob", 0);
346 }
347 pIgnore = glob_create(zIgnoreFlag);
348 vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
349 glob_free(pIgnore);
350 db_prepare(&q,
351 "SELECT x FROM sfile"
352 " WHERE x NOT IN (%s)"
353 " ORDER BY 1",
@@ -391,10 +395,11 @@
391 ** The GLOBPATTERN is a comma-separated list of GLOB expressions for
392 ** files that are ignored. The GLOBPATTERN specified by the "ignore-glob"
393 ** is used if the --ignore option is omitted.
394 **
395 ** Options:
 
396 ** --dotfiles include files beginning with a dot (".")
397 ** --force Remove files without prompting
398 ** --ignore <CSG> ignore files matching patterns from the
399 ** comma separated list of glob patterns.
400 ** --temp Remove only Fossil-generated temporary files
@@ -408,26 +413,29 @@
408 Blob path, repo;
409 Stmt q;
410 int n;
411 Glob *pIgnore;
412 int testFlag = 0;
 
413
414 allFlag = find_option("force","f",0)!=0;
415 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
416 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
417 zIgnoreFlag = find_option("ignore",0,1);
418 testFlag = find_option("test",0,0)!=0;
 
419 db_must_be_within_tree();
 
420 if( zIgnoreFlag==0 ){
421 zIgnoreFlag = db_get("ignore-glob", 0);
422 }
423 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
424 filename_collation());
425 n = strlen(g.zLocalRoot);
426 blob_init(&path, g.zLocalRoot, n-1);
427 pIgnore = glob_create(zIgnoreFlag);
428 vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
429 glob_free(pIgnore);
430 db_prepare(&q,
431 "SELECT %Q || x FROM sfile"
432 " WHERE x NOT IN (%s)"
433 " ORDER BY 1",
434
--- src/checkin.c
+++ src/checkin.c
@@ -314,10 +314,11 @@
314 ** Pathnames are displayed according to the "relative-paths" setting,
315 ** unless overridden by the --abs-paths or --rel-paths options.
316 **
317 ** Options:
318 ** --abs-paths Display absolute pathnames.
319 ** --case-sensitive <BOOL> override case-sensitive setting
320 ** --dotfiles include files beginning with a dot (".")
321 ** --ignore <CSG> ignore files matching patterns from the argument
322 ** --rel-paths Display pathnames relative to the current working
323 ** directory.
324 **
@@ -331,23 +332,26 @@
332 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
333 int cwdRelative = 0;
334 Glob *pIgnore;
335 Blob rewrittenPathname;
336 const char *zPathname, *zDisplayName;
337 int caseSensitive;
338
339 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
340 capture_case_sensitive_option();
341 db_must_be_within_tree();
342 caseSensitive = filenames_are_case_sensitive();
343 cwdRelative = determine_cwd_relative_option();
344 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
345 filename_collation());
346 n = strlen(g.zLocalRoot);
347 blob_init(&path, g.zLocalRoot, n-1);
348 if( zIgnoreFlag==0 ){
349 zIgnoreFlag = db_get("ignore-glob", 0);
350 }
351 pIgnore = glob_create(zIgnoreFlag);
352 vfile_scan(&path, blob_size(&path), scanFlags, pIgnore, caseSensitive);
353 glob_free(pIgnore);
354 db_prepare(&q,
355 "SELECT x FROM sfile"
356 " WHERE x NOT IN (%s)"
357 " ORDER BY 1",
@@ -391,10 +395,11 @@
395 ** The GLOBPATTERN is a comma-separated list of GLOB expressions for
396 ** files that are ignored. The GLOBPATTERN specified by the "ignore-glob"
397 ** is used if the --ignore option is omitted.
398 **
399 ** Options:
400 ** --case-sensitive <BOOL> override case-sensitive setting
401 ** --dotfiles include files beginning with a dot (".")
402 ** --force Remove files without prompting
403 ** --ignore <CSG> ignore files matching patterns from the
404 ** comma separated list of glob patterns.
405 ** --temp Remove only Fossil-generated temporary files
@@ -408,26 +413,29 @@
413 Blob path, repo;
414 Stmt q;
415 int n;
416 Glob *pIgnore;
417 int testFlag = 0;
418 int caseSensitive;
419
420 allFlag = find_option("force","f",0)!=0;
421 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
422 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
423 zIgnoreFlag = find_option("ignore",0,1);
424 testFlag = find_option("test",0,0)!=0;
425 capture_case_sensitive_option();
426 db_must_be_within_tree();
427 caseSensitive = filenames_are_case_sensitive();
428 if( zIgnoreFlag==0 ){
429 zIgnoreFlag = db_get("ignore-glob", 0);
430 }
431 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
432 filename_collation());
433 n = strlen(g.zLocalRoot);
434 blob_init(&path, g.zLocalRoot, n-1);
435 pIgnore = glob_create(zIgnoreFlag);
436 vfile_scan(&path, blob_size(&path), scanFlags, pIgnore, caseSensitive);
437 glob_free(pIgnore);
438 db_prepare(&q,
439 "SELECT %Q || x FROM sfile"
440 " WHERE x NOT IN (%s)"
441 " ORDER BY 1",
442
+5 -3
--- src/vfile.c
+++ src/vfile.c
@@ -432,11 +432,12 @@
432432
**
433433
** Any files or directories that match the glob pattern pIgnore are
434434
** excluded from the scan. Name matching occurs after the first
435435
** nPrefix characters are elided from the filename.
436436
*/
437
-void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){
437
+void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore,
438
+ int caseSensitive){
438439
DIR *d;
439440
int origSize;
440441
const char *zDir;
441442
struct dirent *pEntry;
442443
int skipAll = 0;
@@ -453,11 +454,12 @@
453454
if( skipAll ) return;
454455
455456
if( depth==0 ){
456457
db_prepare(&ins,
457458
"INSERT OR IGNORE INTO sfile(x) SELECT :file"
458
- " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE pathname=:file)"
459
+ " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE"
460
+ " pathname=:file %s)", caseSensitive ? "" : "COLLATE nocase"
459461
);
460462
}
461463
depth++;
462464
463465
zDir = blob_str(pPath);
@@ -477,11 +479,11 @@
477479
zPath = blob_str(pPath);
478480
if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
479481
/* do nothing */
480482
}else if( file_wd_isdir(zPath)==1 ){
481483
if( !vfile_top_of_checkout(zPath) ){
482
- vfile_scan(pPath, nPrefix, scanFlags, pIgnore);
484
+ vfile_scan(pPath, nPrefix, scanFlags, pIgnore, caseSensitive);
483485
}
484486
}else if( file_wd_isfile_or_link(zPath) ){
485487
if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
486488
db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
487489
db_step(&ins);
488490
--- src/vfile.c
+++ src/vfile.c
@@ -432,11 +432,12 @@
432 **
433 ** Any files or directories that match the glob pattern pIgnore are
434 ** excluded from the scan. Name matching occurs after the first
435 ** nPrefix characters are elided from the filename.
436 */
437 void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){
 
438 DIR *d;
439 int origSize;
440 const char *zDir;
441 struct dirent *pEntry;
442 int skipAll = 0;
@@ -453,11 +454,12 @@
453 if( skipAll ) return;
454
455 if( depth==0 ){
456 db_prepare(&ins,
457 "INSERT OR IGNORE INTO sfile(x) SELECT :file"
458 " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE pathname=:file)"
 
459 );
460 }
461 depth++;
462
463 zDir = blob_str(pPath);
@@ -477,11 +479,11 @@
477 zPath = blob_str(pPath);
478 if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
479 /* do nothing */
480 }else if( file_wd_isdir(zPath)==1 ){
481 if( !vfile_top_of_checkout(zPath) ){
482 vfile_scan(pPath, nPrefix, scanFlags, pIgnore);
483 }
484 }else if( file_wd_isfile_or_link(zPath) ){
485 if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
486 db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
487 db_step(&ins);
488
--- src/vfile.c
+++ src/vfile.c
@@ -432,11 +432,12 @@
432 **
433 ** Any files or directories that match the glob pattern pIgnore are
434 ** excluded from the scan. Name matching occurs after the first
435 ** nPrefix characters are elided from the filename.
436 */
437 void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore,
438 int caseSensitive){
439 DIR *d;
440 int origSize;
441 const char *zDir;
442 struct dirent *pEntry;
443 int skipAll = 0;
@@ -453,11 +454,12 @@
454 if( skipAll ) return;
455
456 if( depth==0 ){
457 db_prepare(&ins,
458 "INSERT OR IGNORE INTO sfile(x) SELECT :file"
459 " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE"
460 " pathname=:file %s)", caseSensitive ? "" : "COLLATE nocase"
461 );
462 }
463 depth++;
464
465 zDir = blob_str(pPath);
@@ -477,11 +479,11 @@
479 zPath = blob_str(pPath);
480 if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
481 /* do nothing */
482 }else if( file_wd_isdir(zPath)==1 ){
483 if( !vfile_top_of_checkout(zPath) ){
484 vfile_scan(pPath, nPrefix, scanFlags, pIgnore, caseSensitive);
485 }
486 }else if( file_wd_isfile_or_link(zPath) ){
487 if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
488 db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
489 db_step(&ins);
490
+5 -3
--- src/vfile.c
+++ src/vfile.c
@@ -432,11 +432,12 @@
432432
**
433433
** Any files or directories that match the glob pattern pIgnore are
434434
** excluded from the scan. Name matching occurs after the first
435435
** nPrefix characters are elided from the filename.
436436
*/
437
-void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){
437
+void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore,
438
+ int caseSensitive){
438439
DIR *d;
439440
int origSize;
440441
const char *zDir;
441442
struct dirent *pEntry;
442443
int skipAll = 0;
@@ -453,11 +454,12 @@
453454
if( skipAll ) return;
454455
455456
if( depth==0 ){
456457
db_prepare(&ins,
457458
"INSERT OR IGNORE INTO sfile(x) SELECT :file"
458
- " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE pathname=:file)"
459
+ " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE"
460
+ " pathname=:file %s)", caseSensitive ? "" : "COLLATE nocase"
459461
);
460462
}
461463
depth++;
462464
463465
zDir = blob_str(pPath);
@@ -477,11 +479,11 @@
477479
zPath = blob_str(pPath);
478480
if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
479481
/* do nothing */
480482
}else if( file_wd_isdir(zPath)==1 ){
481483
if( !vfile_top_of_checkout(zPath) ){
482
- vfile_scan(pPath, nPrefix, scanFlags, pIgnore);
484
+ vfile_scan(pPath, nPrefix, scanFlags, pIgnore, caseSensitive);
483485
}
484486
}else if( file_wd_isfile_or_link(zPath) ){
485487
if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
486488
db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
487489
db_step(&ins);
488490
--- src/vfile.c
+++ src/vfile.c
@@ -432,11 +432,12 @@
432 **
433 ** Any files or directories that match the glob pattern pIgnore are
434 ** excluded from the scan. Name matching occurs after the first
435 ** nPrefix characters are elided from the filename.
436 */
437 void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){
 
438 DIR *d;
439 int origSize;
440 const char *zDir;
441 struct dirent *pEntry;
442 int skipAll = 0;
@@ -453,11 +454,12 @@
453 if( skipAll ) return;
454
455 if( depth==0 ){
456 db_prepare(&ins,
457 "INSERT OR IGNORE INTO sfile(x) SELECT :file"
458 " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE pathname=:file)"
 
459 );
460 }
461 depth++;
462
463 zDir = blob_str(pPath);
@@ -477,11 +479,11 @@
477 zPath = blob_str(pPath);
478 if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
479 /* do nothing */
480 }else if( file_wd_isdir(zPath)==1 ){
481 if( !vfile_top_of_checkout(zPath) ){
482 vfile_scan(pPath, nPrefix, scanFlags, pIgnore);
483 }
484 }else if( file_wd_isfile_or_link(zPath) ){
485 if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
486 db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
487 db_step(&ins);
488
--- src/vfile.c
+++ src/vfile.c
@@ -432,11 +432,12 @@
432 **
433 ** Any files or directories that match the glob pattern pIgnore are
434 ** excluded from the scan. Name matching occurs after the first
435 ** nPrefix characters are elided from the filename.
436 */
437 void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore,
438 int caseSensitive){
439 DIR *d;
440 int origSize;
441 const char *zDir;
442 struct dirent *pEntry;
443 int skipAll = 0;
@@ -453,11 +454,12 @@
454 if( skipAll ) return;
455
456 if( depth==0 ){
457 db_prepare(&ins,
458 "INSERT OR IGNORE INTO sfile(x) SELECT :file"
459 " WHERE NOT EXISTS(SELECT 1 FROM vfile WHERE"
460 " pathname=:file %s)", caseSensitive ? "" : "COLLATE nocase"
461 );
462 }
463 depth++;
464
465 zDir = blob_str(pPath);
@@ -477,11 +479,11 @@
479 zPath = blob_str(pPath);
480 if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
481 /* do nothing */
482 }else if( file_wd_isdir(zPath)==1 ){
483 if( !vfile_top_of_checkout(zPath) ){
484 vfile_scan(pPath, nPrefix, scanFlags, pIgnore, caseSensitive);
485 }
486 }else if( file_wd_isfile_or_link(zPath) ){
487 if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
488 db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
489 db_step(&ins);
490

Keyboard Shortcuts

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