Fossil SCM

[711d04b6d8]

jan.nijtmans 2012-09-27 08:43 UTC trunk
Commit eab9f88e7f6c173eb14181efc0522005b62ead6d
1 file changed +10 -10
+10 -10
--- src/checkin.c
+++ src/checkin.c
@@ -1084,23 +1084,23 @@
10841084
db_record_repository_filename(0);
10851085
if( hasChanges==0 && !isAMerge && !forceFlag ){
10861086
fossil_fatal("nothing has changed");
10871087
}
10881088
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.
10911091
*/
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,
10971097
"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)"
10991099
);
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));
11021102
}
11031103
}
11041104
11051105
/*
11061106
** Do not allow a commit that will cause a fork unless the --force flag
11071107
--- 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

Keyboard Shortcuts

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