Check-in [9a9cd81738]
Not logged in
Overview

SHA1 Hash:9a9cd81738888041afac26108b598155b8a52140
Date: 2007-08-09 10:48:51
User: drh
Comment:Add the -m/--comment and the --nosign options to the commit command.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/checkin.c from [c7f6520303] to [bad8f191d4].

@@ -267,10 +267,11 @@
 */
 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 */
   char *zManifestFile;   /* Name of the manifest file */
@@ -277,12 +278,14 @@
   Blob manifest;
   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
   ** in the checked out directory are committed. If one or more arguments
@@ -320,11 +323,16 @@
     }
   }
 
   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).
   */