Check-in [72b3b1ad47]
Not logged in
Overview

SHA1 Hash:72b3b1ad47f479df8f0046b6a69fbd4d51d4882b
Date: 2007-09-22 18:13:31
User: drh
Comment:Incremental web interface enhancments.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/info.c from [ae734c2dfe] to [51260a23a7].

@@ -212,13 +212,12 @@
   int cnt = 0;
   db_prepare(&q,
     "SELECT blob.uuid, datetime(event.mtime, 'localtime'),"
     "       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"
+    "  FROM leaves, blob, event"
+    " WHERE blob.rid=leaves.rid"
     "   AND event.objid=leaves.rid"
     " ORDER BY event.mtime DESC"
   );
   while( db_step(&q)==SQLITE_ROW ){
     const char *zUuid = db_column_text(&q, 0);
@@ -253,11 +252,10 @@
     "       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);
@@ -545,18 +543,19 @@
   while( db_step(&q)==SQLITE_ROW ){
     const char *zDate = db_column_text(&q, 0);
     const char *zUuid = db_column_text(&q, 3);
     const char *zCom = db_column_text(&q, 2);
     const char *zUser = db_column_text(&q, 1);
-    @ Version
+    @ Manifest of version
     hyperlink_to_uuid(zUuid);
     @ %s(zCom) by %s(zUser) on %s(zDate).
     cnt++;
   }
   db_finalize(&q);
   if( cnt==0 ){
-    @ Empty file
+    char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
+    @ Control file %s(zUuid).
   }else if( linkToView ){
     @ <a href="%s(g.zBaseURL)/fview/%d(rid)">[view]</a>
   }
 }
 
@@ -565,12 +564,12 @@
 **
 ** Two arguments, v1 and v2, are integers.  Show the difference between
 ** the two records.
 */
 void diff_page(void){
-  int v1 = atoi(PD("v1","0"));
-  int v2 = atoi(PD("v2","0"));
+  int v1 = name_to_rid(PD("v1","0"));
+  int v2 = name_to_rid(PD("v2","0"));
   Blob c1, c2, diff;
 
   login_check_credentials();
   if( !g.okHistory ){ login_needed(); return; }
   style_header("Diff");
@@ -595,10 +594,11 @@
   blob_reset(&diff);
   style_footer();
 }
 
 /*
+** WEBPAGE: info
 ** WEBPAGE: fview
 ** URL: /fview/UUID
 **
 ** Show the complete content of a file identified by UUID
 ** as preformatted text.
@@ -608,10 +608,15 @@
   Blob content;
 
   rid = name_to_rid(g.zExtra);
   login_check_credentials();
   if( !g.okHistory ){ login_needed(); return; }
+  if( g.zPath[0]=='i' &&
+      db_exists("SELECT 1 FROM plink WHERE cid=%d", rid) ){
+    vinfo_page();
+    return;
+  }
   style_header("File Content");
   @ <h2>Content Of:</h2>
   @ <blockquote>
   object_description(rid, 0);
   @ </blockquote>

Modified src/schema.c from [a15ec88bcc] to [051f5076cf].

@@ -126,10 +126,13 @@
 @   name TEXT UNIQUE             -- Name of file page
 @ );
 @
 @ -- Linkages between manifests, files created by that manifest, and
 @ -- the names of those files.
+@ --
+@ -- pid==0 if the file is added by check-in mid.
+@ -- fid==0 if the file is removed by check-in mid.
 @ --
 @ CREATE TABLE mlink(
 @   mid INTEGER REFERENCES blob,        -- Manifest ID where change occurs
 @   pid INTEGER REFERENCES blob,        -- File ID in parent manifest
 @   fid INTEGER REFERENCES blob,        -- Changed file ID in this manifest

Modified src/timeline.c from [e450db18e8] to [a8be29736d].

@@ -33,11 +33,11 @@
 */
 void hyperlink_to_uuid(const char *zUuid){
   char zShortUuid[UUID_SIZE+1];
   sprintf(zShortUuid, "%.10s", zUuid);
   if( g.okHistory ){
-    @ <a href="%s(g.zBaseURL)/vinfo/%s(zUuid)">[%s(zShortUuid)]</a>
+    @ <a href="%s(g.zBaseURL)/info/%s(zUuid)">[%s(zShortUuid)]</a>
   }else{
     @ <b>[%s(zShortUuid)]</b>
   }
 }