Fossil SCM
Merge trunk. Make fossil clean undoable only when -x|--verily is not specified. And cleaning files matching ignore-glob will never be undoable.
Commit
134d8e1189d39650bda08a565c1cc629f98dec67
Parent
f3daf393555b488…
3 files changed
+1
-1
+12
-10
+12
-10
+1
-1
| --- Dockerfile | ||
| +++ Dockerfile | ||
| @@ -10,11 +10,11 @@ | ||
| 10 | 10 | ENV FOSSIL_INSTALL_VERSION trunk |
| 11 | 11 | |
| 12 | 12 | RUN curl "http://core.tcl.tk/tcl/tarball/tcl-src.tar.gz?name=tcl-src&uuid=release" | tar zx |
| 13 | 13 | RUN cd tcl-src/unix && ./configure --prefix=/usr --disable-shared --disable-threads --disable-load && make && make install |
| 14 | 14 | RUN curl "http://www.fossil-scm.org/index.html/tarball/fossil-src.tar.gz?name=fossil-src&uuid=${FOSSIL_INSTALL_VERSION}" | tar zx |
| 15 | -RUN cd fossil-src && ./configure --disable-lineedit --disable-fusefs --json --with-th1-docs --with-th1-hooks --with-tcl | |
| 15 | +RUN cd fossil-src && ./configure --disable-fusefs --json --with-th1-docs --with-th1-hooks --with-tcl | |
| 16 | 16 | RUN cd fossil-src && make && strip fossil && cp fossil /usr/bin && cd .. && rm -rf fossil-src && chmod a+rx /usr/bin/fossil && mkdir -p /opt/fossil && chown fossil:fossil /opt/fossil |
| 17 | 17 | |
| 18 | 18 | ### Build is done, remove modules no longer needed |
| 19 | 19 | RUN yum remove -y gcc make zlib-devel openssl-devel tar && yum clean all |
| 20 | 20 | |
| 21 | 21 |
| --- Dockerfile | |
| +++ Dockerfile | |
| @@ -10,11 +10,11 @@ | |
| 10 | ENV FOSSIL_INSTALL_VERSION trunk |
| 11 | |
| 12 | RUN curl "http://core.tcl.tk/tcl/tarball/tcl-src.tar.gz?name=tcl-src&uuid=release" | tar zx |
| 13 | RUN cd tcl-src/unix && ./configure --prefix=/usr --disable-shared --disable-threads --disable-load && make && make install |
| 14 | RUN curl "http://www.fossil-scm.org/index.html/tarball/fossil-src.tar.gz?name=fossil-src&uuid=${FOSSIL_INSTALL_VERSION}" | tar zx |
| 15 | RUN cd fossil-src && ./configure --disable-lineedit --disable-fusefs --json --with-th1-docs --with-th1-hooks --with-tcl |
| 16 | RUN cd fossil-src && make && strip fossil && cp fossil /usr/bin && cd .. && rm -rf fossil-src && chmod a+rx /usr/bin/fossil && mkdir -p /opt/fossil && chown fossil:fossil /opt/fossil |
| 17 | |
| 18 | ### Build is done, remove modules no longer needed |
| 19 | RUN yum remove -y gcc make zlib-devel openssl-devel tar && yum clean all |
| 20 | |
| 21 |
| --- Dockerfile | |
| +++ Dockerfile | |
| @@ -10,11 +10,11 @@ | |
| 10 | ENV FOSSIL_INSTALL_VERSION trunk |
| 11 | |
| 12 | RUN curl "http://core.tcl.tk/tcl/tarball/tcl-src.tar.gz?name=tcl-src&uuid=release" | tar zx |
| 13 | RUN cd tcl-src/unix && ./configure --prefix=/usr --disable-shared --disable-threads --disable-load && make && make install |
| 14 | RUN curl "http://www.fossil-scm.org/index.html/tarball/fossil-src.tar.gz?name=fossil-src&uuid=${FOSSIL_INSTALL_VERSION}" | tar zx |
| 15 | RUN cd fossil-src && ./configure --disable-fusefs --json --with-th1-docs --with-th1-hooks --with-tcl |
| 16 | RUN cd fossil-src && make && strip fossil && cp fossil /usr/bin && cd .. && rm -rf fossil-src && chmod a+rx /usr/bin/fossil && mkdir -p /opt/fossil && chown fossil:fossil /opt/fossil |
| 17 | |
| 18 | ### Build is done, remove modules no longer needed |
| 19 | RUN yum remove -y gcc make zlib-devel openssl-devel tar && yum clean all |
| 20 | |
| 21 |
+12
-10
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -668,15 +668,15 @@ | ||
| 668 | 668 | ** or another applicable setting or command line |
| 669 | 669 | ** argument. Matching files, if any, are removed |
| 670 | 670 | ** prior to checking for any empty directories; |
| 671 | 671 | ** therefore, directories that contain only files |
| 672 | 672 | ** that were removed will be removed as well. |
| 673 | -** -f|--force Remove files without prompting. The clean | |
| 674 | -** will be faster but not undo-able any more. | |
| 673 | +** -f|--force Remove files without prompting. | |
| 675 | 674 | ** -x|--verily Remove everything that is not a managed file or |
| 676 | 675 | ** the repository itself. Implies -f --emptydirs |
| 677 | 676 | ** --dotfiles. Disregard keep-glob and ignore-glob. |
| 677 | +** The clean will be faster but not undo-able any more. | |
| 678 | 678 | ** --clean <CSG> Never prompt for files matching this |
| 679 | 679 | ** comma separated list of glob patterns. |
| 680 | 680 | ** --ignore <CSG> Ignore files matching patterns from the |
| 681 | 681 | ** comma separated list of glob patterns. |
| 682 | 682 | ** --keep <CSG> Keep files matching this comma separated |
| @@ -694,13 +694,10 @@ | ||
| 694 | 694 | unsigned scanFlags = 0; |
| 695 | 695 | int verilyFlag = 0; |
| 696 | 696 | const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; |
| 697 | 697 | Glob *pIgnore, *pKeep, *pClean; |
| 698 | 698 | int nRoot; |
| 699 | - char cReply; | |
| 700 | - Blob ans; | |
| 701 | - char *prompt; | |
| 702 | 699 | |
| 703 | 700 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 704 | 701 | if( !dryRunFlag ){ |
| 705 | 702 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 706 | 703 | } |
| @@ -725,11 +722,11 @@ | ||
| 725 | 722 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 726 | 723 | emptyDirsFlag = 1; |
| 727 | 724 | scanFlags |= SCAN_ALL; |
| 728 | 725 | zCleanFlag = 0; |
| 729 | 726 | } |
| 730 | - if( zIgnoreFlag==0 && !verilyFlag ){ | |
| 727 | + if( zIgnoreFlag==0 ){ | |
| 731 | 728 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 732 | 729 | } |
| 733 | 730 | if( zKeepFlag==0 && !verilyFlag ){ |
| 734 | 731 | zKeepFlag = db_get("keep-glob", 0); |
| 735 | 732 | } |
| @@ -745,11 +742,15 @@ | ||
| 745 | 742 | g.allowSymlinks = 1; /* Find symlinks too */ |
| 746 | 743 | if( !forceFlag && !dryRunFlag ) undo_begin(); |
| 747 | 744 | if( !dirsOnlyFlag ){ |
| 748 | 745 | Stmt q; |
| 749 | 746 | Blob repo; |
| 750 | - locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0); | |
| 747 | + char cReply; | |
| 748 | + Blob ans; | |
| 749 | + char *prompt; | |
| 750 | + | |
| 751 | + locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, verilyFlag ? 0 : pIgnore, 0); | |
| 751 | 752 | db_prepare(&q, |
| 752 | 753 | "SELECT %Q || x FROM sfile" |
| 753 | 754 | " WHERE x NOT IN (%s)" |
| 754 | 755 | " ORDER BY 1", |
| 755 | 756 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -778,11 +779,12 @@ | ||
| 778 | 779 | blob_reset(&ans); |
| 779 | 780 | continue; |
| 780 | 781 | } |
| 781 | 782 | blob_reset(&ans); |
| 782 | 783 | } |
| 783 | - if( !dryRunFlag && undo_save(zName+nRoot, 10*1024*1024) ){ | |
| 784 | + if( !dryRunFlag && !verilyFlag && !glob_match(pIgnore, zName+nRoot) | |
| 785 | + && undo_save(zName+nRoot, 10*1024*1024) ){ | |
| 784 | 786 | prompt = mprintf("file \"%s\" too big. Deletion will not be " |
| 785 | 787 | "undo-able. Continue (y/N)? ", zName+nRoot); |
| 786 | 788 | blob_zero(&ans); |
| 787 | 789 | prompt_user(prompt, &ans); |
| 788 | 790 | cReply = blob_str(&ans)[0]; |
| @@ -804,12 +806,12 @@ | ||
| 804 | 806 | if( emptyDirsFlag ){ |
| 805 | 807 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 806 | 808 | Stmt q; |
| 807 | 809 | Blob root; |
| 808 | 810 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 809 | - vfile_dir_scan(&root, blob_size(&root), scanFlags, pIgnore, | |
| 810 | - pEmptyDirs); | |
| 811 | + vfile_dir_scan(&root, blob_size(&root), scanFlags, | |
| 812 | + verilyFlag ? 0 : pIgnore, pEmptyDirs); | |
| 811 | 813 | blob_reset(&root); |
| 812 | 814 | db_prepare(&q, |
| 813 | 815 | "SELECT %Q || x FROM dscan_temp" |
| 814 | 816 | " WHERE x NOT IN (%s) AND y = 0" |
| 815 | 817 | " ORDER BY 1 DESC", |
| 816 | 818 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -668,15 +668,15 @@ | |
| 668 | ** or another applicable setting or command line |
| 669 | ** argument. Matching files, if any, are removed |
| 670 | ** prior to checking for any empty directories; |
| 671 | ** therefore, directories that contain only files |
| 672 | ** that were removed will be removed as well. |
| 673 | ** -f|--force Remove files without prompting. The clean |
| 674 | ** will be faster but not undo-able any more. |
| 675 | ** -x|--verily Remove everything that is not a managed file or |
| 676 | ** the repository itself. Implies -f --emptydirs |
| 677 | ** --dotfiles. Disregard keep-glob and ignore-glob. |
| 678 | ** --clean <CSG> Never prompt for files matching this |
| 679 | ** comma separated list of glob patterns. |
| 680 | ** --ignore <CSG> Ignore files matching patterns from the |
| 681 | ** comma separated list of glob patterns. |
| 682 | ** --keep <CSG> Keep files matching this comma separated |
| @@ -694,13 +694,10 @@ | |
| 694 | unsigned scanFlags = 0; |
| 695 | int verilyFlag = 0; |
| 696 | const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; |
| 697 | Glob *pIgnore, *pKeep, *pClean; |
| 698 | int nRoot; |
| 699 | char cReply; |
| 700 | Blob ans; |
| 701 | char *prompt; |
| 702 | |
| 703 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 704 | if( !dryRunFlag ){ |
| 705 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 706 | } |
| @@ -725,11 +722,11 @@ | |
| 725 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 726 | emptyDirsFlag = 1; |
| 727 | scanFlags |= SCAN_ALL; |
| 728 | zCleanFlag = 0; |
| 729 | } |
| 730 | if( zIgnoreFlag==0 && !verilyFlag ){ |
| 731 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 732 | } |
| 733 | if( zKeepFlag==0 && !verilyFlag ){ |
| 734 | zKeepFlag = db_get("keep-glob", 0); |
| 735 | } |
| @@ -745,11 +742,15 @@ | |
| 745 | g.allowSymlinks = 1; /* Find symlinks too */ |
| 746 | if( !forceFlag && !dryRunFlag ) undo_begin(); |
| 747 | if( !dirsOnlyFlag ){ |
| 748 | Stmt q; |
| 749 | Blob repo; |
| 750 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0); |
| 751 | db_prepare(&q, |
| 752 | "SELECT %Q || x FROM sfile" |
| 753 | " WHERE x NOT IN (%s)" |
| 754 | " ORDER BY 1", |
| 755 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -778,11 +779,12 @@ | |
| 778 | blob_reset(&ans); |
| 779 | continue; |
| 780 | } |
| 781 | blob_reset(&ans); |
| 782 | } |
| 783 | if( !dryRunFlag && undo_save(zName+nRoot, 10*1024*1024) ){ |
| 784 | prompt = mprintf("file \"%s\" too big. Deletion will not be " |
| 785 | "undo-able. Continue (y/N)? ", zName+nRoot); |
| 786 | blob_zero(&ans); |
| 787 | prompt_user(prompt, &ans); |
| 788 | cReply = blob_str(&ans)[0]; |
| @@ -804,12 +806,12 @@ | |
| 804 | if( emptyDirsFlag ){ |
| 805 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 806 | Stmt q; |
| 807 | Blob root; |
| 808 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 809 | vfile_dir_scan(&root, blob_size(&root), scanFlags, pIgnore, |
| 810 | pEmptyDirs); |
| 811 | blob_reset(&root); |
| 812 | db_prepare(&q, |
| 813 | "SELECT %Q || x FROM dscan_temp" |
| 814 | " WHERE x NOT IN (%s) AND y = 0" |
| 815 | " ORDER BY 1 DESC", |
| 816 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -668,15 +668,15 @@ | |
| 668 | ** or another applicable setting or command line |
| 669 | ** argument. Matching files, if any, are removed |
| 670 | ** prior to checking for any empty directories; |
| 671 | ** therefore, directories that contain only files |
| 672 | ** that were removed will be removed as well. |
| 673 | ** -f|--force Remove files without prompting. |
| 674 | ** -x|--verily Remove everything that is not a managed file or |
| 675 | ** the repository itself. Implies -f --emptydirs |
| 676 | ** --dotfiles. Disregard keep-glob and ignore-glob. |
| 677 | ** The clean will be faster but not undo-able any more. |
| 678 | ** --clean <CSG> Never prompt for files matching this |
| 679 | ** comma separated list of glob patterns. |
| 680 | ** --ignore <CSG> Ignore files matching patterns from the |
| 681 | ** comma separated list of glob patterns. |
| 682 | ** --keep <CSG> Keep files matching this comma separated |
| @@ -694,13 +694,10 @@ | |
| 694 | unsigned scanFlags = 0; |
| 695 | int verilyFlag = 0; |
| 696 | const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; |
| 697 | Glob *pIgnore, *pKeep, *pClean; |
| 698 | int nRoot; |
| 699 | |
| 700 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 701 | if( !dryRunFlag ){ |
| 702 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 703 | } |
| @@ -725,11 +722,11 @@ | |
| 722 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 723 | emptyDirsFlag = 1; |
| 724 | scanFlags |= SCAN_ALL; |
| 725 | zCleanFlag = 0; |
| 726 | } |
| 727 | if( zIgnoreFlag==0 ){ |
| 728 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 729 | } |
| 730 | if( zKeepFlag==0 && !verilyFlag ){ |
| 731 | zKeepFlag = db_get("keep-glob", 0); |
| 732 | } |
| @@ -745,11 +742,15 @@ | |
| 742 | g.allowSymlinks = 1; /* Find symlinks too */ |
| 743 | if( !forceFlag && !dryRunFlag ) undo_begin(); |
| 744 | if( !dirsOnlyFlag ){ |
| 745 | Stmt q; |
| 746 | Blob repo; |
| 747 | char cReply; |
| 748 | Blob ans; |
| 749 | char *prompt; |
| 750 | |
| 751 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, verilyFlag ? 0 : pIgnore, 0); |
| 752 | db_prepare(&q, |
| 753 | "SELECT %Q || x FROM sfile" |
| 754 | " WHERE x NOT IN (%s)" |
| 755 | " ORDER BY 1", |
| 756 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -778,11 +779,12 @@ | |
| 779 | blob_reset(&ans); |
| 780 | continue; |
| 781 | } |
| 782 | blob_reset(&ans); |
| 783 | } |
| 784 | if( !dryRunFlag && !verilyFlag && !glob_match(pIgnore, zName+nRoot) |
| 785 | && undo_save(zName+nRoot, 10*1024*1024) ){ |
| 786 | prompt = mprintf("file \"%s\" too big. Deletion will not be " |
| 787 | "undo-able. Continue (y/N)? ", zName+nRoot); |
| 788 | blob_zero(&ans); |
| 789 | prompt_user(prompt, &ans); |
| 790 | cReply = blob_str(&ans)[0]; |
| @@ -804,12 +806,12 @@ | |
| 806 | if( emptyDirsFlag ){ |
| 807 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 808 | Stmt q; |
| 809 | Blob root; |
| 810 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 811 | vfile_dir_scan(&root, blob_size(&root), scanFlags, |
| 812 | verilyFlag ? 0 : pIgnore, pEmptyDirs); |
| 813 | blob_reset(&root); |
| 814 | db_prepare(&q, |
| 815 | "SELECT %Q || x FROM dscan_temp" |
| 816 | " WHERE x NOT IN (%s) AND y = 0" |
| 817 | " ORDER BY 1 DESC", |
| 818 |
+12
-10
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -668,15 +668,15 @@ | ||
| 668 | 668 | ** or another applicable setting or command line |
| 669 | 669 | ** argument. Matching files, if any, are removed |
| 670 | 670 | ** prior to checking for any empty directories; |
| 671 | 671 | ** therefore, directories that contain only files |
| 672 | 672 | ** that were removed will be removed as well. |
| 673 | -** -f|--force Remove files without prompting. The clean | |
| 674 | -** will be faster but not undo-able any more. | |
| 673 | +** -f|--force Remove files without prompting. | |
| 675 | 674 | ** -x|--verily Remove everything that is not a managed file or |
| 676 | 675 | ** the repository itself. Implies -f --emptydirs |
| 677 | 676 | ** --dotfiles. Disregard keep-glob and ignore-glob. |
| 677 | +** The clean will be faster but not undo-able any more. | |
| 678 | 678 | ** --clean <CSG> Never prompt for files matching this |
| 679 | 679 | ** comma separated list of glob patterns. |
| 680 | 680 | ** --ignore <CSG> Ignore files matching patterns from the |
| 681 | 681 | ** comma separated list of glob patterns. |
| 682 | 682 | ** --keep <CSG> Keep files matching this comma separated |
| @@ -694,13 +694,10 @@ | ||
| 694 | 694 | unsigned scanFlags = 0; |
| 695 | 695 | int verilyFlag = 0; |
| 696 | 696 | const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; |
| 697 | 697 | Glob *pIgnore, *pKeep, *pClean; |
| 698 | 698 | int nRoot; |
| 699 | - char cReply; | |
| 700 | - Blob ans; | |
| 701 | - char *prompt; | |
| 702 | 699 | |
| 703 | 700 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 704 | 701 | if( !dryRunFlag ){ |
| 705 | 702 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 706 | 703 | } |
| @@ -725,11 +722,11 @@ | ||
| 725 | 722 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 726 | 723 | emptyDirsFlag = 1; |
| 727 | 724 | scanFlags |= SCAN_ALL; |
| 728 | 725 | zCleanFlag = 0; |
| 729 | 726 | } |
| 730 | - if( zIgnoreFlag==0 && !verilyFlag ){ | |
| 727 | + if( zIgnoreFlag==0 ){ | |
| 731 | 728 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 732 | 729 | } |
| 733 | 730 | if( zKeepFlag==0 && !verilyFlag ){ |
| 734 | 731 | zKeepFlag = db_get("keep-glob", 0); |
| 735 | 732 | } |
| @@ -745,11 +742,15 @@ | ||
| 745 | 742 | g.allowSymlinks = 1; /* Find symlinks too */ |
| 746 | 743 | if( !forceFlag && !dryRunFlag ) undo_begin(); |
| 747 | 744 | if( !dirsOnlyFlag ){ |
| 748 | 745 | Stmt q; |
| 749 | 746 | Blob repo; |
| 750 | - locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0); | |
| 747 | + char cReply; | |
| 748 | + Blob ans; | |
| 749 | + char *prompt; | |
| 750 | + | |
| 751 | + locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, verilyFlag ? 0 : pIgnore, 0); | |
| 751 | 752 | db_prepare(&q, |
| 752 | 753 | "SELECT %Q || x FROM sfile" |
| 753 | 754 | " WHERE x NOT IN (%s)" |
| 754 | 755 | " ORDER BY 1", |
| 755 | 756 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -778,11 +779,12 @@ | ||
| 778 | 779 | blob_reset(&ans); |
| 779 | 780 | continue; |
| 780 | 781 | } |
| 781 | 782 | blob_reset(&ans); |
| 782 | 783 | } |
| 783 | - if( !dryRunFlag && undo_save(zName+nRoot, 10*1024*1024) ){ | |
| 784 | + if( !dryRunFlag && !verilyFlag && !glob_match(pIgnore, zName+nRoot) | |
| 785 | + && undo_save(zName+nRoot, 10*1024*1024) ){ | |
| 784 | 786 | prompt = mprintf("file \"%s\" too big. Deletion will not be " |
| 785 | 787 | "undo-able. Continue (y/N)? ", zName+nRoot); |
| 786 | 788 | blob_zero(&ans); |
| 787 | 789 | prompt_user(prompt, &ans); |
| 788 | 790 | cReply = blob_str(&ans)[0]; |
| @@ -804,12 +806,12 @@ | ||
| 804 | 806 | if( emptyDirsFlag ){ |
| 805 | 807 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 806 | 808 | Stmt q; |
| 807 | 809 | Blob root; |
| 808 | 810 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 809 | - vfile_dir_scan(&root, blob_size(&root), scanFlags, pIgnore, | |
| 810 | - pEmptyDirs); | |
| 811 | + vfile_dir_scan(&root, blob_size(&root), scanFlags, | |
| 812 | + verilyFlag ? 0 : pIgnore, pEmptyDirs); | |
| 811 | 813 | blob_reset(&root); |
| 812 | 814 | db_prepare(&q, |
| 813 | 815 | "SELECT %Q || x FROM dscan_temp" |
| 814 | 816 | " WHERE x NOT IN (%s) AND y = 0" |
| 815 | 817 | " ORDER BY 1 DESC", |
| 816 | 818 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -668,15 +668,15 @@ | |
| 668 | ** or another applicable setting or command line |
| 669 | ** argument. Matching files, if any, are removed |
| 670 | ** prior to checking for any empty directories; |
| 671 | ** therefore, directories that contain only files |
| 672 | ** that were removed will be removed as well. |
| 673 | ** -f|--force Remove files without prompting. The clean |
| 674 | ** will be faster but not undo-able any more. |
| 675 | ** -x|--verily Remove everything that is not a managed file or |
| 676 | ** the repository itself. Implies -f --emptydirs |
| 677 | ** --dotfiles. Disregard keep-glob and ignore-glob. |
| 678 | ** --clean <CSG> Never prompt for files matching this |
| 679 | ** comma separated list of glob patterns. |
| 680 | ** --ignore <CSG> Ignore files matching patterns from the |
| 681 | ** comma separated list of glob patterns. |
| 682 | ** --keep <CSG> Keep files matching this comma separated |
| @@ -694,13 +694,10 @@ | |
| 694 | unsigned scanFlags = 0; |
| 695 | int verilyFlag = 0; |
| 696 | const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; |
| 697 | Glob *pIgnore, *pKeep, *pClean; |
| 698 | int nRoot; |
| 699 | char cReply; |
| 700 | Blob ans; |
| 701 | char *prompt; |
| 702 | |
| 703 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 704 | if( !dryRunFlag ){ |
| 705 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 706 | } |
| @@ -725,11 +722,11 @@ | |
| 725 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 726 | emptyDirsFlag = 1; |
| 727 | scanFlags |= SCAN_ALL; |
| 728 | zCleanFlag = 0; |
| 729 | } |
| 730 | if( zIgnoreFlag==0 && !verilyFlag ){ |
| 731 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 732 | } |
| 733 | if( zKeepFlag==0 && !verilyFlag ){ |
| 734 | zKeepFlag = db_get("keep-glob", 0); |
| 735 | } |
| @@ -745,11 +742,15 @@ | |
| 745 | g.allowSymlinks = 1; /* Find symlinks too */ |
| 746 | if( !forceFlag && !dryRunFlag ) undo_begin(); |
| 747 | if( !dirsOnlyFlag ){ |
| 748 | Stmt q; |
| 749 | Blob repo; |
| 750 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0); |
| 751 | db_prepare(&q, |
| 752 | "SELECT %Q || x FROM sfile" |
| 753 | " WHERE x NOT IN (%s)" |
| 754 | " ORDER BY 1", |
| 755 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -778,11 +779,12 @@ | |
| 778 | blob_reset(&ans); |
| 779 | continue; |
| 780 | } |
| 781 | blob_reset(&ans); |
| 782 | } |
| 783 | if( !dryRunFlag && undo_save(zName+nRoot, 10*1024*1024) ){ |
| 784 | prompt = mprintf("file \"%s\" too big. Deletion will not be " |
| 785 | "undo-able. Continue (y/N)? ", zName+nRoot); |
| 786 | blob_zero(&ans); |
| 787 | prompt_user(prompt, &ans); |
| 788 | cReply = blob_str(&ans)[0]; |
| @@ -804,12 +806,12 @@ | |
| 804 | if( emptyDirsFlag ){ |
| 805 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 806 | Stmt q; |
| 807 | Blob root; |
| 808 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 809 | vfile_dir_scan(&root, blob_size(&root), scanFlags, pIgnore, |
| 810 | pEmptyDirs); |
| 811 | blob_reset(&root); |
| 812 | db_prepare(&q, |
| 813 | "SELECT %Q || x FROM dscan_temp" |
| 814 | " WHERE x NOT IN (%s) AND y = 0" |
| 815 | " ORDER BY 1 DESC", |
| 816 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -668,15 +668,15 @@ | |
| 668 | ** or another applicable setting or command line |
| 669 | ** argument. Matching files, if any, are removed |
| 670 | ** prior to checking for any empty directories; |
| 671 | ** therefore, directories that contain only files |
| 672 | ** that were removed will be removed as well. |
| 673 | ** -f|--force Remove files without prompting. |
| 674 | ** -x|--verily Remove everything that is not a managed file or |
| 675 | ** the repository itself. Implies -f --emptydirs |
| 676 | ** --dotfiles. Disregard keep-glob and ignore-glob. |
| 677 | ** The clean will be faster but not undo-able any more. |
| 678 | ** --clean <CSG> Never prompt for files matching this |
| 679 | ** comma separated list of glob patterns. |
| 680 | ** --ignore <CSG> Ignore files matching patterns from the |
| 681 | ** comma separated list of glob patterns. |
| 682 | ** --keep <CSG> Keep files matching this comma separated |
| @@ -694,13 +694,10 @@ | |
| 694 | unsigned scanFlags = 0; |
| 695 | int verilyFlag = 0; |
| 696 | const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; |
| 697 | Glob *pIgnore, *pKeep, *pClean; |
| 698 | int nRoot; |
| 699 | |
| 700 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 701 | if( !dryRunFlag ){ |
| 702 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 703 | } |
| @@ -725,11 +722,11 @@ | |
| 722 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 723 | emptyDirsFlag = 1; |
| 724 | scanFlags |= SCAN_ALL; |
| 725 | zCleanFlag = 0; |
| 726 | } |
| 727 | if( zIgnoreFlag==0 ){ |
| 728 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 729 | } |
| 730 | if( zKeepFlag==0 && !verilyFlag ){ |
| 731 | zKeepFlag = db_get("keep-glob", 0); |
| 732 | } |
| @@ -745,11 +742,15 @@ | |
| 742 | g.allowSymlinks = 1; /* Find symlinks too */ |
| 743 | if( !forceFlag && !dryRunFlag ) undo_begin(); |
| 744 | if( !dirsOnlyFlag ){ |
| 745 | Stmt q; |
| 746 | Blob repo; |
| 747 | char cReply; |
| 748 | Blob ans; |
| 749 | char *prompt; |
| 750 | |
| 751 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, verilyFlag ? 0 : pIgnore, 0); |
| 752 | db_prepare(&q, |
| 753 | "SELECT %Q || x FROM sfile" |
| 754 | " WHERE x NOT IN (%s)" |
| 755 | " ORDER BY 1", |
| 756 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -778,11 +779,12 @@ | |
| 779 | blob_reset(&ans); |
| 780 | continue; |
| 781 | } |
| 782 | blob_reset(&ans); |
| 783 | } |
| 784 | if( !dryRunFlag && !verilyFlag && !glob_match(pIgnore, zName+nRoot) |
| 785 | && undo_save(zName+nRoot, 10*1024*1024) ){ |
| 786 | prompt = mprintf("file \"%s\" too big. Deletion will not be " |
| 787 | "undo-able. Continue (y/N)? ", zName+nRoot); |
| 788 | blob_zero(&ans); |
| 789 | prompt_user(prompt, &ans); |
| 790 | cReply = blob_str(&ans)[0]; |
| @@ -804,12 +806,12 @@ | |
| 806 | if( emptyDirsFlag ){ |
| 807 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 808 | Stmt q; |
| 809 | Blob root; |
| 810 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 811 | vfile_dir_scan(&root, blob_size(&root), scanFlags, |
| 812 | verilyFlag ? 0 : pIgnore, pEmptyDirs); |
| 813 | blob_reset(&root); |
| 814 | db_prepare(&q, |
| 815 | "SELECT %Q || x FROM dscan_temp" |
| 816 | " WHERE x NOT IN (%s) AND y = 0" |
| 817 | " ORDER BY 1 DESC", |
| 818 |