Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Rebase. Remove --clean option and "clean-glob" setting. Implement new "allow-clean-x" setting. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | cleanX-no-clean-glob |
| Files: | files | file ages | folders |
| SHA1: |
b3201c91110e66c56738ea984cb3d612 |
| User & Date: | jan.nijtmans 2013-06-03 07:53:26.631 |
Context
|
2013-06-04
| ||
| 14:07 | remove unused variable check-in: 3da761fce1 user: jan.nijtmans tags: cleanX-no-clean-glob | |
|
2013-06-03
| ||
| 07:53 | Rebase. Remove --clean option and "clean-glob" setting. Implement new "allow-clean-x" setting. check-in: b3201c9111 user: jan.nijtmans tags: cleanX-no-clean-glob | |
|
2013-05-31
| ||
| 17:41 | Avoid SQL errors when the "fossil ticket" command is misused to try to append icomment text. Ticket [d4378c258d9fc6b] check-in: 878f7008ab user: drh tags: trunk | |
|
2013-05-29
| ||
| 12:52 | Only ask confirmation for deletion of "unmanaged" files, not for "IGNORED files". If you want to delete ignored files with confirmation, use [fossil clean --ignore ""], not [fossil clean --extreme] Closed-Leaf check-in: 020bb71f00 user: jan.nijtmans tags: cleanX | |
Changes
Deleted .fossil-settings/clean-glob.
|
| < < < < < < < < < < < < < < < < < |
Changes to .fossil-settings/ignore-glob.
1 2 | fossil fossil.exe | > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | *.a *.lib *.manifest *.o *.obj *.pdb *.res Makefile bld/* wbld/* win/*.c win/*.h win/*.exe win/headers win/linkopts autoconfig.h config.log fossil fossil.exe |
Changes to src/add.c.
| ︙ | ︙ | |||
219 220 221 222 223 224 225 | ** Make arrangements to add one or more files or directories to the ** current checkout at the next commit. ** ** When adding files or directories recursively, filenames that begin ** with "." are excluded by default. To include such files, add ** the "--dotfiles" option to the command-line. ** | | < | < < < | < < < < < | < | 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
** Make arrangements to add one or more files or directories to the
** current checkout at the next commit.
**
** When adding files or directories recursively, filenames that begin
** with "." are excluded by default. To include such files, add
** the "--dotfiles" option to the command-line.
**
** The --ignore option is a comma-separate lists of glob patterns
** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore
** option does not appear on the command line then the "ignore-glob" setting
** is used.
**
** The --case-sensitive option determines whether or not filenames should
** be treated case sensitive or not. If the option is not given, the default
** depends on the global setting, or the operating system default, if not set.
**
** Options:
**
** --case-sensitive <BOOL> override case-sensitive setting
** --dotfiles include files beginning with a dot (".")
** --ignore <CSG> ignore files matching patterns from the
** comma separated list of glob patterns.
**
** See also: addremove, rm
*/
void add_cmd(void){
int i; /* Loop counter */
int vid; /* Currently checked out version */
int nRoot; /* Full path characters in g.zLocalRoot */
const char *zIgnoreFlag; /* The --ignore option or ignore-glob setting */
Glob *pIgnore; /* Ignore everything matching the glob patterns */
unsigned scanFlags = 0; /* Flags passed to vfile_scan() */
zIgnoreFlag = find_option("ignore",0,1);
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
capture_case_sensitive_option();
db_must_be_within_tree();
if( zIgnoreFlag==0 ){
zIgnoreFlag = db_get("ignore-glob", 0);
}
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 %s)",
filename_collation());
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;
Blob fullName;
file_canonical_name(g.argv[i], &fullName, 0);
zName = blob_str(&fullName);
isDir = file_wd_isdir(zName);
if( isDir==1 ){
vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore);
}else if( isDir==0 ){
fossil_warning("not found: %s", zName);
}else if( file_access(zName, R_OK) ){
fossil_fatal("cannot open %s", zName);
}else{
char *zTreeName = &zName[nRoot];
db_multi_exec(
"INSERT OR IGNORE INTO sfile(x) VALUES(%Q)",
zTreeName
);
}
blob_reset(&fullName);
}
glob_free(pIgnore);
add_files_in_sfile(vid);
db_end_transaction(0);
}
/*
** COMMAND: rm
|
| ︙ | ︙ | |||
458 459 460 461 462 463 464 | ** The command does not "commit". You must run the "commit" separately ** as a separate step. ** ** Files and directories whose names begin with "." are ignored unless ** the --dotfiles option is used. ** ** The --ignore option overrides the "ignore-glob" setting, as do the | | < | < < | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 |
** The command does not "commit". You must run the "commit" separately
** as a separate step.
**
** Files and directories whose names begin with "." are ignored unless
** the --dotfiles option is used.
**
** The --ignore option overrides the "ignore-glob" setting, as do the
** --case-sensitive option with the "case-sensitive" setting. See the
** documentation on the "settings" command for further information.
**
** The -n|--dry-run option shows what would happen without actually doing anything.
**
** This command can be used to track third party software.
**
** Options:
** --case-sensitive <BOOL> override case-sensitive setting
** --dotfiles include files beginning with a dot (".")
** --ignore <CSG> ignore files matching patterns from the
** comma separated list of glob patterns.
** -n|--dry-run If given, display instead of run actions
**
** See also: add, rm
*/
void addremove_cmd(void){
Blob path;
const char *zCleanFlag = find_option("clean",0,1);
|
| ︙ | ︙ | |||
495 496 497 498 499 500 501 |
Glob *pIgnore, *pClean;
if( !dryRunFlag ){
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
}
capture_case_sensitive_option();
db_must_be_within_tree();
| < < < < | < | 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 |
Glob *pIgnore, *pClean;
if( !dryRunFlag ){
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
}
capture_case_sensitive_option();
db_must_be_within_tree();
if( zIgnoreFlag==0 ){
zIgnoreFlag = db_get("ignore-glob", 0);
}
vid = db_lget_int("checkout",0);
if( vid==0 ){
fossil_panic("no checkout to add to");
}
db_begin_transaction();
/* step 1:
** Populate the temp table "sfile" with the names of all unmanaged
** files currently in the check-out, except for files that match the
** --ignore or ignore-glob patterns and dot-files. Then add all of
** the files in the sfile temp table to the set of managed files.
*/
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
filename_collation());
n = strlen(g.zLocalRoot);
blob_init(&path, g.zLocalRoot, n-1);
/* now we read the complete file structure into a temp table */
pIgnore = glob_create(zIgnoreFlag);
vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
glob_free(pIgnore);
nAdd = add_files_in_sfile(vid);
/* step 2: search for missing files */
db_prepare(&q,
"SELECT pathname, %Q || pathname, deleted FROM vfile"
" WHERE NOT deleted"
" ORDER BY 1",
|
| ︙ | ︙ |
Changes to src/checkin.c.
| ︙ | ︙ | |||
380 381 382 383 384 385 386 387 388 | /* ** COMMAND: clean ** Usage: %fossil clean ?OPTIONS? ** ** Delete all "extra" files in the source tree. "Extra" files are ** files that are not officially part of the checkout. This operation ** cannot be undone. ** ** You will be prompted before removing each eligible file unless the | > > > > > | | | | | | < < < > > > > > | | | > < > | | > > > > > > > > > > > > > > | < > > < | < | | > > > > | 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 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 |
/*
** COMMAND: clean
** Usage: %fossil clean ?OPTIONS?
**
** Delete all "extra" files in the source tree. "Extra" files are
** files that are not officially part of the checkout. This operation
** cannot be undone.
**
** WARNING: Normally, only the files unknown to Fossil are removed;
** however, if the --extreme option is specified, all files that are
** not part of the current checkout will be removed as well, without
** regard for the files which are normally ignored.
**
** You will be prompted before removing each eligible file unless the
** --force flag is in use or it matches the --ignore option. The
** GLOBPATTERN specified by the "ignore-glob" setting is used if the
** --ignore option is omitted, the same with "keep-glob" and --keep.
** If you are sure you wish to remove all "extra" files except the
** ones specified with --ignore and --keep, you can specify the
** optional -f|--force flag and no prompts will be issued. If a
** file matches both --keep and --ignore, --keep takes precedence.
**
** Files and subdirectories whose names begin with "." are
** normally kept. They are handled if the "--dotfiles" option
** is used.
**
** Options:
** --case-sensitive <BOOL> override case-sensitive setting
** --dotfiles Include files beginning with a dot (".").
** -f|--force Remove files without prompting.
** --ignore <CSG> Ignore files matching patterns from the
** comma separated list of glob patterns.
** --keep <CSG> Keep files matching this comma separated
** list of glob patterns.
** -n|--dry-run If given, display instead of run actions.
** --temp Remove only Fossil-generated temporary files.
** -v|--verbose Show all files as they are removed.
** -x|--extreme Remove all files not part of the current
** checkout, without taking into consideration
** the "ignore-glob" setting and the --ignore
** command line option.
** Compatibile with "git clean -x".
**
** See also: addremove, extra, status
*/
void clean_cmd(void){
int allFlag, dryRunFlag, verboseFlag, extremeFlag;
unsigned scanFlags = 0;
const char *zIgnoreFlag, *zKeepFlag;
Blob path, repo;
Stmt q;
int n;
Glob *pIgnore, *pKeep;
dryRunFlag = find_option("dry-run","n",0)!=0;
if( !dryRunFlag ){
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
}
extremeFlag = find_option("extreme","x",0)!=0;
allFlag = find_option("force","f",0)!=0;
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
zIgnoreFlag = find_option("ignore",0,1);
verboseFlag = find_option("verbose","v",0)!=0;
zKeepFlag = find_option("keep",0,1);
capture_case_sensitive_option();
db_must_be_within_tree();
if( zIgnoreFlag==0 ){
zIgnoreFlag = db_get("ignore-glob", 0);
}
if( zKeepFlag==0 ){
zKeepFlag = db_get("keep-glob", 0);
}
verify_all_options();
if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){
Blob extremeAnswer;
char *extremePrompt =
"\n\nWARNING: The --extreme option is enabled and all untracked files\n"
"that would otherwise be left alone will be deleted (i.e. those\n"
"matching the \"ignore-glob\" settings and the --ignore command\n"
"line option). As a precaution, in order to proceed with this\n"
"clean operation, the string \"YES\" must be entered in all upper\n"
"case; any other response will cancel the clean operation.\n\n"
"Do you still wish to proceed with the clean operation? ";
blob_zero(&extremeAnswer);
prompt_user(extremePrompt, &extremeAnswer);
if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){
fossil_print("Extreme clean operation canceled.\n");
blob_reset(&extremeAnswer);
return;
}
blob_reset(&extremeAnswer);
}
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
filename_collation());
n = strlen(g.zLocalRoot);
blob_init(&path, g.zLocalRoot, n-1);
pIgnore = glob_create(zIgnoreFlag);
pKeep = glob_create(zKeepFlag);
vfile_scan(&path, blob_size(&path), scanFlags,
extremeFlag ? 0 : pIgnore);
db_prepare(&q,
"SELECT %Q || x FROM sfile"
" WHERE x NOT IN (%s)"
" ORDER BY 1",
g.zLocalRoot, fossil_all_reserved_names(0)
);
if( file_tree_name(g.zRepositoryName, &repo, 0) ){
db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
}
db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
while( db_step(&q)==SQLITE_ROW ){
const char *zName = db_column_text(&q, 0);
if( glob_match(pKeep, zName+n) ){
fossil_print("WARNING: KEPT file \"%s\" not removed\n");
continue;
}
if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+n)) ){
Blob ans;
char cReply;
char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
zName+n);
blob_zero(&ans);
prompt_user(prompt, &ans);
cReply = blob_str(&ans)[0];
|
| ︙ | ︙ | |||
488 489 490 491 492 493 494 |
if( verboseFlag || dryRunFlag ){
fossil_print("Removed unmanaged file: %s\n", zName+n);
}
if( !dryRunFlag ){
file_delete(zName);
}
}
| > | | 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 |
if( verboseFlag || dryRunFlag ){
fossil_print("Removed unmanaged file: %s\n", zName+n);
}
if( !dryRunFlag ){
file_delete(zName);
}
}
glob_free(pKeep);
glob_free(pIgnore);
db_finalize(&q);
}
/*
** Prompt the user for a check-in or stash comment (given in pPrompt),
** gather the response, then return the response in pComment.
**
|
| ︙ | ︙ |
Changes to src/configure.c.
| ︙ | ︙ | |||
99 100 101 102 103 104 105 |
{ "tcl-setup", CONFIGSET_SKIN|CONFIGSET_TKT|CONFIGSET_XFER },
#endif
{ "project-name", CONFIGSET_PROJ },
{ "project-description", CONFIGSET_PROJ },
{ "manifest", CONFIGSET_PROJ },
{ "binary-glob", CONFIGSET_PROJ },
| < | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
{ "tcl-setup", CONFIGSET_SKIN|CONFIGSET_TKT|CONFIGSET_XFER },
#endif
{ "project-name", CONFIGSET_PROJ },
{ "project-description", CONFIGSET_PROJ },
{ "manifest", CONFIGSET_PROJ },
{ "binary-glob", CONFIGSET_PROJ },
{ "ignore-glob", CONFIGSET_PROJ },
{ "keep-glob", CONFIGSET_PROJ },
{ "crnl-glob", CONFIGSET_PROJ },
{ "encoding-glob", CONFIGSET_PROJ },
{ "empty-dirs", CONFIGSET_PROJ },
{ "allow-symlinks", CONFIGSET_PROJ },
|
| ︙ | ︙ |
Changes to src/db.c.
| ︙ | ︙ | |||
2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 |
int width; /* Width of display. 0 for boolean values */
int versionable; /* Is this setting versionable? */
char const *def; /* Default value */
};
#endif /* INTERFACE */
struct stControlSettings const ctrlSettings[] = {
{ "access-log", 0, 0, 0, "off" },
{ "allow-symlinks",0, 0, 1, "off" },
{ "auto-captcha", "autocaptcha", 0, 0, "on" },
{ "auto-hyperlink",0, 0, 0, "on", },
{ "auto-shun", 0, 0, 0, "on" },
{ "autosync", 0, 0, 0, "on" },
{ "binary-glob", 0, 40, 1, "" },
{ "clearsign", 0, 0, 0, "off" },
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
{ "case-sensitive",0, 0, 0, "off" },
#else
{ "case-sensitive",0, 0, 0, "on" },
#endif
| > < | 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 |
int width; /* Width of display. 0 for boolean values */
int versionable; /* Is this setting versionable? */
char const *def; /* Default value */
};
#endif /* INTERFACE */
struct stControlSettings const ctrlSettings[] = {
{ "access-log", 0, 0, 0, "off" },
{ "allow-clean-x", 0, 0, 0, "off" },
{ "allow-symlinks",0, 0, 1, "off" },
{ "auto-captcha", "autocaptcha", 0, 0, "on" },
{ "auto-hyperlink",0, 0, 0, "on", },
{ "auto-shun", 0, 0, 0, "on" },
{ "autosync", 0, 0, 0, "on" },
{ "binary-glob", 0, 40, 1, "" },
{ "clearsign", 0, 0, 0, "off" },
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
{ "case-sensitive",0, 0, 0, "off" },
#else
{ "case-sensitive",0, 0, 0, "on" },
#endif
{ "crnl-glob", 0, 40, 1, "" },
{ "default-perms", 0, 16, 0, "u" },
{ "diff-binary", 0, 0, 0, "on" },
{ "diff-command", 0, 40, 0, "" },
{ "dont-push", 0, 0, 0, "off" },
{ "editor", 0, 32, 0, "" },
{ "empty-dirs", 0, 40, 1, "" },
|
| ︙ | ︙ | |||
2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 | ** in the "accesslog" table. Default: off ** ** allow-symlinks If enabled, don't follow symlinks, and instead treat ** (versionable) them as symlinks on Unix. Has no effect on Windows ** (existing links in repository created on Unix become ** plain-text files with link destination path inside). ** Default: off ** ** auto-captcha If enabled, the Login page provides a button to ** fill in the captcha password. Default: on ** ** auto-hyperlink Use javascript to enable hyperlinks on web pages ** for all users (regardless of the "h" privilege) if the ** User-Agent string in the HTTP header look like it came | > > > > | 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 | ** in the "accesslog" table. Default: off ** ** allow-symlinks If enabled, don't follow symlinks, and instead treat ** (versionable) them as symlinks on Unix. Has no effect on Windows ** (existing links in repository created on Unix become ** plain-text files with link destination path inside). ** Default: off ** ** allow-clean-x If enabled, allow the --extreme option to be used in ** the clean command. ** Default: off ** ** auto-captcha If enabled, the Login page provides a button to ** fill in the captcha password. Default: on ** ** auto-hyperlink Use javascript to enable hyperlinks on web pages ** for all users (regardless of the "h" privilege) if the ** User-Agent string in the HTTP header look like it came |
| ︙ | ︙ | |||
2187 2188 2189 2190 2191 2192 2193 | ** for committing and merging purposes. Example: *.jpg ** ** case-sensitive If TRUE, the files whose names differ only in case ** care considered distinct. If FALSE files whose names ** differ only in case are the same file. Defaults to ** TRUE for unix and FALSE for Cygwin, Mac and Windows. ** | < < < < < | 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 | ** for committing and merging purposes. Example: *.jpg ** ** case-sensitive If TRUE, the files whose names differ only in case ** care considered distinct. If FALSE files whose names ** differ only in case are the same file. Defaults to ** TRUE for unix and FALSE for Cygwin, Mac and Windows. ** ** clearsign When enabled, fossil will attempt to sign all commits ** with gpg. When disabled (the default), commits will ** be unsigned. Default: off ** ** crnl-glob A comma or newline-separated list of GLOB patterns for ** (versionable) text files in which it is ok to have CR, CR+NL or mixed ** line endings. Set to "*" to disable CR+NL checking. |
| ︙ | ︙ | |||
2245 2246 2247 2248 2249 2250 2251 | ** ** https-login Send login credentials using HTTPS instead of HTTP ** even if the login page request came via HTTP. ** ** ignore-glob The VALUE is a comma or newline-separated list of GLOB ** (versionable) patterns specifying files that the "add", "addremove", ** "clean", and "extra" commands will ignore. | | | | 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 | ** ** https-login Send login credentials using HTTPS instead of HTTP ** even if the login page request came via HTTP. ** ** ignore-glob The VALUE is a comma or newline-separated list of GLOB ** (versionable) patterns specifying files that the "add", "addremove", ** "clean", and "extra" commands will ignore. ** Example: *.log *.a *.lib *.o ** ** keep-glob The VALUE is a comma or newline-separated list of GLOB ** (versionable) patterns specifying files that the "clean" command will ** keep. Example: *.log customCode.c notes.txt ** ** localauth If enabled, require that HTTP connections from ** 127.0.0.1 be authenticated by password. If ** false, all HTTP requests from localhost have ** unrestricted access to the repository. ** ** main-branch The primary branch for the project. Default: trunk |
| ︙ | ︙ |
Changes to src/json_config.c.
| ︙ | ︙ | |||
62 63 64 65 66 67 68 |
{ "timeline-block-markup", CONFIGSET_SKIN },
{ "timeline-max-comment", CONFIGSET_SKIN },
{ "project-name", CONFIGSET_PROJ },
{ "project-description", CONFIGSET_PROJ },
{ "manifest", CONFIGSET_PROJ },
{ "binary-glob", CONFIGSET_PROJ },
| < | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
{ "timeline-block-markup", CONFIGSET_SKIN },
{ "timeline-max-comment", CONFIGSET_SKIN },
{ "project-name", CONFIGSET_PROJ },
{ "project-description", CONFIGSET_PROJ },
{ "manifest", CONFIGSET_PROJ },
{ "binary-glob", CONFIGSET_PROJ },
{ "encoding-glob", CONFIGSET_PROJ },
{ "ignore-glob", CONFIGSET_PROJ },
{ "keep-glob", CONFIGSET_PROJ },
{ "crnl-glob", CONFIGSET_PROJ },
{ "empty-dirs", CONFIGSET_PROJ },
{ "allow-symlinks", CONFIGSET_PROJ },
|
| ︙ | ︙ |
Changes to src/vfile.c.
| ︙ | ︙ | |||
431 432 433 434 435 436 437 |
** Files whose names begin with "." are omitted unless allFlag is true.
**
** Any files or directories that match the glob pattern pIgnore are
** excluded from the scan. Name matching occurs after the first
** nPrefix characters are elided from the filename.
*/
void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){
| < < < < < < < < < < | | < | 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
** Files whose names begin with "." are omitted unless allFlag is true.
**
** Any files or directories that match the glob pattern pIgnore are
** excluded from the scan. Name matching occurs after the first
** nPrefix characters are elided from the filename.
*/
void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){
DIR *d;
int origSize;
const char *zDir;
struct dirent *pEntry;
int skipAll = 0;
static Stmt ins;
static int depth = 0;
void *zNative;
origSize = blob_size(pPath);
if( pIgnore ){
blob_appendf(pPath, "/");
if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
blob_resize(pPath, origSize);
}
if( skipAll ) return;
if( depth==0 ){
db_prepare(&ins,
"INSERT OR IGNORE INTO sfile(x) SELECT :file"
|
| ︙ | ︙ | |||
483 484 485 486 487 488 489 |
if( (scanFlags & SCAN_ALL)==0 ) continue;
if( pEntry->d_name[1]==0 ) continue;
if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue;
}
zUtf8 = fossil_filename_to_utf8(pEntry->d_name);
blob_appendf(pPath, "/%s", zUtf8);
zPath = blob_str(pPath);
| < | | | 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
if( (scanFlags & SCAN_ALL)==0 ) continue;
if( pEntry->d_name[1]==0 ) continue;
if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue;
}
zUtf8 = fossil_filename_to_utf8(pEntry->d_name);
blob_appendf(pPath, "/%s", zUtf8);
zPath = blob_str(pPath);
if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
/* do nothing */
}else if( file_wd_isdir(zPath)==1 ){
if( !vfile_top_of_checkout(zPath) ){
vfile_scan(pPath, nPrefix, scanFlags, pIgnore);
}
}else if( file_wd_isfile_or_link(zPath) ){
if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
db_step(&ins);
db_reset(&ins);
}
|
| ︙ | ︙ |