Fossil SCM
[711d04b6d8]
Commit
eab9f88e7f6c173eb14181efc0522005b62ead6d
Parent
1048bccf14a3da7…
1 file changed
+10
-10
+10
-10
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -1084,23 +1084,23 @@ | ||
| 1084 | 1084 | db_record_repository_filename(0); |
| 1085 | 1085 | if( hasChanges==0 && !isAMerge && !forceFlag ){ |
| 1086 | 1086 | fossil_fatal("nothing has changed"); |
| 1087 | 1087 | } |
| 1088 | 1088 | |
| 1089 | - /* If one or more files that were named on the command line have not | |
| 1090 | - ** been modified, bail out now. | |
| 1089 | + /* If none of the files that were named on the command line have | |
| 1090 | + ** been modified, bail out now unless the --force flag is used. | |
| 1091 | 1091 | */ |
| 1092 | - if( g.aCommitFile ){ | |
| 1093 | - Blob unmodified; | |
| 1094 | - memset(&unmodified, 0, sizeof(Blob)); | |
| 1095 | - blob_init(&unmodified, 0, 0); | |
| 1096 | - db_blob(&unmodified, | |
| 1092 | + if( g.aCommitFile && !forceFlag ){ | |
| 1093 | + Blob modified; | |
| 1094 | + memset(&modified, 0, sizeof(Blob)); | |
| 1095 | + blob_init(&modified, 0, 0); | |
| 1096 | + db_blob(&modified, | |
| 1097 | 1097 | "SELECT pathname FROM vfile" |
| 1098 | - " WHERE chnged = 0 AND origname IS NULL AND is_selected(id)" | |
| 1098 | + " WHERE chnged = 1 AND origname IS NULL AND is_selected(id)" | |
| 1099 | 1099 | ); |
| 1100 | - if( strlen(blob_str(&unmodified)) ){ | |
| 1101 | - fossil_fatal("file %s has not changed", blob_str(&unmodified)); | |
| 1100 | + if( strlen(blob_str(&modified))==0 ){ | |
| 1101 | + fossil_fatal("none of the selected files have changed, use -f or --force.", blob_str(&modified)); | |
| 1102 | 1102 | } |
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | 1105 | /* |
| 1106 | 1106 | ** Do not allow a commit that will cause a fork unless the --force flag |
| 1107 | 1107 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1084,23 +1084,23 @@ | |
| 1084 | db_record_repository_filename(0); |
| 1085 | if( hasChanges==0 && !isAMerge && !forceFlag ){ |
| 1086 | fossil_fatal("nothing has changed"); |
| 1087 | } |
| 1088 | |
| 1089 | /* If one or more files that were named on the command line have not |
| 1090 | ** been modified, bail out now. |
| 1091 | */ |
| 1092 | if( g.aCommitFile ){ |
| 1093 | Blob unmodified; |
| 1094 | memset(&unmodified, 0, sizeof(Blob)); |
| 1095 | blob_init(&unmodified, 0, 0); |
| 1096 | db_blob(&unmodified, |
| 1097 | "SELECT pathname FROM vfile" |
| 1098 | " WHERE chnged = 0 AND origname IS NULL AND is_selected(id)" |
| 1099 | ); |
| 1100 | if( strlen(blob_str(&unmodified)) ){ |
| 1101 | fossil_fatal("file %s has not changed", blob_str(&unmodified)); |
| 1102 | } |
| 1103 | } |
| 1104 | |
| 1105 | /* |
| 1106 | ** Do not allow a commit that will cause a fork unless the --force flag |
| 1107 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1084,23 +1084,23 @@ | |
| 1084 | db_record_repository_filename(0); |
| 1085 | if( hasChanges==0 && !isAMerge && !forceFlag ){ |
| 1086 | fossil_fatal("nothing has changed"); |
| 1087 | } |
| 1088 | |
| 1089 | /* If none of the files that were named on the command line have |
| 1090 | ** been modified, bail out now unless the --force flag is used. |
| 1091 | */ |
| 1092 | if( g.aCommitFile && !forceFlag ){ |
| 1093 | Blob modified; |
| 1094 | memset(&modified, 0, sizeof(Blob)); |
| 1095 | blob_init(&modified, 0, 0); |
| 1096 | db_blob(&modified, |
| 1097 | "SELECT pathname FROM vfile" |
| 1098 | " WHERE chnged = 1 AND origname IS NULL AND is_selected(id)" |
| 1099 | ); |
| 1100 | if( strlen(blob_str(&modified))==0 ){ |
| 1101 | fossil_fatal("none of the selected files have changed, use -f or --force.", blob_str(&modified)); |
| 1102 | } |
| 1103 | } |
| 1104 | |
| 1105 | /* |
| 1106 | ** Do not allow a commit that will cause a fork unless the --force flag |
| 1107 |