Fossil SCM

Mention that check-in comments follow wiki formatting rules. If the check-in comment is blank, prompt the user to abort the check-in.

drh 2008-11-26 03:26 trunk
Commit 6f0a9f730bfdd476f89d52bbe15ead50baebf385
1 file changed +12 -1
+12 -1
--- src/checkin.c
+++ src/checkin.c
@@ -255,11 +255,13 @@
255255
char *zFile;
256256
Blob text, line;
257257
char *zComment;
258258
int i;
259259
blob_set(&text,
260
- "\n# Enter comments on this commit. Lines beginning with # are ignored\n"
260
+ "\n"
261
+ "# Enter comments on this check-in. Lines beginning with # are ignored.\n"
262
+ "# The check-in comment follows wiki formatting rules.\n"
261263
"#\n"
262264
);
263265
status_report(&text, "# ");
264266
zEditor = db_get("editor", 0);
265267
if( zEditor==0 ){
@@ -450,10 +452,19 @@
450452
if( zComment ){
451453
blob_zero(&comment);
452454
blob_append(&comment, zComment, -1);
453455
}else{
454456
prepare_commit_comment(&comment);
457
+ if( blob_size(&comment)==0 ){
458
+ Blob ans;
459
+ blob_zero(&ans);
460
+ prompt_user("empty check-in comment. continue [y/N]? ", &ans);
461
+ if( blob_str(&ans)[0]!='y' ){
462
+ db_end_transaction(1);
463
+ exit(1);
464
+ }
465
+ }
455466
}
456467
457468
/* Step 1: Insert records for all modified files into the blob
458469
** table. If there were arguments passed to this command, only
459470
** the identified fils are inserted (if they have been modified).
460471
--- src/checkin.c
+++ src/checkin.c
@@ -255,11 +255,13 @@
255 char *zFile;
256 Blob text, line;
257 char *zComment;
258 int i;
259 blob_set(&text,
260 "\n# Enter comments on this commit. Lines beginning with # are ignored\n"
 
 
261 "#\n"
262 );
263 status_report(&text, "# ");
264 zEditor = db_get("editor", 0);
265 if( zEditor==0 ){
@@ -450,10 +452,19 @@
450 if( zComment ){
451 blob_zero(&comment);
452 blob_append(&comment, zComment, -1);
453 }else{
454 prepare_commit_comment(&comment);
 
 
 
 
 
 
 
 
 
455 }
456
457 /* Step 1: Insert records for all modified files into the blob
458 ** table. If there were arguments passed to this command, only
459 ** the identified fils are inserted (if they have been modified).
460
--- src/checkin.c
+++ src/checkin.c
@@ -255,11 +255,13 @@
255 char *zFile;
256 Blob text, line;
257 char *zComment;
258 int i;
259 blob_set(&text,
260 "\n"
261 "# Enter comments on this check-in. Lines beginning with # are ignored.\n"
262 "# The check-in comment follows wiki formatting rules.\n"
263 "#\n"
264 );
265 status_report(&text, "# ");
266 zEditor = db_get("editor", 0);
267 if( zEditor==0 ){
@@ -450,10 +452,19 @@
452 if( zComment ){
453 blob_zero(&comment);
454 blob_append(&comment, zComment, -1);
455 }else{
456 prepare_commit_comment(&comment);
457 if( blob_size(&comment)==0 ){
458 Blob ans;
459 blob_zero(&ans);
460 prompt_user("empty check-in comment. continue [y/N]? ", &ans);
461 if( blob_str(&ans)[0]!='y' ){
462 db_end_transaction(1);
463 exit(1);
464 }
465 }
466 }
467
468 /* Step 1: Insert records for all modified files into the blob
469 ** table. If there were arguments passed to this command, only
470 ** the identified fils are inserted (if they have been modified).
471

Keyboard Shortcuts

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