Diff
Not logged in

Differences From:

File src/checkin.c part of check-in [77327ae14e] - Omit the files "manifest" and "_FOSSIL_" from the "extra" list. by drh on 2007-08-08 14:45:20. [view]

To:

File src/checkin.c part of check-in [9a9cd81738] - Add the -m/--comment and the --nosign options to the commit command. by drh on 2007-08-09 10:48:51. [view]

@@ -268,8 +268,9 @@
 void commit_cmd(void){
   int rc;
   int vid, nrid, nvid;
   Blob comment;
+  const char *zComment;
   Stmt q;
   Stmt q2;
   char *zUuid, *zDate;
   int noSign = 0;        /* True to omit signing the manifest using GPG */
@@ -278,10 +279,12 @@
   Blob mcksum;           /* Self-checksum on the manifest */
   Blob cksum1, cksum2;   /* Before and after commit checksums */
   Blob cksum1b;          /* Checksum recorded in the manifest */
 
+  noSign = find_option("nosign","",0)!=0;
+  zComment = find_option("comment","m",1);
   db_must_be_within_tree();
-  noSign = db_get_int("omit-ci-sig", 0);
+  noSign = db_get_int("omit-ci-sig", 0)|noSign;
   verify_all_options();
 
   /* There are two ways this command may be executed. If there are
   ** no arguments following the word "commit", then all modified files
@@ -321,9 +324,14 @@
   }
 
   vid = db_lget_int("checkout", 0);
   vfile_aggregate_checksum_disk(vid, &cksum1);
-  prepare_commit_comment(&comment);
+  if( zComment ){
+    blob_zero(&comment);
+    blob_append(&comment, zComment, -1);
+  }else{
+    prepare_commit_comment(&comment);
+  }
 
   /* Step 1: Insert records for all modified files into the blob
   ** table. If there were arguments passed to this command, only
   ** the identified fils are inserted (if they have been modified).