Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Make the mv-rm-files setting on by default. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | mv-rm-default-swap |
| Files: | files | file ages | folders |
| SHA3-256: |
bd1b13210f800c187723145223c4a85d |
| User & Date: | drh 2025-04-01 18:46:13.589 |
Context
|
2025-04-01
| ||
| 18:46 | Make the mv-rm-files setting on by default. Leaf check-in: bd1b13210f user: drh tags: mv-rm-default-swap | |
| 13:33 | Make use of the Accept-Encoding header value to help distinguish humans from robots. check-in: 0d41eb4790 user: drh tags: trunk | |
Changes
Changes to src/add.c.
| ︙ | ︙ | |||
562 563 564 565 566 567 568 | /* ** COMMAND: rm ** COMMAND: delete ** COMMAND: forget* ** ** Usage: %fossil rm|delete|forget FILE1 ?FILE2 ...? ** | | > | > | < < | | | < < < | | | | 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 | /* ** COMMAND: rm ** COMMAND: delete ** COMMAND: forget* ** ** Usage: %fossil rm|delete|forget FILE1 ?FILE2 ...? ** ** Remove one or more files or directories from the repository so that those ** files are not captured as part of the next 'commit'. ** ** The 'rm' and 'delete' commands also remove the files from filesystem. ** However, adding the --soft argument leaves the files on disk unchanged ** and only marks the files as no longer under management. The --soft ** behavior can be made the default by turning off the 'mv-rm-files' setting. ** ** The 'forget' command never removes files from disk, even when the command ** line options and/or the 'mv-rm-files' setting would otherwise require it ** to do so. The 'forget' command only removes files from being under ** configuration management, but does not remove any files on disk. ** ** Options: ** --soft Do not actually delete files, just make them ** unmanaged. ** --hard Actually remove the files. ** --case-sensitive BOOL Override the case-sensitive setting ** -n|--dry-run If given, display instead of run actions. ** --reset Reset the DELETED state of a check-out, such ** that all newly-rm'd (but not yet committed) ** files are no longer removed. No flags other ** than --verbose or --dry-run may be used with ** --reset. |
| ︙ | ︙ | |||
625 626 627 628 629 630 631 |
if( g.argv[1][0]=='f' ){ /* i.e. "forget" */
removeFiles = 0;
}else if( softFlag ){
removeFiles = 0;
}else if( hardFlag ){
removeFiles = 1;
}else{
| | | 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 |
if( g.argv[1][0]=='f' ){ /* i.e. "forget" */
removeFiles = 0;
}else if( softFlag ){
removeFiles = 0;
}else if( hardFlag ){
removeFiles = 1;
}else{
removeFiles = db_get_boolean("mv-rm-files",1);
}
db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)",
filename_collation());
for(i=2; i<g.argc; i++){
Blob treeName;
char *zTreeName;
|
| ︙ | ︙ | |||
1003 1004 1005 1006 1007 1008 1009 | ** ** Usage: %fossil mv|rename OLDNAME NEWNAME ** or: %fossil mv|rename OLDNAME... DIR ** ** Move or rename one or more files or directories within the repository tree. ** You can either rename a file or directory or move it to another subdirectory. ** | | > | | < < | > | < < | < < | > | | 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 |
**
** Usage: %fossil mv|rename OLDNAME NEWNAME
** or: %fossil mv|rename OLDNAME... DIR
**
** Move or rename one or more files or directories within the repository tree.
** You can either rename a file or directory or move it to another subdirectory.
**
** The 'mv' command also renames or moves the files in the filesystem, unless
** the --soft option is specifed, or if the 'mv-rm-files' setting is set to
** 'off', then the 'mv' command just records the new filename for use at the
** next commit.
**
** The 'rename' command is like 'mv' except that it has the --soft option
** turned on by default. Hence, 'rename' will (by default) record the new
** filename for the next commit, but will not actually make any changes to the
** filesystem, unless the --hard option is used.
**
** Options:
** --soft Do not make changes to files on disk. Instead
** just record a new name for the files to use
** at the next check-in.
** --hard Move files within the check-out
** --case-sensitive BOOL Override the case-sensitive setting
** -n|--dry-run If given, display instead of run actions
**
** See also: [[changes]], [[status]]
*/
void mv_cmd(void){
|
| ︙ | ︙ | |||
1056 1057 1058 1059 1060 1061 1062 |
fossil_fatal("no check-out in which to rename files");
}
if( g.argc<4 ){
usage("OLDNAME NEWNAME");
}
zDest = file_case_preferred_name(".",g.argv[g.argc-1]);
db_begin_transaction();
| > > | < < | | 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 |
fossil_fatal("no check-out in which to rename files");
}
if( g.argc<4 ){
usage("OLDNAME NEWNAME");
}
zDest = file_case_preferred_name(".",g.argv[g.argc-1]);
db_begin_transaction();
if( hardFlag ){
moveFiles = 1;
}else if( g.argv[1][0]=='r' ){ /* i.e. "rename" */
moveFiles = 0;
}else if( softFlag ){
moveFiles = 0;
}else{
moveFiles = db_get_boolean("mv-rm-files",1);
}
file_tree_name(zDest, &dest, 0, 1);
db_multi_exec(
"UPDATE vfile SET origname=pathname WHERE origname IS NULL;"
);
db_multi_exec(
"CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);"
|
| ︙ | ︙ |
Changes to src/db.c.
| ︙ | ︙ | |||
5011 5012 5013 5014 5015 5016 5017 | ** SETTING: mtime-changes boolean default=on ** Use file modification times (mtimes) to detect when ** files have been modified. If disabled, all managed files ** are hashed to detect changes, which can be slow for large ** projects. */ /* | | | 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 | ** SETTING: mtime-changes boolean default=on ** Use file modification times (mtimes) to detect when ** files have been modified. If disabled, all managed files ** are hashed to detect changes, which can be slow for large ** projects. */ /* ** SETTING: mv-rm-files boolean default=on ** If enabled, the "mv" and "rename" commands will also move ** the associated files within the check-out -AND- the "rm" ** and "delete" commands will also remove the associated ** files from within the check-out. */ /* ** SETTING: pgp-command width=40 sensitive |
| ︙ | ︙ |