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.
Commit
6f0a9f730bfdd476f89d52bbe15ead50baebf385
Parent
6bcff72d23a4248…
1 file changed
+12
-1
+12
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -255,11 +255,13 @@ | ||
| 255 | 255 | char *zFile; |
| 256 | 256 | Blob text, line; |
| 257 | 257 | char *zComment; |
| 258 | 258 | int i; |
| 259 | 259 | 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" | |
| 261 | 263 | "#\n" |
| 262 | 264 | ); |
| 263 | 265 | status_report(&text, "# "); |
| 264 | 266 | zEditor = db_get("editor", 0); |
| 265 | 267 | if( zEditor==0 ){ |
| @@ -450,10 +452,19 @@ | ||
| 450 | 452 | if( zComment ){ |
| 451 | 453 | blob_zero(&comment); |
| 452 | 454 | blob_append(&comment, zComment, -1); |
| 453 | 455 | }else{ |
| 454 | 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 | + } | |
| 455 | 466 | } |
| 456 | 467 | |
| 457 | 468 | /* Step 1: Insert records for all modified files into the blob |
| 458 | 469 | ** table. If there were arguments passed to this command, only |
| 459 | 470 | ** the identified fils are inserted (if they have been modified). |
| 460 | 471 |
| --- 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 |