Check-in [ee544f4843]
Not logged in
Overview

SHA1 Hash:ee544f4843b0d176492a689d839cb79860495517
Date: 2009-08-29 18:47:02
User: drh
Comment:Better descriptions of raw artifacts on the "artifact" URL.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/info.c from [3701ba08d0] to [3f3e3d13b1].

@@ -627,11 +627,11 @@
 ){
   Stmt q;
   int cnt = 0;
   int nWiki = 0;
   db_prepare(&q,
-    "SELECT filename.name, datetime(event.mtime), substr(a.uuid,1,10),"
+    "SELECT filename.name, datetime(event.mtime),"
     "       coalesce(event.ecomment,event.comment),"
     "       coalesce(event.euser,event.user),"
     "       b.uuid"
     "  FROM mlink, filename, event, blob a, blob b"
     " WHERE filename.fnid=mlink.fnid"
@@ -642,21 +642,20 @@
     rid
   );
   while( db_step(&q)==SQLITE_ROW ){
     const char *zName = db_column_text(&q, 0);
     const char *zDate = db_column_text(&q, 1);
-    const char *zFuuid = db_column_text(&q, 2);
-    const char *zCom = db_column_text(&q, 3);
-    const char *zUser = db_column_text(&q, 4);
-    const char *zVers = db_column_text(&q, 5);
+    const char *zCom = db_column_text(&q, 2);
+    const char *zUser = db_column_text(&q, 3);
+    const char *zVers = db_column_text(&q, 4);
     if( cnt>0 ){
       @ Also file
     }else{
       @ File
     }
     @ <a href="%s(g.zBaseURL)/finfo?name=%T(zName)">%h(zName)</a>
-    @ artifact %s(zFuuid) part of check-in
+    @ part of check-in
     hyperlink_to_uuid(zVers);
     @ - %w(zCom) by
     hyperlink_to_user(zUser,zDate," on");
     hyperlink_to_date(zDate,".");
     cnt++;
@@ -665,31 +664,29 @@
     }
   }
   db_finalize(&q);
   db_prepare(&q,
     "SELECT substr(tagname, 6, 10000), datetime(event.mtime),"
-    "       coalesce(event.euser, event.user), uuid"
-    "  FROM tagxref, tag, event, blob"
+    "       coalesce(event.euser, event.user)"
+    "  FROM tagxref, tag, event"
     " WHERE tagxref.rid=%d"
     "   AND tag.tagid=tagxref.tagid"
     "   AND tag.tagname LIKE 'wiki-%%'"
-    "   AND event.objid=tagxref.rid"
-    "   AND blob.rid=tagxref.rid",
+    "   AND event.objid=tagxref.rid",
     rid
   );
   while( db_step(&q)==SQLITE_ROW ){
     const char *zPagename = db_column_text(&q, 0);
     const char *zDate = db_column_text(&q, 1);
     const char *zUser = db_column_text(&q, 2);
-    const char *zUuid = db_column_text(&q, 3);
     if( cnt>0 ){
       @ Also wiki page
     }else{
       @ Wiki page
     }
     @ [<a href="%s(g.zBaseURL)/wiki?name=%t(zPagename)">%h(zPagename)</a>]
-    @ artifact %s(zUuid) by
+    @ by
     hyperlink_to_user(zUser,zDate," on");
     hyperlink_to_date(zDate,".");
     nWiki++;
     cnt++;
     if( pDownloadName && blob_size(pDownloadName)==0 ){
@@ -697,22 +694,22 @@
     }
   }
   db_finalize(&q);
   if( nWiki==0 ){
     db_prepare(&q,
-      "SELECT datetime(mtime), user, comment, uuid, type"
+      "SELECT datetime(mtime), user, comment, type, uuid"
       "  FROM event, blob"
       " WHERE event.objid=%d"
       "   AND blob.rid=%d",
       rid, rid
     );
     while( db_step(&q)==SQLITE_ROW ){
       const char *zDate = db_column_text(&q, 0);
-      const char *zUuid = db_column_text(&q, 3);
       const char *zUser = db_column_text(&q, 1);
       const char *zCom = db_column_text(&q, 2);
-      const char *zType = db_column_text(&q, 4);
+      const char *zType = db_column_text(&q, 3);
+      const char *zUuid = db_column_text(&q, 4);
       if( cnt>0 ){
         @ Also
       }
       if( zType[0]=='w' ){
         @ Wiki edit
@@ -734,11 +731,11 @@
     }
     db_finalize(&q);
   }
   if( cnt==0 ){
     char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
-    @ Control file %s(zUuid).
+    @ Control artifact.
     if( pDownloadName && blob_size(pDownloadName)==0 ){
       blob_append(pDownloadName, zUuid, -1);
     }
   }else if( linkToView ){
     @ <a href="%s(g.zBaseURL)/artifact/%d(rid)">[view]</a>
@@ -864,10 +861,11 @@
 */
 void hexdump_page(void){
   int rid;
   Blob content;
   Blob downloadName;
+  char *zUuid;
 
   rid = name_to_rid(PD("name","0"));
   login_check_credentials();
   if( !g.okRead ){ login_needed(); return; }
   if( rid==0 ){ cgi_redirect("/home"); }
@@ -880,11 +878,12 @@
       style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
             g.zTop, zUuid);
     }
   }
   style_header("Hex Artifact Content");
-  @ <h2>Hexadecimal Content Of:</h2>
+  zUuid = db_text("?","SELECT uuid FROM blob WHERE rid=%d", rid);
+  @ <h2>Artifact %s(zUuid):</h2>
   @ <blockquote>
   blob_zero(&downloadName);
   object_description(rid, 0, &downloadName);
   style_submenu_element("Download", "Download",
         "%s/raw/%T?name=%d", g.zBaseURL, blob_str(&downloadName), rid);
@@ -909,10 +908,11 @@
   Blob content;
   const char *zMime;
   Blob downloadName;
   int renderAsWiki = 0;
   int renderAsHtml = 0;
+  const char *zUuid;
 
   rid = name_to_rid(PD("name","0"));
   login_check_credentials();
   if( !g.okRead ){ login_needed(); return; }
   if( rid==0 ){ cgi_redirect("/home"); }
@@ -925,11 +925,12 @@
       style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
             g.zTop, zUuid);
     }
   }
   style_header("Artifact Content");
-  @ <h2>Content Of:</h2>
+  zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid);
+  @ <h2>Artifact %s(zUuid)</h2>
   @ <blockquote>
   blob_zero(&downloadName);
   object_description(rid, 0, &downloadName);
   style_submenu_element("Download", "Download",
           "%s/raw/%T?name=%d", g.zTop, blob_str(&downloadName), rid);