Check-in [f6790b7c3c]
Not logged in
Overview

SHA1 Hash:f6790b7c3cc237fac3d0cc064cb262d50fa12265
Date: 2009-02-26 01:21:04
User: drh
Comment:Fix a memory leak that was preventing massive check-ins.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/checkin.c from [a36b0dbf8a] to [54d694aac3].

@@ -409,10 +409,11 @@
   int forceFlag = 0;     /* Force a fork */
   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 */
   Blob cksum1, cksum2;   /* Before and after commit checksums */
@@ -422,10 +423,11 @@
   noSign = find_option("nosign",0,0)!=0;
   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();
 
@@ -535,10 +537,11 @@
     rid = db_column_int(&q, 2);
 
     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);
     db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nrid);
@@ -549,11 +552,11 @@
   blob_zero(&manifest);
   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"
     "  FROM vfile JOIN blob ON vfile.mrid=blob.rid"