Diff
Not logged in

Differences From:

File src/checkin.c part of check-in [c5f4ec0ed5] - Undo inadvertant hacking changes in previous ci (should have been documentation only) by bharder on 2009-02-21 18:59:46. Also file src/checkin.c part of check-in [8be6204607] - 'fossil' encode tagnames for manifest (for ticket 15f49be6b2b1e) (allows for tags with spaces in name) by bharder on 2009-02-09 04:41:08. [view]

To:

File src/checkin.c part of check-in [f6790b7c3c] - Fix a memory leak that was preventing massive check-ins. by drh on 2009-02-26 01:21:04. [view]

@@ -410,8 +410,9 @@
   char *zManifestFile;   /* Name of the manifest file */
   int nBasename;         /* Length of "g.zLocalRoot/" */
   const char *zBranch;   /* Create a new branch with this name */
   const char *zBgColor;  /* Set background color when branching */
+  const char *zDateOvrd; /* Override date string */
   Blob filename;         /* complete filename */
   Blob manifest;
   Blob muuid;            /* Manifest uuid */
   Blob mcksum;           /* Self-checksum on the manifest */
@@ -423,8 +424,9 @@
   zComment = find_option("comment","m",1);
   forceFlag = find_option("force", "f", 0)!=0;
   zBranch = find_option("branch","b",1);
   zBgColor = find_option("bgcolor",0,1);
+  zDateOvrd = find_option("date-override",0,1);
   db_must_be_within_tree();
   noSign = db_get_boolean("omitsign", 0)|noSign;
   if( db_get_boolean("clearsign", 1)==0 ){ noSign = 1; }
   verify_all_options();
@@ -536,8 +538,9 @@
 
     blob_zero(&content);
     blob_read_from_file(&content, zFullname);
     nrid = content_put(&content, 0, 0);
+    blob_reset(&content);
     if( rid>0 ){
       content_deltify(rid, nrid, 0);
     }
     db_multi_exec("UPDATE vfile SET mrid=%d, rid=%d WHERE id=%d", nrid,nrid,id);
@@ -550,9 +553,9 @@
   if( blob_size(&comment)==0 ){
     blob_append(&comment, "(no comment)", -1);
   }
   blob_appendf(&manifest, "C %F\n", blob_str(&comment));
-  zDate = db_text(0, "SELECT datetime('now')");
+  zDate = db_text(0, "SELECT datetime('%q')", zDateOvrd ? zDateOvrd : "now");
   zDate[10] = 'T';
   blob_appendf(&manifest, "D %s\n", zDate);
   db_prepare(&q,
     "SELECT pathname, uuid, origname"