Diff
Not logged in

Differences From:

File src/descendents.c part of check-in [bc68e61bb2] - Rename CLI commands: leaves->descendents and branches->leaves. by drh on 2007-09-14 21:24:15. Also file src/descendents.c part of check-in [f76192b245] - Pulled the latest CLI, website, and sqlite changes into the importer branch. by aku on 2007-09-17 01:00:32. [view]

To:

File src/descendents.c part of check-in [9395aba4f4] - Timeline now responses to comment and user properties. by drh on 2007-09-22 12:38:05. Also file src/descendents.c part of check-in [d0305b305a] - Merged mainline into my branch to get the newest application. by aku on 2007-12-05 08:07:46. [view]

@@ -148,14 +148,12 @@
   }
   if( base==0 ) return;
   compute_leaves(base);
   db_prepare(&q,
-    "SELECT blob.rid, uuid, datetime(event.mtime,'localtime'), comment, 0,"
-    "       (SELECT count(*) FROM plink WHERE cid=blob.rid)"
-    "  FROM leaves, blob, event"
-    " WHERE blob.rid=leaves.rid"
-    "   AND event.objid=leaves.rid"
-    " ORDER BY event.mtime DESC"
+    "%s"
+    "   AND event.objid IN (SELECT rid FROM leaves)"
+    " ORDER BY event.mtime DESC",
+    timeline_query_for_tty()
   );
   print_timeline(&q, 20);
   db_finalize(&q);
 }
@@ -170,16 +168,13 @@
   Stmt q;
 
   db_must_be_within_tree();
   db_prepare(&q,
-    "SELECT blob.rid, blob.uuid, datetime(event.mtime,'localtime'),"
-    "       event.comment, 0,"
-    "       (SELECT count(*) FROM plink WHERE cid=blob.rid)"
-    "  FROM blob, event"
-    " WHERE blob.rid IN"
+    "%s"
+    "   AND blob.rid IN"
     "       (SELECT cid FROM plink EXCEPT SELECT pid FROM plink)"
-    "   AND event.objid=blob.rid"
-    " ORDER BY event.mtime DESC"
+    " ORDER BY event.mtime DESC",
+    timeline_query_for_tty()
   );
   print_timeline(&q, 2000);
   db_finalize(&q);
 }
@@ -196,15 +191,13 @@
   if( !g.okRead ){ login_needed(); return; }
 
   style_header("Leaves");
   db_prepare(&q,
-    "SELECT blob.rid, blob.uuid, datetime(event.mtime,'localtime'),"
-    "       event.comment, event.user, 1, 1, 0"
-    "  FROM blob, event"
-    " WHERE blob.rid IN"
+    "%s"
+    "   AND blob.rid IN"
     "       (SELECT cid FROM plink EXCEPT SELECT pid FROM plink)"
-    "   AND event.objid=blob.rid"
-    " ORDER BY event.mtime DESC"
+    " ORDER BY event.mtime DESC",
+    timeline_query_for_www()
   );
   www_print_timeline(&q, 0, 0, 0, 0);
   db_finalize(&q);
   @ <script>