Fossil SCM
Make the mv-rm-files setting on by default.
Commit
bd1b13210f800c187723145223c4a85d161ad98323f9f248aa52d935dd5261ce
Parent
0d41eb4790df995…
2 files changed
+28
-34
+1
-1
+28
-34
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -564,30 +564,27 @@ | ||
| 564 | 564 | ** COMMAND: delete |
| 565 | 565 | ** COMMAND: forget* |
| 566 | 566 | ** |
| 567 | 567 | ** Usage: %fossil rm|delete|forget FILE1 ?FILE2 ...? |
| 568 | 568 | ** |
| 569 | -** Remove one or more files or directories from the repository. | |
| 569 | +** Remove one or more files or directories from the repository so that those | |
| 570 | +** files are not captured as part of the next 'commit'. | |
| 570 | 571 | ** |
| 571 | -** The 'rm' and 'delete' commands do NOT normally remove the files from | |
| 572 | -** disk. They just mark the files as no longer being part of the project. | |
| 573 | -** In other words, future changes to the named files will not be versioned. | |
| 574 | -** However, the default behavior of this command may be overridden via the | |
| 575 | -** command line options listed below and/or the 'mv-rm-files' setting. | |
| 572 | +** The 'rm' and 'delete' commands also remove the files from filesystem. | |
| 573 | +** However, adding the --soft argument leaves the files on disk unchanged | |
| 574 | +** and only marks the files as no longer under management. The --soft | |
| 575 | +** behavior can be made the default by turning off the 'mv-rm-files' setting. | |
| 576 | 576 | ** |
| 577 | 577 | ** The 'forget' command never removes files from disk, even when the command |
| 578 | 578 | ** line options and/or the 'mv-rm-files' setting would otherwise require it |
| 579 | -** to do so. | |
| 580 | -** | |
| 581 | -** WARNING: If the "--hard" option is specified -OR- the "mv-rm-files" | |
| 582 | -** setting is non-zero, files WILL BE removed from disk as well. | |
| 583 | -** This does NOT apply to the 'forget' command. | |
| 579 | +** to do so. The 'forget' command only removes files from being under | |
| 580 | +** configuration management, but does not remove any files on disk. | |
| 584 | 581 | ** |
| 585 | 582 | ** Options: |
| 586 | -** --soft Skip removing files from the check-out. | |
| 587 | -** This supersedes the --hard option. | |
| 588 | -** --hard Remove files from the check-out | |
| 583 | +** --soft Do not actually delete files, just make them | |
| 584 | +** unmanaged. | |
| 585 | +** --hard Actually remove the files. | |
| 589 | 586 | ** --case-sensitive BOOL Override the case-sensitive setting |
| 590 | 587 | ** -n|--dry-run If given, display instead of run actions. |
| 591 | 588 | ** --reset Reset the DELETED state of a check-out, such |
| 592 | 589 | ** that all newly-rm'd (but not yet committed) |
| 593 | 590 | ** files are no longer removed. No flags other |
| @@ -627,11 +624,11 @@ | ||
| 627 | 624 | }else if( softFlag ){ |
| 628 | 625 | removeFiles = 0; |
| 629 | 626 | }else if( hardFlag ){ |
| 630 | 627 | removeFiles = 1; |
| 631 | 628 | }else{ |
| 632 | - removeFiles = db_get_boolean("mv-rm-files",0); | |
| 629 | + removeFiles = db_get_boolean("mv-rm-files",1); | |
| 633 | 630 | } |
| 634 | 631 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", |
| 635 | 632 | filename_collation()); |
| 636 | 633 | for(i=2; i<g.argc; i++){ |
| 637 | 634 | Blob treeName; |
| @@ -1005,27 +1002,24 @@ | ||
| 1005 | 1002 | ** or: %fossil mv|rename OLDNAME... DIR |
| 1006 | 1003 | ** |
| 1007 | 1004 | ** Move or rename one or more files or directories within the repository tree. |
| 1008 | 1005 | ** You can either rename a file or directory or move it to another subdirectory. |
| 1009 | 1006 | ** |
| 1010 | -** The 'mv' command does NOT normally rename or move the files on disk. | |
| 1011 | -** This command merely records the fact that file names have changed so | |
| 1012 | -** that appropriate notations can be made at the next [[commit]]. | |
| 1013 | -** However, the default behavior of this command may be overridden via | |
| 1014 | -** command line options listed below and/or the 'mv-rm-files' setting. | |
| 1015 | -** | |
| 1016 | -** The 'rename' command never renames or moves files on disk, even when the | |
| 1017 | -** command line options and/or the 'mv-rm-files' setting would otherwise | |
| 1018 | -** require it to do so. | |
| 1019 | -** | |
| 1020 | -** WARNING: If the "--hard" option is specified -OR- the "mv-rm-files" | |
| 1021 | -** setting is non-zero, files WILL BE renamed or moved on disk | |
| 1022 | -** as well. This does NOT apply to the 'rename' command. | |
| 1007 | +** The 'mv' command also renames or moves the files in the filesystem, unless | |
| 1008 | +** the --soft option is specifed, or if the 'mv-rm-files' setting is set to | |
| 1009 | +** 'off', then the 'mv' command just records the new filename for use at the | |
| 1010 | +** next commit. | |
| 1011 | +** | |
| 1012 | +** The 'rename' command is like 'mv' except that it has the --soft option | |
| 1013 | +** turned on by default. Hence, 'rename' will (by default) record the new | |
| 1014 | +** filename for the next commit, but will not actually make any changes to the | |
| 1015 | +** filesystem, unless the --hard option is used. | |
| 1023 | 1016 | ** |
| 1024 | 1017 | ** Options: |
| 1025 | -** --soft Skip moving files within the check-out. | |
| 1026 | -** This supersedes the --hard option. | |
| 1018 | +** --soft Do not make changes to files on disk. Instead | |
| 1019 | +** just record a new name for the files to use | |
| 1020 | +** at the next check-in. | |
| 1027 | 1021 | ** --hard Move files within the check-out |
| 1028 | 1022 | ** --case-sensitive BOOL Override the case-sensitive setting |
| 1029 | 1023 | ** -n|--dry-run If given, display instead of run actions |
| 1030 | 1024 | ** |
| 1031 | 1025 | ** See also: [[changes]], [[status]] |
| @@ -1058,18 +1052,18 @@ | ||
| 1058 | 1052 | if( g.argc<4 ){ |
| 1059 | 1053 | usage("OLDNAME NEWNAME"); |
| 1060 | 1054 | } |
| 1061 | 1055 | zDest = file_case_preferred_name(".",g.argv[g.argc-1]); |
| 1062 | 1056 | db_begin_transaction(); |
| 1063 | - if( g.argv[1][0]=='r' ){ /* i.e. "rename" */ | |
| 1057 | + if( hardFlag ){ | |
| 1058 | + moveFiles = 1; | |
| 1059 | + }else if( g.argv[1][0]=='r' ){ /* i.e. "rename" */ | |
| 1064 | 1060 | moveFiles = 0; |
| 1065 | 1061 | }else if( softFlag ){ |
| 1066 | 1062 | moveFiles = 0; |
| 1067 | - }else if( hardFlag ){ | |
| 1068 | - moveFiles = 1; | |
| 1069 | 1063 | }else{ |
| 1070 | - moveFiles = db_get_boolean("mv-rm-files",0); | |
| 1064 | + moveFiles = db_get_boolean("mv-rm-files",1); | |
| 1071 | 1065 | } |
| 1072 | 1066 | file_tree_name(zDest, &dest, 0, 1); |
| 1073 | 1067 | db_multi_exec( |
| 1074 | 1068 | "UPDATE vfile SET origname=pathname WHERE origname IS NULL;" |
| 1075 | 1069 | ); |
| 1076 | 1070 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -564,30 +564,27 @@ | |
| 564 | ** COMMAND: delete |
| 565 | ** COMMAND: forget* |
| 566 | ** |
| 567 | ** Usage: %fossil rm|delete|forget FILE1 ?FILE2 ...? |
| 568 | ** |
| 569 | ** Remove one or more files or directories from the repository. |
| 570 | ** |
| 571 | ** The 'rm' and 'delete' commands do NOT normally remove the files from |
| 572 | ** disk. They just mark the files as no longer being part of the project. |
| 573 | ** In other words, future changes to the named files will not be versioned. |
| 574 | ** However, the default behavior of this command may be overridden via the |
| 575 | ** command line options listed below and/or the 'mv-rm-files' setting. |
| 576 | ** |
| 577 | ** The 'forget' command never removes files from disk, even when the command |
| 578 | ** line options and/or the 'mv-rm-files' setting would otherwise require it |
| 579 | ** to do so. |
| 580 | ** |
| 581 | ** WARNING: If the "--hard" option is specified -OR- the "mv-rm-files" |
| 582 | ** setting is non-zero, files WILL BE removed from disk as well. |
| 583 | ** This does NOT apply to the 'forget' command. |
| 584 | ** |
| 585 | ** Options: |
| 586 | ** --soft Skip removing files from the check-out. |
| 587 | ** This supersedes the --hard option. |
| 588 | ** --hard Remove files from the check-out |
| 589 | ** --case-sensitive BOOL Override the case-sensitive setting |
| 590 | ** -n|--dry-run If given, display instead of run actions. |
| 591 | ** --reset Reset the DELETED state of a check-out, such |
| 592 | ** that all newly-rm'd (but not yet committed) |
| 593 | ** files are no longer removed. No flags other |
| @@ -627,11 +624,11 @@ | |
| 627 | }else if( softFlag ){ |
| 628 | removeFiles = 0; |
| 629 | }else if( hardFlag ){ |
| 630 | removeFiles = 1; |
| 631 | }else{ |
| 632 | removeFiles = db_get_boolean("mv-rm-files",0); |
| 633 | } |
| 634 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", |
| 635 | filename_collation()); |
| 636 | for(i=2; i<g.argc; i++){ |
| 637 | Blob treeName; |
| @@ -1005,27 +1002,24 @@ | |
| 1005 | ** or: %fossil mv|rename OLDNAME... DIR |
| 1006 | ** |
| 1007 | ** Move or rename one or more files or directories within the repository tree. |
| 1008 | ** You can either rename a file or directory or move it to another subdirectory. |
| 1009 | ** |
| 1010 | ** The 'mv' command does NOT normally rename or move the files on disk. |
| 1011 | ** This command merely records the fact that file names have changed so |
| 1012 | ** that appropriate notations can be made at the next [[commit]]. |
| 1013 | ** However, the default behavior of this command may be overridden via |
| 1014 | ** command line options listed below and/or the 'mv-rm-files' setting. |
| 1015 | ** |
| 1016 | ** The 'rename' command never renames or moves files on disk, even when the |
| 1017 | ** command line options and/or the 'mv-rm-files' setting would otherwise |
| 1018 | ** require it to do so. |
| 1019 | ** |
| 1020 | ** WARNING: If the "--hard" option is specified -OR- the "mv-rm-files" |
| 1021 | ** setting is non-zero, files WILL BE renamed or moved on disk |
| 1022 | ** as well. This does NOT apply to the 'rename' command. |
| 1023 | ** |
| 1024 | ** Options: |
| 1025 | ** --soft Skip moving files within the check-out. |
| 1026 | ** This supersedes the --hard option. |
| 1027 | ** --hard Move files within the check-out |
| 1028 | ** --case-sensitive BOOL Override the case-sensitive setting |
| 1029 | ** -n|--dry-run If given, display instead of run actions |
| 1030 | ** |
| 1031 | ** See also: [[changes]], [[status]] |
| @@ -1058,18 +1052,18 @@ | |
| 1058 | if( g.argc<4 ){ |
| 1059 | usage("OLDNAME NEWNAME"); |
| 1060 | } |
| 1061 | zDest = file_case_preferred_name(".",g.argv[g.argc-1]); |
| 1062 | db_begin_transaction(); |
| 1063 | if( g.argv[1][0]=='r' ){ /* i.e. "rename" */ |
| 1064 | moveFiles = 0; |
| 1065 | }else if( softFlag ){ |
| 1066 | moveFiles = 0; |
| 1067 | }else if( hardFlag ){ |
| 1068 | moveFiles = 1; |
| 1069 | }else{ |
| 1070 | moveFiles = db_get_boolean("mv-rm-files",0); |
| 1071 | } |
| 1072 | file_tree_name(zDest, &dest, 0, 1); |
| 1073 | db_multi_exec( |
| 1074 | "UPDATE vfile SET origname=pathname WHERE origname IS NULL;" |
| 1075 | ); |
| 1076 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -564,30 +564,27 @@ | |
| 564 | ** COMMAND: delete |
| 565 | ** COMMAND: forget* |
| 566 | ** |
| 567 | ** Usage: %fossil rm|delete|forget FILE1 ?FILE2 ...? |
| 568 | ** |
| 569 | ** Remove one or more files or directories from the repository so that those |
| 570 | ** files are not captured as part of the next 'commit'. |
| 571 | ** |
| 572 | ** The 'rm' and 'delete' commands also remove the files from filesystem. |
| 573 | ** However, adding the --soft argument leaves the files on disk unchanged |
| 574 | ** and only marks the files as no longer under management. The --soft |
| 575 | ** behavior can be made the default by turning off the 'mv-rm-files' setting. |
| 576 | ** |
| 577 | ** The 'forget' command never removes files from disk, even when the command |
| 578 | ** line options and/or the 'mv-rm-files' setting would otherwise require it |
| 579 | ** to do so. The 'forget' command only removes files from being under |
| 580 | ** configuration management, but does not remove any files on disk. |
| 581 | ** |
| 582 | ** Options: |
| 583 | ** --soft Do not actually delete files, just make them |
| 584 | ** unmanaged. |
| 585 | ** --hard Actually remove the files. |
| 586 | ** --case-sensitive BOOL Override the case-sensitive setting |
| 587 | ** -n|--dry-run If given, display instead of run actions. |
| 588 | ** --reset Reset the DELETED state of a check-out, such |
| 589 | ** that all newly-rm'd (but not yet committed) |
| 590 | ** files are no longer removed. No flags other |
| @@ -627,11 +624,11 @@ | |
| 624 | }else if( softFlag ){ |
| 625 | removeFiles = 0; |
| 626 | }else if( hardFlag ){ |
| 627 | removeFiles = 1; |
| 628 | }else{ |
| 629 | removeFiles = db_get_boolean("mv-rm-files",1); |
| 630 | } |
| 631 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", |
| 632 | filename_collation()); |
| 633 | for(i=2; i<g.argc; i++){ |
| 634 | Blob treeName; |
| @@ -1005,27 +1002,24 @@ | |
| 1002 | ** or: %fossil mv|rename OLDNAME... DIR |
| 1003 | ** |
| 1004 | ** Move or rename one or more files or directories within the repository tree. |
| 1005 | ** You can either rename a file or directory or move it to another subdirectory. |
| 1006 | ** |
| 1007 | ** The 'mv' command also renames or moves the files in the filesystem, unless |
| 1008 | ** the --soft option is specifed, or if the 'mv-rm-files' setting is set to |
| 1009 | ** 'off', then the 'mv' command just records the new filename for use at the |
| 1010 | ** next commit. |
| 1011 | ** |
| 1012 | ** The 'rename' command is like 'mv' except that it has the --soft option |
| 1013 | ** turned on by default. Hence, 'rename' will (by default) record the new |
| 1014 | ** filename for the next commit, but will not actually make any changes to the |
| 1015 | ** filesystem, unless the --hard option is used. |
| 1016 | ** |
| 1017 | ** Options: |
| 1018 | ** --soft Do not make changes to files on disk. Instead |
| 1019 | ** just record a new name for the files to use |
| 1020 | ** at the next check-in. |
| 1021 | ** --hard Move files within the check-out |
| 1022 | ** --case-sensitive BOOL Override the case-sensitive setting |
| 1023 | ** -n|--dry-run If given, display instead of run actions |
| 1024 | ** |
| 1025 | ** See also: [[changes]], [[status]] |
| @@ -1058,18 +1052,18 @@ | |
| 1052 | if( g.argc<4 ){ |
| 1053 | usage("OLDNAME NEWNAME"); |
| 1054 | } |
| 1055 | zDest = file_case_preferred_name(".",g.argv[g.argc-1]); |
| 1056 | db_begin_transaction(); |
| 1057 | if( hardFlag ){ |
| 1058 | moveFiles = 1; |
| 1059 | }else if( g.argv[1][0]=='r' ){ /* i.e. "rename" */ |
| 1060 | moveFiles = 0; |
| 1061 | }else if( softFlag ){ |
| 1062 | moveFiles = 0; |
| 1063 | }else{ |
| 1064 | moveFiles = db_get_boolean("mv-rm-files",1); |
| 1065 | } |
| 1066 | file_tree_name(zDest, &dest, 0, 1); |
| 1067 | db_multi_exec( |
| 1068 | "UPDATE vfile SET origname=pathname WHERE origname IS NULL;" |
| 1069 | ); |
| 1070 |
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -5013,11 +5013,11 @@ | ||
| 5013 | 5013 | ** files have been modified. If disabled, all managed files |
| 5014 | 5014 | ** are hashed to detect changes, which can be slow for large |
| 5015 | 5015 | ** projects. |
| 5016 | 5016 | */ |
| 5017 | 5017 | /* |
| 5018 | -** SETTING: mv-rm-files boolean default=off | |
| 5018 | +** SETTING: mv-rm-files boolean default=on | |
| 5019 | 5019 | ** If enabled, the "mv" and "rename" commands will also move |
| 5020 | 5020 | ** the associated files within the check-out -AND- the "rm" |
| 5021 | 5021 | ** and "delete" commands will also remove the associated |
| 5022 | 5022 | ** files from within the check-out. |
| 5023 | 5023 | */ |
| 5024 | 5024 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -5013,11 +5013,11 @@ | |
| 5013 | ** files have been modified. If disabled, all managed files |
| 5014 | ** are hashed to detect changes, which can be slow for large |
| 5015 | ** projects. |
| 5016 | */ |
| 5017 | /* |
| 5018 | ** SETTING: mv-rm-files boolean default=off |
| 5019 | ** If enabled, the "mv" and "rename" commands will also move |
| 5020 | ** the associated files within the check-out -AND- the "rm" |
| 5021 | ** and "delete" commands will also remove the associated |
| 5022 | ** files from within the check-out. |
| 5023 | */ |
| 5024 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -5013,11 +5013,11 @@ | |
| 5013 | ** files have been modified. If disabled, all managed files |
| 5014 | ** are hashed to detect changes, which can be slow for large |
| 5015 | ** projects. |
| 5016 | */ |
| 5017 | /* |
| 5018 | ** SETTING: mv-rm-files boolean default=on |
| 5019 | ** If enabled, the "mv" and "rename" commands will also move |
| 5020 | ** the associated files within the check-out -AND- the "rm" |
| 5021 | ** and "delete" commands will also remove the associated |
| 5022 | ** files from within the check-out. |
| 5023 | */ |
| 5024 |