Fossil SCM

Make the mv-rm-files setting on by default.

drh 2025-04-01 18:46 trunk
Commit bd1b13210f800c187723145223c4a85d161ad98323f9f248aa52d935dd5261ce
2 files changed +28 -34 +1 -1
+28 -34
--- src/add.c
+++ src/add.c
@@ -564,30 +564,27 @@
564564
** COMMAND: delete
565565
** COMMAND: forget*
566566
**
567567
** Usage: %fossil rm|delete|forget FILE1 ?FILE2 ...?
568568
**
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'.
570571
**
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.
576576
**
577577
** The 'forget' command never removes files from disk, even when the command
578578
** 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.
584581
**
585582
** 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.
589586
** --case-sensitive BOOL Override the case-sensitive setting
590587
** -n|--dry-run If given, display instead of run actions.
591588
** --reset Reset the DELETED state of a check-out, such
592589
** that all newly-rm'd (but not yet committed)
593590
** files are no longer removed. No flags other
@@ -627,11 +624,11 @@
627624
}else if( softFlag ){
628625
removeFiles = 0;
629626
}else if( hardFlag ){
630627
removeFiles = 1;
631628
}else{
632
- removeFiles = db_get_boolean("mv-rm-files",0);
629
+ removeFiles = db_get_boolean("mv-rm-files",1);
633630
}
634631
db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)",
635632
filename_collation());
636633
for(i=2; i<g.argc; i++){
637634
Blob treeName;
@@ -1005,27 +1002,24 @@
10051002
** or: %fossil mv|rename OLDNAME... DIR
10061003
**
10071004
** Move or rename one or more files or directories within the repository tree.
10081005
** You can either rename a file or directory or move it to another subdirectory.
10091006
**
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.
10231016
**
10241017
** 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.
10271021
** --hard Move files within the check-out
10281022
** --case-sensitive BOOL Override the case-sensitive setting
10291023
** -n|--dry-run If given, display instead of run actions
10301024
**
10311025
** See also: [[changes]], [[status]]
@@ -1058,18 +1052,18 @@
10581052
if( g.argc<4 ){
10591053
usage("OLDNAME NEWNAME");
10601054
}
10611055
zDest = file_case_preferred_name(".",g.argv[g.argc-1]);
10621056
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" */
10641060
moveFiles = 0;
10651061
}else if( softFlag ){
10661062
moveFiles = 0;
1067
- }else if( hardFlag ){
1068
- moveFiles = 1;
10691063
}else{
1070
- moveFiles = db_get_boolean("mv-rm-files",0);
1064
+ moveFiles = db_get_boolean("mv-rm-files",1);
10711065
}
10721066
file_tree_name(zDest, &dest, 0, 1);
10731067
db_multi_exec(
10741068
"UPDATE vfile SET origname=pathname WHERE origname IS NULL;"
10751069
);
10761070
--- 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
+1 -1
--- src/db.c
+++ src/db.c
@@ -5013,11 +5013,11 @@
50135013
** files have been modified. If disabled, all managed files
50145014
** are hashed to detect changes, which can be slow for large
50155015
** projects.
50165016
*/
50175017
/*
5018
-** SETTING: mv-rm-files boolean default=off
5018
+** SETTING: mv-rm-files boolean default=on
50195019
** If enabled, the "mv" and "rename" commands will also move
50205020
** the associated files within the check-out -AND- the "rm"
50215021
** and "delete" commands will also remove the associated
50225022
** files from within the check-out.
50235023
*/
50245024
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button