Fossil SCM
Take over some improvements/fixes from the CleanX2 branch. Still not very well tested, so please don't look ;-)
Commit
b2a2ce5312be205727349b2421407e65f68a0293
Parent
5724c62cf613546…
4 files changed
+12
-6
+12
-6
+4
-7
+4
-7
+12
-6
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -545,11 +545,11 @@ | ||
| 545 | 545 | ** Compatibile with "git clean -x". |
| 546 | 546 | ** |
| 547 | 547 | ** See also: addremove, extra, status |
| 548 | 548 | */ |
| 549 | 549 | void clean_cmd(void){ |
| 550 | - int allFileFlag, allDirFlag, dryRunFlag, extremeFlag, verboseFlag; | |
| 550 | + int allFileFlag, allDirFlag, dryRunFlag, verboseFlag, extremeFlag; | |
| 551 | 551 | int emptyDirsFlag, dirsOnlyFlag; |
| 552 | 552 | unsigned scanFlags = 0; |
| 553 | 553 | const char *zIgnoreFlag, *zKeepFlag; |
| 554 | 554 | Glob *pIgnore, *pKeep; |
| 555 | 555 | int nRoot; |
| @@ -559,11 +559,11 @@ | ||
| 559 | 559 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 560 | 560 | } |
| 561 | 561 | extremeFlag = find_option("extreme","x",0)!=0; |
| 562 | 562 | allFileFlag = allDirFlag = find_option("force","f",0)!=0; |
| 563 | 563 | dirsOnlyFlag = find_option("dirsonly",0,0)!=0; |
| 564 | - emptyDirsFlag = dirsOnlyFlag || find_option("emptydirs","d",0)!=0; | |
| 564 | + emptyDirsFlag = find_option("emptydirs","d",0)!=0 || dirsOnlyFlag; | |
| 565 | 565 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 566 | 566 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 567 | 567 | if( find_option("allckouts",0,0)!=0 ) scanFlags |= SCAN_NESTED; |
| 568 | 568 | zIgnoreFlag = find_option("ignore",0,1); |
| 569 | 569 | verboseFlag = find_option("verbose","v",0)!=0; |
| @@ -600,11 +600,12 @@ | ||
| 600 | 600 | pKeep = glob_create(zKeepFlag); |
| 601 | 601 | nRoot = (int)strlen(g.zLocalRoot); |
| 602 | 602 | if( !dirsOnlyFlag ){ |
| 603 | 603 | Stmt q; |
| 604 | 604 | Blob repo; |
| 605 | - locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, extremeFlag ? 0 : pIgnore); | |
| 605 | + locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, | |
| 606 | + extremeFlag ? 0 : pIgnore); | |
| 606 | 607 | db_prepare(&q, |
| 607 | 608 | "SELECT %Q || x FROM sfile" |
| 608 | 609 | " WHERE x NOT IN (%s)" |
| 609 | 610 | " ORDER BY 1", |
| 610 | 611 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -613,10 +614,14 @@ | ||
| 613 | 614 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 614 | 615 | } |
| 615 | 616 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 616 | 617 | while( db_step(&q)==SQLITE_ROW ){ |
| 617 | 618 | const char *zName = db_column_text(&q, 0); |
| 619 | + if( glob_match(pKeep, zName+nRoot) ){ | |
| 620 | + fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot); | |
| 621 | + continue; | |
| 622 | + } | |
| 618 | 623 | if( !allFileFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){ |
| 619 | 624 | Blob ans; |
| 620 | 625 | char cReply; |
| 621 | 626 | char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ", |
| 622 | 627 | zName+nRoot); |
| @@ -644,12 +649,13 @@ | ||
| 644 | 649 | if( emptyDirsFlag ){ |
| 645 | 650 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 646 | 651 | Stmt q; |
| 647 | 652 | Blob root; |
| 648 | 653 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 649 | - vfile_dir_scan(&root, blob_size(&root), scanFlags, pIgnore, pKeep, | |
| 650 | - pEmptyDirs); | |
| 654 | + vfile_dir_scan(&root, blob_size(&root), scanFlags, | |
| 655 | + extremeFlag ? 0 : pIgnore, | |
| 656 | + extremeFlag ? 0 : pEmptyDirs); | |
| 651 | 657 | blob_reset(&root); |
| 652 | 658 | db_prepare(&q, |
| 653 | 659 | "SELECT %Q || x FROM dscan_temp" |
| 654 | 660 | " WHERE x NOT IN (%s) AND y = 0" |
| 655 | 661 | " ORDER BY 1 DESC", |
| @@ -656,11 +662,11 @@ | ||
| 656 | 662 | g.zLocalRoot, fossil_all_reserved_names(0) |
| 657 | 663 | ); |
| 658 | 664 | while( db_step(&q)==SQLITE_ROW ){ |
| 659 | 665 | const char *zName = db_column_text(&q, 0); |
| 660 | 666 | if( glob_match(pKeep, zName+nRoot) ){ |
| 661 | - fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot); | |
| 667 | + fossil_print("WARNING: KEPT directory \"%s\" not removed\n", zName+nRoot); | |
| 662 | 668 | continue; |
| 663 | 669 | } |
| 664 | 670 | if( !allDirFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){ |
| 665 | 671 | Blob ans; |
| 666 | 672 | char cReply; |
| 667 | 673 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -545,11 +545,11 @@ | |
| 545 | ** Compatibile with "git clean -x". |
| 546 | ** |
| 547 | ** See also: addremove, extra, status |
| 548 | */ |
| 549 | void clean_cmd(void){ |
| 550 | int allFileFlag, allDirFlag, dryRunFlag, extremeFlag, verboseFlag; |
| 551 | int emptyDirsFlag, dirsOnlyFlag; |
| 552 | unsigned scanFlags = 0; |
| 553 | const char *zIgnoreFlag, *zKeepFlag; |
| 554 | Glob *pIgnore, *pKeep; |
| 555 | int nRoot; |
| @@ -559,11 +559,11 @@ | |
| 559 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 560 | } |
| 561 | extremeFlag = find_option("extreme","x",0)!=0; |
| 562 | allFileFlag = allDirFlag = find_option("force","f",0)!=0; |
| 563 | dirsOnlyFlag = find_option("dirsonly",0,0)!=0; |
| 564 | emptyDirsFlag = dirsOnlyFlag || find_option("emptydirs","d",0)!=0; |
| 565 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 566 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 567 | if( find_option("allckouts",0,0)!=0 ) scanFlags |= SCAN_NESTED; |
| 568 | zIgnoreFlag = find_option("ignore",0,1); |
| 569 | verboseFlag = find_option("verbose","v",0)!=0; |
| @@ -600,11 +600,12 @@ | |
| 600 | pKeep = glob_create(zKeepFlag); |
| 601 | nRoot = (int)strlen(g.zLocalRoot); |
| 602 | if( !dirsOnlyFlag ){ |
| 603 | Stmt q; |
| 604 | Blob repo; |
| 605 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, extremeFlag ? 0 : pIgnore); |
| 606 | db_prepare(&q, |
| 607 | "SELECT %Q || x FROM sfile" |
| 608 | " WHERE x NOT IN (%s)" |
| 609 | " ORDER BY 1", |
| 610 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -613,10 +614,14 @@ | |
| 613 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 614 | } |
| 615 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 616 | while( db_step(&q)==SQLITE_ROW ){ |
| 617 | const char *zName = db_column_text(&q, 0); |
| 618 | if( !allFileFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){ |
| 619 | Blob ans; |
| 620 | char cReply; |
| 621 | char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ", |
| 622 | zName+nRoot); |
| @@ -644,12 +649,13 @@ | |
| 644 | if( emptyDirsFlag ){ |
| 645 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 646 | Stmt q; |
| 647 | Blob root; |
| 648 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 649 | vfile_dir_scan(&root, blob_size(&root), scanFlags, pIgnore, pKeep, |
| 650 | pEmptyDirs); |
| 651 | blob_reset(&root); |
| 652 | db_prepare(&q, |
| 653 | "SELECT %Q || x FROM dscan_temp" |
| 654 | " WHERE x NOT IN (%s) AND y = 0" |
| 655 | " ORDER BY 1 DESC", |
| @@ -656,11 +662,11 @@ | |
| 656 | g.zLocalRoot, fossil_all_reserved_names(0) |
| 657 | ); |
| 658 | while( db_step(&q)==SQLITE_ROW ){ |
| 659 | const char *zName = db_column_text(&q, 0); |
| 660 | if( glob_match(pKeep, zName+nRoot) ){ |
| 661 | fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot); |
| 662 | continue; |
| 663 | } |
| 664 | if( !allDirFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){ |
| 665 | Blob ans; |
| 666 | char cReply; |
| 667 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -545,11 +545,11 @@ | |
| 545 | ** Compatibile with "git clean -x". |
| 546 | ** |
| 547 | ** See also: addremove, extra, status |
| 548 | */ |
| 549 | void clean_cmd(void){ |
| 550 | int allFileFlag, allDirFlag, dryRunFlag, verboseFlag, extremeFlag; |
| 551 | int emptyDirsFlag, dirsOnlyFlag; |
| 552 | unsigned scanFlags = 0; |
| 553 | const char *zIgnoreFlag, *zKeepFlag; |
| 554 | Glob *pIgnore, *pKeep; |
| 555 | int nRoot; |
| @@ -559,11 +559,11 @@ | |
| 559 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 560 | } |
| 561 | extremeFlag = find_option("extreme","x",0)!=0; |
| 562 | allFileFlag = allDirFlag = find_option("force","f",0)!=0; |
| 563 | dirsOnlyFlag = find_option("dirsonly",0,0)!=0; |
| 564 | emptyDirsFlag = find_option("emptydirs","d",0)!=0 || dirsOnlyFlag; |
| 565 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 566 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 567 | if( find_option("allckouts",0,0)!=0 ) scanFlags |= SCAN_NESTED; |
| 568 | zIgnoreFlag = find_option("ignore",0,1); |
| 569 | verboseFlag = find_option("verbose","v",0)!=0; |
| @@ -600,11 +600,12 @@ | |
| 600 | pKeep = glob_create(zKeepFlag); |
| 601 | nRoot = (int)strlen(g.zLocalRoot); |
| 602 | if( !dirsOnlyFlag ){ |
| 603 | Stmt q; |
| 604 | Blob repo; |
| 605 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, |
| 606 | extremeFlag ? 0 : pIgnore); |
| 607 | db_prepare(&q, |
| 608 | "SELECT %Q || x FROM sfile" |
| 609 | " WHERE x NOT IN (%s)" |
| 610 | " ORDER BY 1", |
| 611 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -613,10 +614,14 @@ | |
| 614 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 615 | } |
| 616 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 617 | while( db_step(&q)==SQLITE_ROW ){ |
| 618 | const char *zName = db_column_text(&q, 0); |
| 619 | if( glob_match(pKeep, zName+nRoot) ){ |
| 620 | fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot); |
| 621 | continue; |
| 622 | } |
| 623 | if( !allFileFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){ |
| 624 | Blob ans; |
| 625 | char cReply; |
| 626 | char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ", |
| 627 | zName+nRoot); |
| @@ -644,12 +649,13 @@ | |
| 649 | if( emptyDirsFlag ){ |
| 650 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 651 | Stmt q; |
| 652 | Blob root; |
| 653 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 654 | vfile_dir_scan(&root, blob_size(&root), scanFlags, |
| 655 | extremeFlag ? 0 : pIgnore, |
| 656 | extremeFlag ? 0 : pEmptyDirs); |
| 657 | blob_reset(&root); |
| 658 | db_prepare(&q, |
| 659 | "SELECT %Q || x FROM dscan_temp" |
| 660 | " WHERE x NOT IN (%s) AND y = 0" |
| 661 | " ORDER BY 1 DESC", |
| @@ -656,11 +662,11 @@ | |
| 662 | g.zLocalRoot, fossil_all_reserved_names(0) |
| 663 | ); |
| 664 | while( db_step(&q)==SQLITE_ROW ){ |
| 665 | const char *zName = db_column_text(&q, 0); |
| 666 | if( glob_match(pKeep, zName+nRoot) ){ |
| 667 | fossil_print("WARNING: KEPT directory \"%s\" not removed\n", zName+nRoot); |
| 668 | continue; |
| 669 | } |
| 670 | if( !allDirFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){ |
| 671 | Blob ans; |
| 672 | char cReply; |
| 673 |
+12
-6
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -545,11 +545,11 @@ | ||
| 545 | 545 | ** Compatibile with "git clean -x". |
| 546 | 546 | ** |
| 547 | 547 | ** See also: addremove, extra, status |
| 548 | 548 | */ |
| 549 | 549 | void clean_cmd(void){ |
| 550 | - int allFileFlag, allDirFlag, dryRunFlag, extremeFlag, verboseFlag; | |
| 550 | + int allFileFlag, allDirFlag, dryRunFlag, verboseFlag, extremeFlag; | |
| 551 | 551 | int emptyDirsFlag, dirsOnlyFlag; |
| 552 | 552 | unsigned scanFlags = 0; |
| 553 | 553 | const char *zIgnoreFlag, *zKeepFlag; |
| 554 | 554 | Glob *pIgnore, *pKeep; |
| 555 | 555 | int nRoot; |
| @@ -559,11 +559,11 @@ | ||
| 559 | 559 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 560 | 560 | } |
| 561 | 561 | extremeFlag = find_option("extreme","x",0)!=0; |
| 562 | 562 | allFileFlag = allDirFlag = find_option("force","f",0)!=0; |
| 563 | 563 | dirsOnlyFlag = find_option("dirsonly",0,0)!=0; |
| 564 | - emptyDirsFlag = dirsOnlyFlag || find_option("emptydirs","d",0)!=0; | |
| 564 | + emptyDirsFlag = find_option("emptydirs","d",0)!=0 || dirsOnlyFlag; | |
| 565 | 565 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 566 | 566 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 567 | 567 | if( find_option("allckouts",0,0)!=0 ) scanFlags |= SCAN_NESTED; |
| 568 | 568 | zIgnoreFlag = find_option("ignore",0,1); |
| 569 | 569 | verboseFlag = find_option("verbose","v",0)!=0; |
| @@ -600,11 +600,12 @@ | ||
| 600 | 600 | pKeep = glob_create(zKeepFlag); |
| 601 | 601 | nRoot = (int)strlen(g.zLocalRoot); |
| 602 | 602 | if( !dirsOnlyFlag ){ |
| 603 | 603 | Stmt q; |
| 604 | 604 | Blob repo; |
| 605 | - locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, extremeFlag ? 0 : pIgnore); | |
| 605 | + locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, | |
| 606 | + extremeFlag ? 0 : pIgnore); | |
| 606 | 607 | db_prepare(&q, |
| 607 | 608 | "SELECT %Q || x FROM sfile" |
| 608 | 609 | " WHERE x NOT IN (%s)" |
| 609 | 610 | " ORDER BY 1", |
| 610 | 611 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -613,10 +614,14 @@ | ||
| 613 | 614 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 614 | 615 | } |
| 615 | 616 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 616 | 617 | while( db_step(&q)==SQLITE_ROW ){ |
| 617 | 618 | const char *zName = db_column_text(&q, 0); |
| 619 | + if( glob_match(pKeep, zName+nRoot) ){ | |
| 620 | + fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot); | |
| 621 | + continue; | |
| 622 | + } | |
| 618 | 623 | if( !allFileFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){ |
| 619 | 624 | Blob ans; |
| 620 | 625 | char cReply; |
| 621 | 626 | char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ", |
| 622 | 627 | zName+nRoot); |
| @@ -644,12 +649,13 @@ | ||
| 644 | 649 | if( emptyDirsFlag ){ |
| 645 | 650 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 646 | 651 | Stmt q; |
| 647 | 652 | Blob root; |
| 648 | 653 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 649 | - vfile_dir_scan(&root, blob_size(&root), scanFlags, pIgnore, pKeep, | |
| 650 | - pEmptyDirs); | |
| 654 | + vfile_dir_scan(&root, blob_size(&root), scanFlags, | |
| 655 | + extremeFlag ? 0 : pIgnore, | |
| 656 | + extremeFlag ? 0 : pEmptyDirs); | |
| 651 | 657 | blob_reset(&root); |
| 652 | 658 | db_prepare(&q, |
| 653 | 659 | "SELECT %Q || x FROM dscan_temp" |
| 654 | 660 | " WHERE x NOT IN (%s) AND y = 0" |
| 655 | 661 | " ORDER BY 1 DESC", |
| @@ -656,11 +662,11 @@ | ||
| 656 | 662 | g.zLocalRoot, fossil_all_reserved_names(0) |
| 657 | 663 | ); |
| 658 | 664 | while( db_step(&q)==SQLITE_ROW ){ |
| 659 | 665 | const char *zName = db_column_text(&q, 0); |
| 660 | 666 | if( glob_match(pKeep, zName+nRoot) ){ |
| 661 | - fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot); | |
| 667 | + fossil_print("WARNING: KEPT directory \"%s\" not removed\n", zName+nRoot); | |
| 662 | 668 | continue; |
| 663 | 669 | } |
| 664 | 670 | if( !allDirFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){ |
| 665 | 671 | Blob ans; |
| 666 | 672 | char cReply; |
| 667 | 673 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -545,11 +545,11 @@ | |
| 545 | ** Compatibile with "git clean -x". |
| 546 | ** |
| 547 | ** See also: addremove, extra, status |
| 548 | */ |
| 549 | void clean_cmd(void){ |
| 550 | int allFileFlag, allDirFlag, dryRunFlag, extremeFlag, verboseFlag; |
| 551 | int emptyDirsFlag, dirsOnlyFlag; |
| 552 | unsigned scanFlags = 0; |
| 553 | const char *zIgnoreFlag, *zKeepFlag; |
| 554 | Glob *pIgnore, *pKeep; |
| 555 | int nRoot; |
| @@ -559,11 +559,11 @@ | |
| 559 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 560 | } |
| 561 | extremeFlag = find_option("extreme","x",0)!=0; |
| 562 | allFileFlag = allDirFlag = find_option("force","f",0)!=0; |
| 563 | dirsOnlyFlag = find_option("dirsonly",0,0)!=0; |
| 564 | emptyDirsFlag = dirsOnlyFlag || find_option("emptydirs","d",0)!=0; |
| 565 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 566 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 567 | if( find_option("allckouts",0,0)!=0 ) scanFlags |= SCAN_NESTED; |
| 568 | zIgnoreFlag = find_option("ignore",0,1); |
| 569 | verboseFlag = find_option("verbose","v",0)!=0; |
| @@ -600,11 +600,12 @@ | |
| 600 | pKeep = glob_create(zKeepFlag); |
| 601 | nRoot = (int)strlen(g.zLocalRoot); |
| 602 | if( !dirsOnlyFlag ){ |
| 603 | Stmt q; |
| 604 | Blob repo; |
| 605 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, extremeFlag ? 0 : pIgnore); |
| 606 | db_prepare(&q, |
| 607 | "SELECT %Q || x FROM sfile" |
| 608 | " WHERE x NOT IN (%s)" |
| 609 | " ORDER BY 1", |
| 610 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -613,10 +614,14 @@ | |
| 613 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 614 | } |
| 615 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 616 | while( db_step(&q)==SQLITE_ROW ){ |
| 617 | const char *zName = db_column_text(&q, 0); |
| 618 | if( !allFileFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){ |
| 619 | Blob ans; |
| 620 | char cReply; |
| 621 | char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ", |
| 622 | zName+nRoot); |
| @@ -644,12 +649,13 @@ | |
| 644 | if( emptyDirsFlag ){ |
| 645 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 646 | Stmt q; |
| 647 | Blob root; |
| 648 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 649 | vfile_dir_scan(&root, blob_size(&root), scanFlags, pIgnore, pKeep, |
| 650 | pEmptyDirs); |
| 651 | blob_reset(&root); |
| 652 | db_prepare(&q, |
| 653 | "SELECT %Q || x FROM dscan_temp" |
| 654 | " WHERE x NOT IN (%s) AND y = 0" |
| 655 | " ORDER BY 1 DESC", |
| @@ -656,11 +662,11 @@ | |
| 656 | g.zLocalRoot, fossil_all_reserved_names(0) |
| 657 | ); |
| 658 | while( db_step(&q)==SQLITE_ROW ){ |
| 659 | const char *zName = db_column_text(&q, 0); |
| 660 | if( glob_match(pKeep, zName+nRoot) ){ |
| 661 | fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot); |
| 662 | continue; |
| 663 | } |
| 664 | if( !allDirFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){ |
| 665 | Blob ans; |
| 666 | char cReply; |
| 667 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -545,11 +545,11 @@ | |
| 545 | ** Compatibile with "git clean -x". |
| 546 | ** |
| 547 | ** See also: addremove, extra, status |
| 548 | */ |
| 549 | void clean_cmd(void){ |
| 550 | int allFileFlag, allDirFlag, dryRunFlag, verboseFlag, extremeFlag; |
| 551 | int emptyDirsFlag, dirsOnlyFlag; |
| 552 | unsigned scanFlags = 0; |
| 553 | const char *zIgnoreFlag, *zKeepFlag; |
| 554 | Glob *pIgnore, *pKeep; |
| 555 | int nRoot; |
| @@ -559,11 +559,11 @@ | |
| 559 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 560 | } |
| 561 | extremeFlag = find_option("extreme","x",0)!=0; |
| 562 | allFileFlag = allDirFlag = find_option("force","f",0)!=0; |
| 563 | dirsOnlyFlag = find_option("dirsonly",0,0)!=0; |
| 564 | emptyDirsFlag = find_option("emptydirs","d",0)!=0 || dirsOnlyFlag; |
| 565 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 566 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 567 | if( find_option("allckouts",0,0)!=0 ) scanFlags |= SCAN_NESTED; |
| 568 | zIgnoreFlag = find_option("ignore",0,1); |
| 569 | verboseFlag = find_option("verbose","v",0)!=0; |
| @@ -600,11 +600,12 @@ | |
| 600 | pKeep = glob_create(zKeepFlag); |
| 601 | nRoot = (int)strlen(g.zLocalRoot); |
| 602 | if( !dirsOnlyFlag ){ |
| 603 | Stmt q; |
| 604 | Blob repo; |
| 605 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, |
| 606 | extremeFlag ? 0 : pIgnore); |
| 607 | db_prepare(&q, |
| 608 | "SELECT %Q || x FROM sfile" |
| 609 | " WHERE x NOT IN (%s)" |
| 610 | " ORDER BY 1", |
| 611 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -613,10 +614,14 @@ | |
| 614 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 615 | } |
| 616 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 617 | while( db_step(&q)==SQLITE_ROW ){ |
| 618 | const char *zName = db_column_text(&q, 0); |
| 619 | if( glob_match(pKeep, zName+nRoot) ){ |
| 620 | fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot); |
| 621 | continue; |
| 622 | } |
| 623 | if( !allFileFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){ |
| 624 | Blob ans; |
| 625 | char cReply; |
| 626 | char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ", |
| 627 | zName+nRoot); |
| @@ -644,12 +649,13 @@ | |
| 649 | if( emptyDirsFlag ){ |
| 650 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 651 | Stmt q; |
| 652 | Blob root; |
| 653 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 654 | vfile_dir_scan(&root, blob_size(&root), scanFlags, |
| 655 | extremeFlag ? 0 : pIgnore, |
| 656 | extremeFlag ? 0 : pEmptyDirs); |
| 657 | blob_reset(&root); |
| 658 | db_prepare(&q, |
| 659 | "SELECT %Q || x FROM dscan_temp" |
| 660 | " WHERE x NOT IN (%s) AND y = 0" |
| 661 | " ORDER BY 1 DESC", |
| @@ -656,11 +662,11 @@ | |
| 662 | g.zLocalRoot, fossil_all_reserved_names(0) |
| 663 | ); |
| 664 | while( db_step(&q)==SQLITE_ROW ){ |
| 665 | const char *zName = db_column_text(&q, 0); |
| 666 | if( glob_match(pKeep, zName+nRoot) ){ |
| 667 | fossil_print("WARNING: KEPT directory \"%s\" not removed\n", zName+nRoot); |
| 668 | continue; |
| 669 | } |
| 670 | if( !allDirFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){ |
| 671 | Blob ans; |
| 672 | char cReply; |
| 673 |
+4
-7
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -529,12 +529,11 @@ | ||
| 529 | 529 | int vfile_dir_scan( |
| 530 | 530 | Blob *pPath, /* Base directory to be scanned */ |
| 531 | 531 | int nPrefix, /* Number of bytes in base directory name */ |
| 532 | 532 | unsigned scanFlags, /* Zero or more SCAN_xxx flags */ |
| 533 | 533 | Glob *pIgnore1, /* Do not add directories that match this GLOB */ |
| 534 | - Glob *pIgnore2, /* Omit directories matching this GLOB too */ | |
| 535 | - Glob *pIgnore3 /* Omit directories matching this GLOB too */ | |
| 534 | + Glob *pIgnore2 /* Omit directories matching this GLOB too */ | |
| 536 | 535 | ){ |
| 537 | 536 | int result = 0; |
| 538 | 537 | DIR *d; |
| 539 | 538 | int origSize; |
| 540 | 539 | struct dirent *pEntry; |
| @@ -543,15 +542,14 @@ | ||
| 543 | 542 | static Stmt upd; |
| 544 | 543 | static int depth = 0; |
| 545 | 544 | void *zNative; |
| 546 | 545 | |
| 547 | 546 | origSize = blob_size(pPath); |
| 548 | - if( pIgnore1 || pIgnore2 || pIgnore3 ){ | |
| 547 | + if( pIgnore1 || pIgnore2 ){ | |
| 549 | 548 | blob_appendf(pPath, "/"); |
| 550 | 549 | if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 551 | 550 | if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 552 | - if( glob_match(pIgnore3, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; | |
| 553 | 551 | blob_resize(pPath, origSize); |
| 554 | 552 | } |
| 555 | 553 | if( skipAll ) return result; |
| 556 | 554 | |
| 557 | 555 | if( depth==0 ){ |
| @@ -587,18 +585,17 @@ | ||
| 587 | 585 | zOrigPath = mprintf("%s", blob_str(pPath)); |
| 588 | 586 | zUtf8 = fossil_filename_to_utf8(pEntry->d_name); |
| 589 | 587 | blob_appendf(pPath, "/%s", zUtf8); |
| 590 | 588 | zPath = blob_str(pPath); |
| 591 | 589 | if( glob_match(pIgnore1, &zPath[nPrefix+1]) || |
| 592 | - glob_match(pIgnore2, &zPath[nPrefix+1]) || | |
| 593 | - glob_match(pIgnore3, &zPath[nPrefix+1]) ){ | |
| 590 | + glob_match(pIgnore2, &zPath[nPrefix+1]) ){ | |
| 594 | 591 | /* do nothing */ |
| 595 | 592 | }else if( file_wd_isdir(zPath)==1 ){ |
| 596 | 593 | if( (scanFlags & SCAN_NESTED) || !vfile_top_of_checkout(zPath) ){ |
| 597 | 594 | char *zSavePath = mprintf("%s", zPath); |
| 598 | 595 | int count = vfile_dir_scan(pPath, nPrefix, scanFlags, pIgnore1, |
| 599 | - pIgnore2, pIgnore3); | |
| 596 | + pIgnore2); | |
| 600 | 597 | db_bind_text(&ins, ":file", &zSavePath[nPrefix+1]); |
| 601 | 598 | db_bind_int(&ins, ":count", count); |
| 602 | 599 | db_step(&ins); |
| 603 | 600 | db_reset(&ins); |
| 604 | 601 | fossil_free(zSavePath); |
| 605 | 602 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -529,12 +529,11 @@ | |
| 529 | int vfile_dir_scan( |
| 530 | Blob *pPath, /* Base directory to be scanned */ |
| 531 | int nPrefix, /* Number of bytes in base directory name */ |
| 532 | unsigned scanFlags, /* Zero or more SCAN_xxx flags */ |
| 533 | Glob *pIgnore1, /* Do not add directories that match this GLOB */ |
| 534 | Glob *pIgnore2, /* Omit directories matching this GLOB too */ |
| 535 | Glob *pIgnore3 /* Omit directories matching this GLOB too */ |
| 536 | ){ |
| 537 | int result = 0; |
| 538 | DIR *d; |
| 539 | int origSize; |
| 540 | struct dirent *pEntry; |
| @@ -543,15 +542,14 @@ | |
| 543 | static Stmt upd; |
| 544 | static int depth = 0; |
| 545 | void *zNative; |
| 546 | |
| 547 | origSize = blob_size(pPath); |
| 548 | if( pIgnore1 || pIgnore2 || pIgnore3 ){ |
| 549 | blob_appendf(pPath, "/"); |
| 550 | if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 551 | if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 552 | if( glob_match(pIgnore3, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 553 | blob_resize(pPath, origSize); |
| 554 | } |
| 555 | if( skipAll ) return result; |
| 556 | |
| 557 | if( depth==0 ){ |
| @@ -587,18 +585,17 @@ | |
| 587 | zOrigPath = mprintf("%s", blob_str(pPath)); |
| 588 | zUtf8 = fossil_filename_to_utf8(pEntry->d_name); |
| 589 | blob_appendf(pPath, "/%s", zUtf8); |
| 590 | zPath = blob_str(pPath); |
| 591 | if( glob_match(pIgnore1, &zPath[nPrefix+1]) || |
| 592 | glob_match(pIgnore2, &zPath[nPrefix+1]) || |
| 593 | glob_match(pIgnore3, &zPath[nPrefix+1]) ){ |
| 594 | /* do nothing */ |
| 595 | }else if( file_wd_isdir(zPath)==1 ){ |
| 596 | if( (scanFlags & SCAN_NESTED) || !vfile_top_of_checkout(zPath) ){ |
| 597 | char *zSavePath = mprintf("%s", zPath); |
| 598 | int count = vfile_dir_scan(pPath, nPrefix, scanFlags, pIgnore1, |
| 599 | pIgnore2, pIgnore3); |
| 600 | db_bind_text(&ins, ":file", &zSavePath[nPrefix+1]); |
| 601 | db_bind_int(&ins, ":count", count); |
| 602 | db_step(&ins); |
| 603 | db_reset(&ins); |
| 604 | fossil_free(zSavePath); |
| 605 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -529,12 +529,11 @@ | |
| 529 | int vfile_dir_scan( |
| 530 | Blob *pPath, /* Base directory to be scanned */ |
| 531 | int nPrefix, /* Number of bytes in base directory name */ |
| 532 | unsigned scanFlags, /* Zero or more SCAN_xxx flags */ |
| 533 | Glob *pIgnore1, /* Do not add directories that match this GLOB */ |
| 534 | Glob *pIgnore2 /* Omit directories matching this GLOB too */ |
| 535 | ){ |
| 536 | int result = 0; |
| 537 | DIR *d; |
| 538 | int origSize; |
| 539 | struct dirent *pEntry; |
| @@ -543,15 +542,14 @@ | |
| 542 | static Stmt upd; |
| 543 | static int depth = 0; |
| 544 | void *zNative; |
| 545 | |
| 546 | origSize = blob_size(pPath); |
| 547 | if( pIgnore1 || pIgnore2 ){ |
| 548 | blob_appendf(pPath, "/"); |
| 549 | if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 550 | if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 551 | blob_resize(pPath, origSize); |
| 552 | } |
| 553 | if( skipAll ) return result; |
| 554 | |
| 555 | if( depth==0 ){ |
| @@ -587,18 +585,17 @@ | |
| 585 | zOrigPath = mprintf("%s", blob_str(pPath)); |
| 586 | zUtf8 = fossil_filename_to_utf8(pEntry->d_name); |
| 587 | blob_appendf(pPath, "/%s", zUtf8); |
| 588 | zPath = blob_str(pPath); |
| 589 | if( glob_match(pIgnore1, &zPath[nPrefix+1]) || |
| 590 | glob_match(pIgnore2, &zPath[nPrefix+1]) ){ |
| 591 | /* do nothing */ |
| 592 | }else if( file_wd_isdir(zPath)==1 ){ |
| 593 | if( (scanFlags & SCAN_NESTED) || !vfile_top_of_checkout(zPath) ){ |
| 594 | char *zSavePath = mprintf("%s", zPath); |
| 595 | int count = vfile_dir_scan(pPath, nPrefix, scanFlags, pIgnore1, |
| 596 | pIgnore2); |
| 597 | db_bind_text(&ins, ":file", &zSavePath[nPrefix+1]); |
| 598 | db_bind_int(&ins, ":count", count); |
| 599 | db_step(&ins); |
| 600 | db_reset(&ins); |
| 601 | fossil_free(zSavePath); |
| 602 |
+4
-7
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -529,12 +529,11 @@ | ||
| 529 | 529 | int vfile_dir_scan( |
| 530 | 530 | Blob *pPath, /* Base directory to be scanned */ |
| 531 | 531 | int nPrefix, /* Number of bytes in base directory name */ |
| 532 | 532 | unsigned scanFlags, /* Zero or more SCAN_xxx flags */ |
| 533 | 533 | Glob *pIgnore1, /* Do not add directories that match this GLOB */ |
| 534 | - Glob *pIgnore2, /* Omit directories matching this GLOB too */ | |
| 535 | - Glob *pIgnore3 /* Omit directories matching this GLOB too */ | |
| 534 | + Glob *pIgnore2 /* Omit directories matching this GLOB too */ | |
| 536 | 535 | ){ |
| 537 | 536 | int result = 0; |
| 538 | 537 | DIR *d; |
| 539 | 538 | int origSize; |
| 540 | 539 | struct dirent *pEntry; |
| @@ -543,15 +542,14 @@ | ||
| 543 | 542 | static Stmt upd; |
| 544 | 543 | static int depth = 0; |
| 545 | 544 | void *zNative; |
| 546 | 545 | |
| 547 | 546 | origSize = blob_size(pPath); |
| 548 | - if( pIgnore1 || pIgnore2 || pIgnore3 ){ | |
| 547 | + if( pIgnore1 || pIgnore2 ){ | |
| 549 | 548 | blob_appendf(pPath, "/"); |
| 550 | 549 | if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 551 | 550 | if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 552 | - if( glob_match(pIgnore3, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; | |
| 553 | 551 | blob_resize(pPath, origSize); |
| 554 | 552 | } |
| 555 | 553 | if( skipAll ) return result; |
| 556 | 554 | |
| 557 | 555 | if( depth==0 ){ |
| @@ -587,18 +585,17 @@ | ||
| 587 | 585 | zOrigPath = mprintf("%s", blob_str(pPath)); |
| 588 | 586 | zUtf8 = fossil_filename_to_utf8(pEntry->d_name); |
| 589 | 587 | blob_appendf(pPath, "/%s", zUtf8); |
| 590 | 588 | zPath = blob_str(pPath); |
| 591 | 589 | if( glob_match(pIgnore1, &zPath[nPrefix+1]) || |
| 592 | - glob_match(pIgnore2, &zPath[nPrefix+1]) || | |
| 593 | - glob_match(pIgnore3, &zPath[nPrefix+1]) ){ | |
| 590 | + glob_match(pIgnore2, &zPath[nPrefix+1]) ){ | |
| 594 | 591 | /* do nothing */ |
| 595 | 592 | }else if( file_wd_isdir(zPath)==1 ){ |
| 596 | 593 | if( (scanFlags & SCAN_NESTED) || !vfile_top_of_checkout(zPath) ){ |
| 597 | 594 | char *zSavePath = mprintf("%s", zPath); |
| 598 | 595 | int count = vfile_dir_scan(pPath, nPrefix, scanFlags, pIgnore1, |
| 599 | - pIgnore2, pIgnore3); | |
| 596 | + pIgnore2); | |
| 600 | 597 | db_bind_text(&ins, ":file", &zSavePath[nPrefix+1]); |
| 601 | 598 | db_bind_int(&ins, ":count", count); |
| 602 | 599 | db_step(&ins); |
| 603 | 600 | db_reset(&ins); |
| 604 | 601 | fossil_free(zSavePath); |
| 605 | 602 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -529,12 +529,11 @@ | |
| 529 | int vfile_dir_scan( |
| 530 | Blob *pPath, /* Base directory to be scanned */ |
| 531 | int nPrefix, /* Number of bytes in base directory name */ |
| 532 | unsigned scanFlags, /* Zero or more SCAN_xxx flags */ |
| 533 | Glob *pIgnore1, /* Do not add directories that match this GLOB */ |
| 534 | Glob *pIgnore2, /* Omit directories matching this GLOB too */ |
| 535 | Glob *pIgnore3 /* Omit directories matching this GLOB too */ |
| 536 | ){ |
| 537 | int result = 0; |
| 538 | DIR *d; |
| 539 | int origSize; |
| 540 | struct dirent *pEntry; |
| @@ -543,15 +542,14 @@ | |
| 543 | static Stmt upd; |
| 544 | static int depth = 0; |
| 545 | void *zNative; |
| 546 | |
| 547 | origSize = blob_size(pPath); |
| 548 | if( pIgnore1 || pIgnore2 || pIgnore3 ){ |
| 549 | blob_appendf(pPath, "/"); |
| 550 | if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 551 | if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 552 | if( glob_match(pIgnore3, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 553 | blob_resize(pPath, origSize); |
| 554 | } |
| 555 | if( skipAll ) return result; |
| 556 | |
| 557 | if( depth==0 ){ |
| @@ -587,18 +585,17 @@ | |
| 587 | zOrigPath = mprintf("%s", blob_str(pPath)); |
| 588 | zUtf8 = fossil_filename_to_utf8(pEntry->d_name); |
| 589 | blob_appendf(pPath, "/%s", zUtf8); |
| 590 | zPath = blob_str(pPath); |
| 591 | if( glob_match(pIgnore1, &zPath[nPrefix+1]) || |
| 592 | glob_match(pIgnore2, &zPath[nPrefix+1]) || |
| 593 | glob_match(pIgnore3, &zPath[nPrefix+1]) ){ |
| 594 | /* do nothing */ |
| 595 | }else if( file_wd_isdir(zPath)==1 ){ |
| 596 | if( (scanFlags & SCAN_NESTED) || !vfile_top_of_checkout(zPath) ){ |
| 597 | char *zSavePath = mprintf("%s", zPath); |
| 598 | int count = vfile_dir_scan(pPath, nPrefix, scanFlags, pIgnore1, |
| 599 | pIgnore2, pIgnore3); |
| 600 | db_bind_text(&ins, ":file", &zSavePath[nPrefix+1]); |
| 601 | db_bind_int(&ins, ":count", count); |
| 602 | db_step(&ins); |
| 603 | db_reset(&ins); |
| 604 | fossil_free(zSavePath); |
| 605 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -529,12 +529,11 @@ | |
| 529 | int vfile_dir_scan( |
| 530 | Blob *pPath, /* Base directory to be scanned */ |
| 531 | int nPrefix, /* Number of bytes in base directory name */ |
| 532 | unsigned scanFlags, /* Zero or more SCAN_xxx flags */ |
| 533 | Glob *pIgnore1, /* Do not add directories that match this GLOB */ |
| 534 | Glob *pIgnore2 /* Omit directories matching this GLOB too */ |
| 535 | ){ |
| 536 | int result = 0; |
| 537 | DIR *d; |
| 538 | int origSize; |
| 539 | struct dirent *pEntry; |
| @@ -543,15 +542,14 @@ | |
| 542 | static Stmt upd; |
| 543 | static int depth = 0; |
| 544 | void *zNative; |
| 545 | |
| 546 | origSize = blob_size(pPath); |
| 547 | if( pIgnore1 || pIgnore2 ){ |
| 548 | blob_appendf(pPath, "/"); |
| 549 | if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 550 | if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 551 | blob_resize(pPath, origSize); |
| 552 | } |
| 553 | if( skipAll ) return result; |
| 554 | |
| 555 | if( depth==0 ){ |
| @@ -587,18 +585,17 @@ | |
| 585 | zOrigPath = mprintf("%s", blob_str(pPath)); |
| 586 | zUtf8 = fossil_filename_to_utf8(pEntry->d_name); |
| 587 | blob_appendf(pPath, "/%s", zUtf8); |
| 588 | zPath = blob_str(pPath); |
| 589 | if( glob_match(pIgnore1, &zPath[nPrefix+1]) || |
| 590 | glob_match(pIgnore2, &zPath[nPrefix+1]) ){ |
| 591 | /* do nothing */ |
| 592 | }else if( file_wd_isdir(zPath)==1 ){ |
| 593 | if( (scanFlags & SCAN_NESTED) || !vfile_top_of_checkout(zPath) ){ |
| 594 | char *zSavePath = mprintf("%s", zPath); |
| 595 | int count = vfile_dir_scan(pPath, nPrefix, scanFlags, pIgnore1, |
| 596 | pIgnore2); |
| 597 | db_bind_text(&ins, ":file", &zSavePath[nPrefix+1]); |
| 598 | db_bind_int(&ins, ":count", count); |
| 599 | db_step(&ins); |
| 600 | db_reset(&ins); |
| 601 | fossil_free(zSavePath); |
| 602 |