Fossil SCM

Add the -m/--comment and the --nosign options to the commit command.

drh 2007-08-09 10:48 trunk
Commit 9a9cd81738888041afac26108b598155b8a52140
1 file changed +10 -2
+10 -2
--- src/checkin.c
+++ src/checkin.c
@@ -267,10 +267,11 @@
267267
*/
268268
void commit_cmd(void){
269269
int rc;
270270
int vid, nrid, nvid;
271271
Blob comment;
272
+ const char *zComment;
272273
Stmt q;
273274
Stmt q2;
274275
char *zUuid, *zDate;
275276
int noSign = 0; /* True to omit signing the manifest using GPG */
276277
char *zManifestFile; /* Name of the manifest file */
@@ -277,12 +278,14 @@
277278
Blob manifest;
278279
Blob mcksum; /* Self-checksum on the manifest */
279280
Blob cksum1, cksum2; /* Before and after commit checksums */
280281
Blob cksum1b; /* Checksum recorded in the manifest */
281282
283
+ noSign = find_option("nosign","",0)!=0;
284
+ zComment = find_option("comment","m",1);
282285
db_must_be_within_tree();
283
- noSign = db_get_int("omit-ci-sig", 0);
286
+ noSign = db_get_int("omit-ci-sig", 0)|noSign;
284287
verify_all_options();
285288
286289
/* There are two ways this command may be executed. If there are
287290
** no arguments following the word "commit", then all modified files
288291
** in the checked out directory are committed. If one or more arguments
@@ -320,11 +323,16 @@
320323
}
321324
}
322325
323326
vid = db_lget_int("checkout", 0);
324327
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
+ }
326334
327335
/* Step 1: Insert records for all modified files into the blob
328336
** table. If there were arguments passed to this command, only
329337
** the identified fils are inserted (if they have been modified).
330338
*/
331339
--- 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

Keyboard Shortcuts

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