Diff
Not logged in

Differences From:

File src/info.c part of check-in [5a539f82dc] - Add the "circa" capability to the timeline. Check-in hyperlinks go to the "diff" page by default, rather than the "detail" page. by drh on 2009-08-15 16:47:42. [view]

To:

File src/info.c part of check-in [ac03d43348] - Add the ability to edit check-in dates using control artifacts. Useful if a user does a check-in when their system clock is set incorrectly thus causing an incorrect timestamp to appear on the check-in artifact. You must run "fossil all rebuild" after upgrading to this or any later version of fossil from a prior version. by drh on 2009-08-21 16:25:30. [view]

@@ -1242,12 +1242,14 @@
 **     *  The background color.
 */
 void ci_edit_page(void){
   int rid;
-  const char *zComment;
-  const char *zNewComment;
-  const char *zUser;
-  const char *zNewUser;
+  const char *zComment;         /* Current comment on the check-in */
+  const char *zNewComment;      /* Revised check-in comment */
+  const char *zUser;            /* Current user for the check-in */
+  const char *zNewUser;         /* Revised user */
+  const char *zDate;            /* Current date of the check-in */
+  const char *zNewDate;         /* Revised check-in date */
   const char *zColor;
   const char *zNewColor;
   const char *zNewTagFlag;
   const char *zNewTag;
@@ -1292,8 +1294,12 @@
   zUser = db_text(0, "SELECT coalesce(euser,user)"
                      "  FROM event WHERE objid=%d", rid);
   if( zUser==0 ) fossil_redirect_home();
   zNewUser = PD("u",zUser);
+  zDate = db_text(0, "SELECT datetime(mtime)"
+                     "  FROM event WHERE objid=%d", rid);
+  if( zDate==0 ) fossil_redirect_home();
+  zNewDate = PD("dt",zDate);
   zColor = db_text("", "SELECT bgcolor"
                         "  FROM event WHERE objid=%d", rid);
   zNewColor = PD("clr",zColor);
   fPropagateColor = P("pclr")!=0;
@@ -1326,8 +1332,12 @@
     }
     if( strcmp(zComment,zNewComment)!=0 ){
       db_multi_exec("REPLACE INTO newtags VALUES('comment','+',%Q)",
                     zNewComment);
+    }
+    if( strcmp(zDate,zNewDate)!=0 ){
+      db_multi_exec("REPLACE INTO newtags VALUES('date','+',%Q)",
+                    zNewDate);
     }
     if( strcmp(zUser,zNewUser)!=0 ){
       db_multi_exec("REPLACE INTO newtags VALUES('user','+',%Q)", zNewUser);
     }
@@ -1445,8 +1455,13 @@
 
   @ <tr><td align="right" valign="top"><b>Comment:</b></td>
   @ <td valign="top">
   @ <textarea name="c" rows="10" cols="80">%h(zNewComment)</textarea>
+  @ </td></tr>
+
+  @ <tr><td align="right" valign="top"><b>Check-in Time:</b></td>
+  @ <td valign="top">
+  @   <input type="text" name="dt" size="20" value="%h(zNewDate)">
   @ </td></tr>
 
   @ <tr><td align="right" valign="top"><b>Background Color:</b></td>
   @ <td valign="top">