Diff
Not logged in

Differences From:

File src/info.c part of check-in [b2e55c0d4d] - Add the /wiki and /bwiki web pages. Currently renders content from the check-out as readonly. by drh on 2007-09-01 21:11:33. Also file src/info.c part of check-in [bbcb6326c9] - Pulled in the navbar and timeline changes. by aku on 2007-09-17 00:58:51. [view]

To:

File src/info.c part of check-in [3b5514ed82] - The "tag" command allows tag artifacts to be inserted for creating and cancelling tags and properties. Timeline responds to bgcolor, br-bgcolor, comment, and user properties. by drh on 2007-09-22 15:50:14. [view]

@@ -115,9 +115,10 @@
   Stmt q;
   int cnt = 0;
   db_prepare(&q,
     "SELECT plink.cid, blob.uuid, datetime(plink.mtime, 'localtime'),"
-    "       event.user, event.comment"
+    "       coalesce(event.euser,event.user),"
+    "       coalesce(event.comment,event.ecomment)"
     "  FROM plink, blob, event"
     " WHERE plink.pid=%d"
     "   AND blob.rid=plink.cid"
     "   AND event.objid=plink.cid"
@@ -150,8 +151,9 @@
       db_multi_exec("DELETE FROM leaves WHERE rid=%d", cid);
       @ <b>leaf</b>
     }
   }
+  db_finalize(&q);
   if( cnt ){
     @ </ul>
   }
   return cnt;
@@ -165,9 +167,10 @@
   Stmt q;
   int cnt = 0;
   db_prepare(&q,
     "SELECT plink.pid, blob.uuid, datetime(event.mtime, 'localtime'),"
-    "       event.user, event.comment"
+    "       coalesce(event.euser,event.user),"
+    "       coalesce(event.comment,event.ecomment)"
     "  FROM plink, blob, event"
     " WHERE plink.cid=%d"
     "   AND blob.rid=plink.pid"
     "   AND event.objid=plink.pid"
@@ -193,8 +196,9 @@
     if( depth ){
       showAncestors(cid, depth-1, 0);
     }
   }
+  db_finalize(&q);
   if( cnt ){
     @ </ul>
   }
 }
@@ -207,9 +211,10 @@
   Stmt q;
   int cnt = 0;
   db_prepare(&q,
     "SELECT blob.uuid, datetime(event.mtime, 'localtime'),"
-    "       event.user, event.comment"
+    "       coalesce(event.euser, event.user),"
+    "       coalesce(event.ecomment,event.comment)"
     "  FROM leaves, plink, blob, event"
     " WHERE plink.cid=leaves.rid"
     "   AND blob.rid=leaves.rid"
     "   AND event.objid=leaves.rid"
@@ -228,8 +233,59 @@
     @ <li>
     hyperlink_to_uuid(zUuid);
     @ %s(zCom) (by %s(zUser) on %s(zDate))
   }
+  db_finalize(&q);
+  if( cnt ){
+    @ </ul>
+  }
+}
+
+/*
+** Show information about all tags on a given node.
+*/
+static void showTags(int rid){
+  Stmt q;
+  int cnt = 0;
+  db_prepare(&q,
+    "SELECT tag.tagid, tagname, srcid, blob.uuid, value,"
+    "       datetime(tagxref.mtime,'localtime'), addflag"
+    "  FROM tagxref JOIN tag ON tagxref.tagid=tag.tagid"
+    "       LEFT JOIN blob ON blob.rid=tagxref.srcid"
+    " WHERE tagxref.rid=%d"
+    " ORDER BY tagname", rid
+  );
+  while( db_step(&q)==SQLITE_ROW ){
+    int tagid = db_column_int(&q, 0);
+    const char *zTagname = db_column_text(&q, 1);
+    int srcid = db_column_int(&q, 2);
+    const char *zUuid = db_column_text(&q, 3);
+    const char *zValue = db_column_text(&q, 4);
+    const char *zDate = db_column_text(&q, 5);
+    int addFlag = db_column_int(&q, 6);
+    cnt++;
+    if( cnt==1 ){
+      @ <h2>Tags And Properties</h2>
+      @ <ul>
+    }
+    @ <li>
+    @ <b>%h(zTagname)</b>
+    if( zValue ){
+      @ = %h(zValue)<i>
+    }else if( !addFlag ){
+      @ <i>Cancelled
+    }else{
+      @ <i>
+    }
+    if( srcid==0 ){
+      @ Inherited
+    }else if( zUuid ){
+      @ From
+      hyperlink_to_uuid(zUuid);
+    }
+    @ on %s(zDate)</i>
+  }
+  db_finalize(&q);
   if( cnt ){
     @ </ul>
   }
 }
@@ -267,10 +323,10 @@
     const char *zUuid = db_column_text(&q, 0);
     @ <h2>Version %s(zUuid)</h2>
     @ <ul>
     @ <li><b>Date:</b> %s(db_column_text(&q, 1))</li>
-    @ <li><b>User:</b> %s(db_column_text(&q, 2))</li>
-    @ <li><b>Comment:</b> %s(db_column_text(&q, 3))</li>
+    @ <li><b>Original&nbsp;User:</b> %s(db_column_text(&q, 2))</li>
+    @ <li><b>Original&nbsp;Comment:</b> %s(db_column_text(&q, 3))</li>
     @ <li><a href="%s(g.zBaseURL)/vdiff/%d(rid)">diff</a></li>
     @ <li><a href="%s(g.zBaseURL)/zip/%s(zUuid).zip">ZIP archive</a></li>
     @ <li><a href="%s(g.zBaseURL)/fview/%d(rid)">manifest</a></li>
     if( g.okSetup ){
@@ -278,8 +334,9 @@
     }
     @ </ul>
   }
   db_finalize(&q);
+  showTags(rid);
   @ <p><h2>Changes:</h2>
   @ <ul>
   db_prepare(&q,
      "SELECT name, pid, fid"
@@ -325,9 +382,11 @@
 
   zPrevDate[0] = 0;
   db_prepare(&q,
     "SELECT a.uuid, substr(b.uuid,1,10), datetime(event.mtime,'localtime'),"
-    "       event.comment, event.user, mlink.pid, mlink.fid"
+    "       coalesce(event.ecomment, event.comment),"
+    "       coalesce(event.euser, event.user),"
+    "       mlink.pid, mlink.fid"
     "  FROM mlink, blob a, blob b, event"
     " WHERE mlink.fnid=(SELECT fnid FROM filename WHERE name=%Q)"
     "   AND a.rid=mlink.mid"
     "   AND b.rid=mlink.fid"
@@ -450,9 +509,11 @@
   Stmt q;
   int cnt = 0;
   db_prepare(&q,
     "SELECT filename.name, datetime(event.mtime), substr(a.uuid,1,10),"
-    "       event.comment, event.user, b.uuid"
+    "       coalesce(event.comment,event.ecomment),"
+    "       coalesce(event.euser,event.user),"
+    "       b.uuid"
     "  FROM mlink, filename, event, blob a, blob b"
     " WHERE filename.fnid=mlink.fnid"
     "   AND event.objid=mlink.mid"
     "   AND a.rid=mlink.fid"