Fossil SCM

Merge the fix for [711d04b6d8577] into trunk. Only bail out of a commit if none of the selected files have changed, rather than if any selected file is unchanged.

drh 2012-09-27 13:02 trunk merge
Commit 3a5e81cedb0bd2c745ecdb6c32ed480dc8f610e0
1 file changed +11 -13
+11 -13
--- src/checkin.c
+++ src/checkin.c
@@ -1084,24 +1084,22 @@
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,
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
- }
1092
+ if( g.aCommitFile
1093
+ && !forceFlag
1094
+ && !db_exists(
1095
+ "SELECT 1 FROM vfile "
1096
+ " WHERE is_selected(id)"
1097
+ " AND (chnged OR deleted OR rid=0 OR pathname!=origname)")
1098
+ ){
1099
+ fossil_fatal("none of the selected files have changed; use -f"
1100
+ " or --force.");
11031101
}
11041102
11051103
/*
11061104
** Do not allow a commit that will cause a fork unless the --force flag
11071105
** is used or unless this is a private check-in.
11081106
--- src/checkin.c
+++ src/checkin.c
@@ -1084,24 +1084,22 @@
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 ** is used or unless this is a private check-in.
1108
--- src/checkin.c
+++ src/checkin.c
@@ -1084,24 +1084,22 @@
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
1093 && !forceFlag
1094 && !db_exists(
1095 "SELECT 1 FROM vfile "
1096 " WHERE is_selected(id)"
1097 " AND (chnged OR deleted OR rid=0 OR pathname!=origname)")
1098 ){
1099 fossil_fatal("none of the selected files have changed; use -f"
1100 " or --force.");
 
 
1101 }
1102
1103 /*
1104 ** Do not allow a commit that will cause a fork unless the --force flag
1105 ** is used or unless this is a private check-in.
1106

Keyboard Shortcuts

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