Fossil SCM
Improved user prompt following a verify-comments failure.
Commit
777d962ce5f037cf9bab76f515c2cbcb3e87cdaea2fbb1377305fc75405143ea
Parent
4ee3362aac8832a…
1 file changed
+7
-5
+7
-5
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -2907,22 +2907,24 @@ | ||
| 2907 | 2907 | |
| 2908 | 2908 | zInit = db_text(0,"SELECT value FROM vvar WHERE name='ci-comment'"); |
| 2909 | 2909 | prepare_commit_comment(&comment, zInit, &sCiInfo, vid, dryRunFlag); |
| 2910 | 2910 | db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment); |
| 2911 | 2911 | if( !allowSusCom && suspicious_comment(&comment,&sus) ){ |
| 2912 | - blob_appendf(&sus, "Edit, abort, or continue (E/a/c)? "); | |
| 2912 | + blob_appendf(&sus, "Continue (y/n/E=edit)? "); | |
| 2913 | 2913 | prompt_user(blob_str(&sus), &ans); |
| 2914 | 2914 | cReply = blob_str(&ans)[0]; |
| 2915 | 2915 | blob_reset(&ans); |
| 2916 | 2916 | blob_reset(&sus); |
| 2917 | - if( cReply=='e' || cReply=='E' ){ | |
| 2917 | + if( cReply=='n' || cReply=='N' ){ | |
| 2918 | + fossil_fatal("Commit aborted."); | |
| 2919 | + } | |
| 2920 | + if( cReply!='y' && cReply!='Y' ){ | |
| 2921 | + /* "Edit" is the default in case the user enters anything that | |
| 2922 | + ** does not start with Y or N - including just hitting return. */ | |
| 2918 | 2923 | fossil_free(zInit); |
| 2919 | 2924 | continue; |
| 2920 | 2925 | } |
| 2921 | - if( cReply!='c' && cReply!='C' ){ | |
| 2922 | - fossil_fatal("Commit aborted."); | |
| 2923 | - } | |
| 2924 | 2926 | } |
| 2925 | 2927 | if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){ |
| 2926 | 2928 | prompt_user("unchanged check-in comment. continue (y/N)? ", &ans); |
| 2927 | 2929 | cReply = blob_str(&ans)[0]; |
| 2928 | 2930 | blob_reset(&ans); |
| 2929 | 2931 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2907,22 +2907,24 @@ | |
| 2907 | |
| 2908 | zInit = db_text(0,"SELECT value FROM vvar WHERE name='ci-comment'"); |
| 2909 | prepare_commit_comment(&comment, zInit, &sCiInfo, vid, dryRunFlag); |
| 2910 | db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment); |
| 2911 | if( !allowSusCom && suspicious_comment(&comment,&sus) ){ |
| 2912 | blob_appendf(&sus, "Edit, abort, or continue (E/a/c)? "); |
| 2913 | prompt_user(blob_str(&sus), &ans); |
| 2914 | cReply = blob_str(&ans)[0]; |
| 2915 | blob_reset(&ans); |
| 2916 | blob_reset(&sus); |
| 2917 | if( cReply=='e' || cReply=='E' ){ |
| 2918 | fossil_free(zInit); |
| 2919 | continue; |
| 2920 | } |
| 2921 | if( cReply!='c' && cReply!='C' ){ |
| 2922 | fossil_fatal("Commit aborted."); |
| 2923 | } |
| 2924 | } |
| 2925 | if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){ |
| 2926 | prompt_user("unchanged check-in comment. continue (y/N)? ", &ans); |
| 2927 | cReply = blob_str(&ans)[0]; |
| 2928 | blob_reset(&ans); |
| 2929 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2907,22 +2907,24 @@ | |
| 2907 | |
| 2908 | zInit = db_text(0,"SELECT value FROM vvar WHERE name='ci-comment'"); |
| 2909 | prepare_commit_comment(&comment, zInit, &sCiInfo, vid, dryRunFlag); |
| 2910 | db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment); |
| 2911 | if( !allowSusCom && suspicious_comment(&comment,&sus) ){ |
| 2912 | blob_appendf(&sus, "Continue (y/n/E=edit)? "); |
| 2913 | prompt_user(blob_str(&sus), &ans); |
| 2914 | cReply = blob_str(&ans)[0]; |
| 2915 | blob_reset(&ans); |
| 2916 | blob_reset(&sus); |
| 2917 | if( cReply=='n' || cReply=='N' ){ |
| 2918 | fossil_fatal("Commit aborted."); |
| 2919 | } |
| 2920 | if( cReply!='y' && cReply!='Y' ){ |
| 2921 | /* "Edit" is the default in case the user enters anything that |
| 2922 | ** does not start with Y or N - including just hitting return. */ |
| 2923 | fossil_free(zInit); |
| 2924 | continue; |
| 2925 | } |
| 2926 | } |
| 2927 | if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){ |
| 2928 | prompt_user("unchanged check-in comment. continue (y/N)? ", &ans); |
| 2929 | cReply = blob_str(&ans)[0]; |
| 2930 | blob_reset(&ans); |
| 2931 |