Fossil SCM
Add the -m/--comment and the --nosign options to the commit command.
Commit
9a9cd81738888041afac26108b598155b8a52140
Parent
13b7ac16e4e5aee…
1 file changed
+10
-2
+10
-2
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -267,10 +267,11 @@ | ||
| 267 | 267 | */ |
| 268 | 268 | void commit_cmd(void){ |
| 269 | 269 | int rc; |
| 270 | 270 | int vid, nrid, nvid; |
| 271 | 271 | Blob comment; |
| 272 | + const char *zComment; | |
| 272 | 273 | Stmt q; |
| 273 | 274 | Stmt q2; |
| 274 | 275 | char *zUuid, *zDate; |
| 275 | 276 | int noSign = 0; /* True to omit signing the manifest using GPG */ |
| 276 | 277 | char *zManifestFile; /* Name of the manifest file */ |
| @@ -277,12 +278,14 @@ | ||
| 277 | 278 | Blob manifest; |
| 278 | 279 | Blob mcksum; /* Self-checksum on the manifest */ |
| 279 | 280 | Blob cksum1, cksum2; /* Before and after commit checksums */ |
| 280 | 281 | Blob cksum1b; /* Checksum recorded in the manifest */ |
| 281 | 282 | |
| 283 | + noSign = find_option("nosign","",0)!=0; | |
| 284 | + zComment = find_option("comment","m",1); | |
| 282 | 285 | db_must_be_within_tree(); |
| 283 | - noSign = db_get_int("omit-ci-sig", 0); | |
| 286 | + noSign = db_get_int("omit-ci-sig", 0)|noSign; | |
| 284 | 287 | verify_all_options(); |
| 285 | 288 | |
| 286 | 289 | /* There are two ways this command may be executed. If there are |
| 287 | 290 | ** no arguments following the word "commit", then all modified files |
| 288 | 291 | ** in the checked out directory are committed. If one or more arguments |
| @@ -320,11 +323,16 @@ | ||
| 320 | 323 | } |
| 321 | 324 | } |
| 322 | 325 | |
| 323 | 326 | vid = db_lget_int("checkout", 0); |
| 324 | 327 | vfile_aggregate_checksum_disk(vid, &cksum1); |
| 325 | - prepare_commit_comment(&comment); | |
| 328 | + if( zComment ){ | |
| 329 | + blob_zero(&comment); | |
| 330 | + blob_append(&comment, zComment, -1); | |
| 331 | + }else{ | |
| 332 | + prepare_commit_comment(&comment); | |
| 333 | + } | |
| 326 | 334 | |
| 327 | 335 | /* Step 1: Insert records for all modified files into the blob |
| 328 | 336 | ** table. If there were arguments passed to this command, only |
| 329 | 337 | ** the identified fils are inserted (if they have been modified). |
| 330 | 338 | */ |
| 331 | 339 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -267,10 +267,11 @@ | |
| 267 | */ |
| 268 | void commit_cmd(void){ |
| 269 | int rc; |
| 270 | int vid, nrid, nvid; |
| 271 | Blob comment; |
| 272 | Stmt q; |
| 273 | Stmt q2; |
| 274 | char *zUuid, *zDate; |
| 275 | int noSign = 0; /* True to omit signing the manifest using GPG */ |
| 276 | char *zManifestFile; /* Name of the manifest file */ |
| @@ -277,12 +278,14 @@ | |
| 277 | Blob manifest; |
| 278 | Blob mcksum; /* Self-checksum on the manifest */ |
| 279 | Blob cksum1, cksum2; /* Before and after commit checksums */ |
| 280 | Blob cksum1b; /* Checksum recorded in the manifest */ |
| 281 | |
| 282 | db_must_be_within_tree(); |
| 283 | noSign = db_get_int("omit-ci-sig", 0); |
| 284 | verify_all_options(); |
| 285 | |
| 286 | /* There are two ways this command may be executed. If there are |
| 287 | ** no arguments following the word "commit", then all modified files |
| 288 | ** in the checked out directory are committed. If one or more arguments |
| @@ -320,11 +323,16 @@ | |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | vid = db_lget_int("checkout", 0); |
| 324 | vfile_aggregate_checksum_disk(vid, &cksum1); |
| 325 | prepare_commit_comment(&comment); |
| 326 | |
| 327 | /* Step 1: Insert records for all modified files into the blob |
| 328 | ** table. If there were arguments passed to this command, only |
| 329 | ** the identified fils are inserted (if they have been modified). |
| 330 | */ |
| 331 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -267,10 +267,11 @@ | |
| 267 | */ |
| 268 | void commit_cmd(void){ |
| 269 | int rc; |
| 270 | int vid, nrid, nvid; |
| 271 | Blob comment; |
| 272 | const char *zComment; |
| 273 | Stmt q; |
| 274 | Stmt q2; |
| 275 | char *zUuid, *zDate; |
| 276 | int noSign = 0; /* True to omit signing the manifest using GPG */ |
| 277 | char *zManifestFile; /* Name of the manifest file */ |
| @@ -277,12 +278,14 @@ | |
| 278 | Blob manifest; |
| 279 | Blob mcksum; /* Self-checksum on the manifest */ |
| 280 | Blob cksum1, cksum2; /* Before and after commit checksums */ |
| 281 | Blob cksum1b; /* Checksum recorded in the manifest */ |
| 282 | |
| 283 | noSign = find_option("nosign","",0)!=0; |
| 284 | zComment = find_option("comment","m",1); |
| 285 | db_must_be_within_tree(); |
| 286 | noSign = db_get_int("omit-ci-sig", 0)|noSign; |
| 287 | verify_all_options(); |
| 288 | |
| 289 | /* There are two ways this command may be executed. If there are |
| 290 | ** no arguments following the word "commit", then all modified files |
| 291 | ** in the checked out directory are committed. If one or more arguments |
| @@ -320,11 +323,16 @@ | |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | vid = db_lget_int("checkout", 0); |
| 327 | vfile_aggregate_checksum_disk(vid, &cksum1); |
| 328 | if( zComment ){ |
| 329 | blob_zero(&comment); |
| 330 | blob_append(&comment, zComment, -1); |
| 331 | }else{ |
| 332 | prepare_commit_comment(&comment); |
| 333 | } |
| 334 | |
| 335 | /* Step 1: Insert records for all modified files into the blob |
| 336 | ** table. If there were arguments passed to this command, only |
| 337 | ** the identified fils are inserted (if they have been modified). |
| 338 | */ |
| 339 |