18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
** This file contains code used to check-out versions of the project
** from the local repository.
*/
#include "config.h"
#include "add.h"
#include <assert.h>
#include <dirent.h>
/*
** This routine returns the names of files in a working checkout that
** are created by Fossil itself, and hence should not be added, deleted,
** or merge, and should be omitted from "clean" and "extra" lists.
**
** Return the N-th name. The first name has N==0. When all names have
|
>
>
>
>
>
>
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
** This file contains code used to check-out versions of the project
** from the local repository.
*/
#include "config.h"
#include "add.h"
#include <assert.h>
#include <dirent.h>
#ifdef __CYGWIN__
__declspec(dllimport) extern __stdcall int RegOpenKeyExW(void *, void *,
int, int, void *);
__declspec(dllimport) extern __stdcall int RegQueryValueExW(void *, void *,
int, void *, void *, void *);
#endif
/*
** This routine returns the names of files in a working checkout that
** are created by Fossil itself, and hence should not be added, deleted,
** or merge, and should be omitted from "clean" and "extra" lists.
**
** Return the N-th name. The first name has N==0. When all names have
|
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
|
}
vid = db_lget_int("checkout",0);
if( vid==0 ){
fossil_panic("no checkout to add to");
}
db_begin_transaction();
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
#if defined(_WIN32) || defined(__CYGWIN__)
db_multi_exec(
"CREATE INDEX IF NOT EXISTS vfile_pathname "
" ON vfile(pathname COLLATE nocase)"
);
#endif
pIgnore = glob_create(zIgnoreFlag);
nRoot = strlen(g.zLocalRoot);
/* Load the names of all files that are to be added into sfile temp table */
for(i=2; i<g.argc; i++){
char *zName;
int isDir;
|
|
|
|
|
|
<
>
|
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
|
}
vid = db_lget_int("checkout",0);
if( vid==0 ){
fossil_panic("no checkout to add to");
}
db_begin_transaction();
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
if( caseSensitive ){
db_multi_exec(
"CREATE INDEX IF NOT EXISTS vfile_pathname "
" ON vfile(pathname COLLATE nocase)"
);
}
pIgnore = glob_create(zIgnoreFlag);
nRoot = strlen(g.zLocalRoot);
/* Load the names of all files that are to be added into sfile temp table */
for(i=2; i<g.argc; i++){
char *zName;
int isDir;
|
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
|
** This routine determines if files should be case-sensitive or not.
** In other words, this routine determines if two filenames that
** differ only in case should be considered the same name or not.
**
** The case-sensitive setting determines the default value. If
** the case-sensitive setting is undefined, then case sensitivity
** defaults off for Cygwin, Mac and Windows and on for all other unix.
**
** The --case-sensitive BOOLEAN command-line option overrides any
** setting.
*/
int filenames_are_case_sensitive(void){
static int caseSensitive;
static int once = 1;
if( once ){
once = 0;
if( zCaseSensitive ){
caseSensitive = is_truth(zCaseSensitive);
}else{
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__DARWIN__) && !defined(__APPLE__)
caseSensitive = 1; /* Unix */
#else
caseSensitive = 0; /* Cygwin, Mac and Windows */
#endif
caseSensitive = db_get_boolean("case-sensitive",caseSensitive);
}
}
return caseSensitive;
}
|
>
>
|
>
>
|
>
>
>
>
>
>
>
>
|
>
|
|
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
|
** This routine determines if files should be case-sensitive or not.
** In other words, this routine determines if two filenames that
** differ only in case should be considered the same name or not.
**
** The case-sensitive setting determines the default value. If
** the case-sensitive setting is undefined, then case sensitivity
** defaults off for Cygwin, Mac and Windows and on for all other unix.
** If case-sensitivity is enabled in the windows kernel, the Cygwin port
** of fossil.exe can detect that, and modifies the default to 'on'.
**
** The --case-sensitive <BOOL> command-line option overrides any
** setting.
*/
int filenames_are_case_sensitive(void){
static int caseSensitive;
static int once = 1;
if( once ){
once = 0;
if( zCaseSensitive ){
caseSensitive = is_truth(zCaseSensitive);
}else{
#if defined(_WIN32) || defined(__DARWIN__) || defined(__APPLE__)
caseSensitive = 0; /* Mac and Windows */
#elif defined(__CYGWIN__)
/* Cygwin can be configured to be case-sensitive, check this. */
void *hKey;
int value = 1, length = sizeof(int);
caseSensitive = 0; /* Cygwin default */
if( (RegOpenKeyExW((void *)0x80000002, L"SYSTEM\\CurrentControlSet\\"
"Control\\Session Manager\\kernel", 0, 1, (void *)&hKey)
== 0) && (RegQueryValueExW(hKey, L"obcaseinsensitive",
0, NULL, (void *)&value, (void *)&length) == 0) && !value ){
caseSensitive = 1;
}
#else
caseSensitive = 1; /* Unix */
#endif
caseSensitive = db_get_boolean("case-sensitive",caseSensitive);
}
}
return caseSensitive;
}
|