Fossil SCM
Make the mv-rm-files available without special compile-time options.
Commit
27e5e5ce65262f5a0520cdffbd4851359849d2b604b756ce3fd4b41568660a47
Parent
122905c29b43f53…
2 files changed
+6
-39
-2
+6
-39
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -22,28 +22,10 @@ | ||
| 22 | 22 | #include "add.h" |
| 23 | 23 | #include <assert.h> |
| 24 | 24 | #include <dirent.h> |
| 25 | 25 | #include "cygsup.h" |
| 26 | 26 | |
| 27 | -/* | |
| 28 | -** WARNING: For Fossil version x.x this value was always zero. For Fossil-NG | |
| 29 | -** it will probably always be one. When this value is zero, | |
| 30 | -** files in the checkout will not be moved by the "mv" command and | |
| 31 | -** files in the checkout will not be removed by the "rm" command. | |
| 32 | -** | |
| 33 | -** If the FOSSIL_ENABLE_LEGACY_MV_RM compile-time option is used, | |
| 34 | -** the "mv-rm-files" setting will be consulted instead of using | |
| 35 | -** this value. | |
| 36 | -** | |
| 37 | -** To retain the Fossil version 2.x behavior when using Fossil-NG | |
| 38 | -** the FOSSIL_ENABLE_LEGACY_MV_RM compile-time option must be used | |
| 39 | -** -AND- the "mv-rm-files" setting must be set to zero. | |
| 40 | -*/ | |
| 41 | -#ifndef FOSSIL_MV_RM_FILE | |
| 42 | -#define FOSSIL_MV_RM_FILE (0) | |
| 43 | -#endif | |
| 44 | - | |
| 45 | 27 | /* |
| 46 | 28 | ** This routine returns the names of files in a working checkout that |
| 47 | 29 | ** are created by Fossil itself, and hence should not be added, deleted, |
| 48 | 30 | ** or merge, and should be omitted from "clean" and "extras" lists. |
| 49 | 31 | ** |
| @@ -424,21 +406,18 @@ | ||
| 424 | 406 | ** Remove one or more files or directories from the repository. |
| 425 | 407 | ** |
| 426 | 408 | ** The 'rm' and 'delete' commands do NOT normally remove the files from |
| 427 | 409 | ** disk. They just mark the files as no longer being part of the project. |
| 428 | 410 | ** In other words, future changes to the named files will not be versioned. |
| 429 | -** However, the default behavior of this command may be overridden via the | |
| 430 | -** command line options listed below and/or the 'mv-rm-files' setting. | |
| 411 | +** However, the default behavior of this command may be overridden using | |
| 412 | +** the --hard or --soft command line options or by changing the | |
| 413 | +** 'mv-rm-files' setting. | |
| 431 | 414 | ** |
| 432 | 415 | ** The 'forget' command never removes files from disk, even when the command |
| 433 | 416 | ** line options and/or the 'mv-rm-files' setting would otherwise require it |
| 434 | 417 | ** to do so. |
| 435 | 418 | ** |
| 436 | -** WARNING: If the "--hard" option is specified -OR- the "mv-rm-files" | |
| 437 | -** setting is non-zero, files WILL BE removed from disk as well. | |
| 438 | -** This does NOT apply to the 'forget' command. | |
| 439 | -** | |
| 440 | 419 | ** Options: |
| 441 | 420 | ** --soft Skip removing files from the checkout. |
| 442 | 421 | ** This supersedes the --hard option. |
| 443 | 422 | ** --hard Remove files from the checkout. |
| 444 | 423 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| @@ -468,15 +447,11 @@ | ||
| 468 | 447 | }else if( softFlag ){ |
| 469 | 448 | removeFiles = 0; |
| 470 | 449 | }else if( hardFlag ){ |
| 471 | 450 | removeFiles = 1; |
| 472 | 451 | }else{ |
| 473 | -#if FOSSIL_ENABLE_LEGACY_MV_RM | |
| 474 | 452 | removeFiles = db_get_boolean("mv-rm-files",0); |
| 475 | -#else | |
| 476 | - removeFiles = FOSSIL_MV_RM_FILE; | |
| 477 | -#endif | |
| 478 | 453 | } |
| 479 | 454 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", |
| 480 | 455 | filename_collation()); |
| 481 | 456 | for(i=2; i<g.argc; i++){ |
| 482 | 457 | Blob treeName; |
| @@ -831,22 +806,18 @@ | ||
| 831 | 806 | ** Move or rename one or more files or directories within the repository tree. |
| 832 | 807 | ** You can either rename a file or directory or move it to another subdirectory. |
| 833 | 808 | ** |
| 834 | 809 | ** The 'mv' command does NOT normally rename or move the files on disk. |
| 835 | 810 | ** This command merely records the fact that file names have changed so |
| 836 | -** that appropriate notations can be made at the next commit/check-in. | |
| 837 | -** However, the default behavior of this command may be overridden via | |
| 838 | -** command line options listed below and/or the 'mv-rm-files' setting. | |
| 811 | +** that appropriate notations can be made at the next commit/check-in. | |
| 812 | +** This behavior can be changed using the --hard or --soft command-line | |
| 813 | +** options or by changing the 'mv-rm-files' setting. | |
| 839 | 814 | ** |
| 840 | 815 | ** The 'rename' command never renames or moves files on disk, even when the |
| 841 | 816 | ** command line options and/or the 'mv-rm-files' setting would otherwise |
| 842 | 817 | ** require it to do so. |
| 843 | 818 | ** |
| 844 | -** WARNING: If the "--hard" option is specified -OR- the "mv-rm-files" | |
| 845 | -** setting is non-zero, files WILL BE renamed or moved on disk | |
| 846 | -** as well. This does NOT apply to the 'rename' command. | |
| 847 | -** | |
| 848 | 819 | ** Options: |
| 849 | 820 | ** --soft Skip moving files within the checkout. |
| 850 | 821 | ** This supersedes the --hard option. |
| 851 | 822 | ** --hard Move files within the checkout. |
| 852 | 823 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| @@ -889,15 +860,11 @@ | ||
| 889 | 860 | }else if( softFlag ){ |
| 890 | 861 | moveFiles = 0; |
| 891 | 862 | }else if( hardFlag ){ |
| 892 | 863 | moveFiles = 1; |
| 893 | 864 | }else{ |
| 894 | -#if FOSSIL_ENABLE_LEGACY_MV_RM | |
| 895 | 865 | moveFiles = db_get_boolean("mv-rm-files",0); |
| 896 | -#else | |
| 897 | - moveFiles = FOSSIL_MV_RM_FILE; | |
| 898 | -#endif | |
| 899 | 866 | } |
| 900 | 867 | file_tree_name(zDest, &dest, 0, 1); |
| 901 | 868 | db_multi_exec( |
| 902 | 869 | "UPDATE vfile SET origname=pathname WHERE origname IS NULL;" |
| 903 | 870 | ); |
| 904 | 871 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -22,28 +22,10 @@ | |
| 22 | #include "add.h" |
| 23 | #include <assert.h> |
| 24 | #include <dirent.h> |
| 25 | #include "cygsup.h" |
| 26 | |
| 27 | /* |
| 28 | ** WARNING: For Fossil version x.x this value was always zero. For Fossil-NG |
| 29 | ** it will probably always be one. When this value is zero, |
| 30 | ** files in the checkout will not be moved by the "mv" command and |
| 31 | ** files in the checkout will not be removed by the "rm" command. |
| 32 | ** |
| 33 | ** If the FOSSIL_ENABLE_LEGACY_MV_RM compile-time option is used, |
| 34 | ** the "mv-rm-files" setting will be consulted instead of using |
| 35 | ** this value. |
| 36 | ** |
| 37 | ** To retain the Fossil version 2.x behavior when using Fossil-NG |
| 38 | ** the FOSSIL_ENABLE_LEGACY_MV_RM compile-time option must be used |
| 39 | ** -AND- the "mv-rm-files" setting must be set to zero. |
| 40 | */ |
| 41 | #ifndef FOSSIL_MV_RM_FILE |
| 42 | #define FOSSIL_MV_RM_FILE (0) |
| 43 | #endif |
| 44 | |
| 45 | /* |
| 46 | ** This routine returns the names of files in a working checkout that |
| 47 | ** are created by Fossil itself, and hence should not be added, deleted, |
| 48 | ** or merge, and should be omitted from "clean" and "extras" lists. |
| 49 | ** |
| @@ -424,21 +406,18 @@ | |
| 424 | ** Remove one or more files or directories from the repository. |
| 425 | ** |
| 426 | ** The 'rm' and 'delete' commands do NOT normally remove the files from |
| 427 | ** disk. They just mark the files as no longer being part of the project. |
| 428 | ** In other words, future changes to the named files will not be versioned. |
| 429 | ** However, the default behavior of this command may be overridden via the |
| 430 | ** command line options listed below and/or the 'mv-rm-files' setting. |
| 431 | ** |
| 432 | ** The 'forget' command never removes files from disk, even when the command |
| 433 | ** line options and/or the 'mv-rm-files' setting would otherwise require it |
| 434 | ** to do so. |
| 435 | ** |
| 436 | ** WARNING: If the "--hard" option is specified -OR- the "mv-rm-files" |
| 437 | ** setting is non-zero, files WILL BE removed from disk as well. |
| 438 | ** This does NOT apply to the 'forget' command. |
| 439 | ** |
| 440 | ** Options: |
| 441 | ** --soft Skip removing files from the checkout. |
| 442 | ** This supersedes the --hard option. |
| 443 | ** --hard Remove files from the checkout. |
| 444 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| @@ -468,15 +447,11 @@ | |
| 468 | }else if( softFlag ){ |
| 469 | removeFiles = 0; |
| 470 | }else if( hardFlag ){ |
| 471 | removeFiles = 1; |
| 472 | }else{ |
| 473 | #if FOSSIL_ENABLE_LEGACY_MV_RM |
| 474 | removeFiles = db_get_boolean("mv-rm-files",0); |
| 475 | #else |
| 476 | removeFiles = FOSSIL_MV_RM_FILE; |
| 477 | #endif |
| 478 | } |
| 479 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", |
| 480 | filename_collation()); |
| 481 | for(i=2; i<g.argc; i++){ |
| 482 | Blob treeName; |
| @@ -831,22 +806,18 @@ | |
| 831 | ** Move or rename one or more files or directories within the repository tree. |
| 832 | ** You can either rename a file or directory or move it to another subdirectory. |
| 833 | ** |
| 834 | ** The 'mv' command does NOT normally rename or move the files on disk. |
| 835 | ** This command merely records the fact that file names have changed so |
| 836 | ** that appropriate notations can be made at the next commit/check-in. |
| 837 | ** However, the default behavior of this command may be overridden via |
| 838 | ** command line options listed below and/or the 'mv-rm-files' setting. |
| 839 | ** |
| 840 | ** The 'rename' command never renames or moves files on disk, even when the |
| 841 | ** command line options and/or the 'mv-rm-files' setting would otherwise |
| 842 | ** require it to do so. |
| 843 | ** |
| 844 | ** WARNING: If the "--hard" option is specified -OR- the "mv-rm-files" |
| 845 | ** setting is non-zero, files WILL BE renamed or moved on disk |
| 846 | ** as well. This does NOT apply to the 'rename' command. |
| 847 | ** |
| 848 | ** Options: |
| 849 | ** --soft Skip moving files within the checkout. |
| 850 | ** This supersedes the --hard option. |
| 851 | ** --hard Move files within the checkout. |
| 852 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| @@ -889,15 +860,11 @@ | |
| 889 | }else if( softFlag ){ |
| 890 | moveFiles = 0; |
| 891 | }else if( hardFlag ){ |
| 892 | moveFiles = 1; |
| 893 | }else{ |
| 894 | #if FOSSIL_ENABLE_LEGACY_MV_RM |
| 895 | moveFiles = db_get_boolean("mv-rm-files",0); |
| 896 | #else |
| 897 | moveFiles = FOSSIL_MV_RM_FILE; |
| 898 | #endif |
| 899 | } |
| 900 | file_tree_name(zDest, &dest, 0, 1); |
| 901 | db_multi_exec( |
| 902 | "UPDATE vfile SET origname=pathname WHERE origname IS NULL;" |
| 903 | ); |
| 904 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -22,28 +22,10 @@ | |
| 22 | #include "add.h" |
| 23 | #include <assert.h> |
| 24 | #include <dirent.h> |
| 25 | #include "cygsup.h" |
| 26 | |
| 27 | /* |
| 28 | ** This routine returns the names of files in a working checkout that |
| 29 | ** are created by Fossil itself, and hence should not be added, deleted, |
| 30 | ** or merge, and should be omitted from "clean" and "extras" lists. |
| 31 | ** |
| @@ -424,21 +406,18 @@ | |
| 406 | ** Remove one or more files or directories from the repository. |
| 407 | ** |
| 408 | ** The 'rm' and 'delete' commands do NOT normally remove the files from |
| 409 | ** disk. They just mark the files as no longer being part of the project. |
| 410 | ** In other words, future changes to the named files will not be versioned. |
| 411 | ** However, the default behavior of this command may be overridden using |
| 412 | ** the --hard or --soft command line options or by changing the |
| 413 | ** 'mv-rm-files' setting. |
| 414 | ** |
| 415 | ** The 'forget' command never removes files from disk, even when the command |
| 416 | ** line options and/or the 'mv-rm-files' setting would otherwise require it |
| 417 | ** to do so. |
| 418 | ** |
| 419 | ** Options: |
| 420 | ** --soft Skip removing files from the checkout. |
| 421 | ** This supersedes the --hard option. |
| 422 | ** --hard Remove files from the checkout. |
| 423 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| @@ -468,15 +447,11 @@ | |
| 447 | }else if( softFlag ){ |
| 448 | removeFiles = 0; |
| 449 | }else if( hardFlag ){ |
| 450 | removeFiles = 1; |
| 451 | }else{ |
| 452 | removeFiles = db_get_boolean("mv-rm-files",0); |
| 453 | } |
| 454 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", |
| 455 | filename_collation()); |
| 456 | for(i=2; i<g.argc; i++){ |
| 457 | Blob treeName; |
| @@ -831,22 +806,18 @@ | |
| 806 | ** Move or rename one or more files or directories within the repository tree. |
| 807 | ** You can either rename a file or directory or move it to another subdirectory. |
| 808 | ** |
| 809 | ** The 'mv' command does NOT normally rename or move the files on disk. |
| 810 | ** This command merely records the fact that file names have changed so |
| 811 | ** that appropriate notations can be made at the next commit/check-in. |
| 812 | ** This behavior can be changed using the --hard or --soft command-line |
| 813 | ** options or by changing the 'mv-rm-files' setting. |
| 814 | ** |
| 815 | ** The 'rename' command never renames or moves files on disk, even when the |
| 816 | ** command line options and/or the 'mv-rm-files' setting would otherwise |
| 817 | ** require it to do so. |
| 818 | ** |
| 819 | ** Options: |
| 820 | ** --soft Skip moving files within the checkout. |
| 821 | ** This supersedes the --hard option. |
| 822 | ** --hard Move files within the checkout. |
| 823 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| @@ -889,15 +860,11 @@ | |
| 860 | }else if( softFlag ){ |
| 861 | moveFiles = 0; |
| 862 | }else if( hardFlag ){ |
| 863 | moveFiles = 1; |
| 864 | }else{ |
| 865 | moveFiles = db_get_boolean("mv-rm-files",0); |
| 866 | } |
| 867 | file_tree_name(zDest, &dest, 0, 1); |
| 868 | db_multi_exec( |
| 869 | "UPDATE vfile SET origname=pathname WHERE origname IS NULL;" |
| 870 | ); |
| 871 |
M
src/db.c
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -3133,19 +3133,17 @@ | ||
| 3133 | 3133 | ** Use file modification times (mtimes) to detect when |
| 3134 | 3134 | ** files have been modified. If disabled, all managed files |
| 3135 | 3135 | ** are hashed to detect changes, which can be slow for large |
| 3136 | 3136 | ** projects. |
| 3137 | 3137 | */ |
| 3138 | -#if FOSSIL_ENABLE_LEGACY_MV_RM | |
| 3139 | 3138 | /* |
| 3140 | 3139 | ** SETTING: mv-rm-files boolean default=off |
| 3141 | 3140 | ** If enabled, the "mv" and "rename" commands will also move |
| 3142 | 3141 | ** the associated files within the checkout -AND- the "rm" |
| 3143 | 3142 | ** and "delete" commands will also remove the associated |
| 3144 | 3143 | ** files from within the checkout. |
| 3145 | 3144 | */ |
| 3146 | -#endif | |
| 3147 | 3145 | /* |
| 3148 | 3146 | ** SETTING: pgp-command width=40 |
| 3149 | 3147 | ** Command used to clear-sign manifests at check-in. |
| 3150 | 3148 | ** Default value is "gpg --clearsign -o" |
| 3151 | 3149 | */ |
| 3152 | 3150 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -3133,19 +3133,17 @@ | |
| 3133 | ** Use file modification times (mtimes) to detect when |
| 3134 | ** files have been modified. If disabled, all managed files |
| 3135 | ** are hashed to detect changes, which can be slow for large |
| 3136 | ** projects. |
| 3137 | */ |
| 3138 | #if FOSSIL_ENABLE_LEGACY_MV_RM |
| 3139 | /* |
| 3140 | ** SETTING: mv-rm-files boolean default=off |
| 3141 | ** If enabled, the "mv" and "rename" commands will also move |
| 3142 | ** the associated files within the checkout -AND- the "rm" |
| 3143 | ** and "delete" commands will also remove the associated |
| 3144 | ** files from within the checkout. |
| 3145 | */ |
| 3146 | #endif |
| 3147 | /* |
| 3148 | ** SETTING: pgp-command width=40 |
| 3149 | ** Command used to clear-sign manifests at check-in. |
| 3150 | ** Default value is "gpg --clearsign -o" |
| 3151 | */ |
| 3152 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -3133,19 +3133,17 @@ | |
| 3133 | ** Use file modification times (mtimes) to detect when |
| 3134 | ** files have been modified. If disabled, all managed files |
| 3135 | ** are hashed to detect changes, which can be slow for large |
| 3136 | ** projects. |
| 3137 | */ |
| 3138 | /* |
| 3139 | ** SETTING: mv-rm-files boolean default=off |
| 3140 | ** If enabled, the "mv" and "rename" commands will also move |
| 3141 | ** the associated files within the checkout -AND- the "rm" |
| 3142 | ** and "delete" commands will also remove the associated |
| 3143 | ** files from within the checkout. |
| 3144 | */ |
| 3145 | /* |
| 3146 | ** SETTING: pgp-command width=40 |
| 3147 | ** Command used to clear-sign manifests at check-in. |
| 3148 | ** Default value is "gpg --clearsign -o" |
| 3149 | */ |
| 3150 |