Diff
Not logged in

Differences From:

File src/timeline.c part of check-in [b7f32a71ab] - Add web-based branch color changer. Add the "branch list" command. Simplifications to color propagation logic. by drh on 2009-01-20 22:21:24. [view]

To:

File src/timeline.c part of check-in [fecb3e5cc9] - On the "vinfo" page, add a link to a timeline of all other check-ins with the same tag. by drh on 2009-01-20 23:39:50. [view]

@@ -271,8 +271,9 @@
 **    b=TIMESTAMP    before this date.
 **    n=COUNT        number of events in output
 **    p=RID          artifact RID and up to COUNT parents and ancestors
 **    d=RID          artifact RID and up to COUNT descendants
+**    t=TAGID        show only check-ins with the given tagid
 **    u=USER         only if belonging to this user
 **    y=TYPE         'ci', 'w', 't'
 **
 ** p= and d= can appear individually or together.  If either p= or d=
@@ -289,8 +290,9 @@
   Blob desc;                         /* Description of the timeline */
   int nEntry = atoi(PD("n","20"));   /* Max number of entries on timeline */
   int p_rid = atoi(PD("p","0"));     /* artifact p and its parents */
   int d_rid = atoi(PD("d","0"));     /* artifact d and its descendants */
+  int tagid = atoi(PD("t","0"));     /* Show checkins of a given tag */
   const char *zUser = P("u");        /* All entries by this user if not NULL */
   const char *zType = PD("y","all"); /* Type of events.  All if NULL */
   const char *zAfter = P("a");       /* Events after this time */
   const char *zBefore = P("b");      /* Events before this time */
@@ -344,9 +346,20 @@
                    g.zBaseURL, zUuid, zUuid);
     }else{
       blob_appendf(&desc, " of [%.10s]", zUuid);
     }
-    db_prepare(&q, "SELECT * FROM timeline ORDER BY timestamp DESC");
+  }else if( tagid>0 ){
+    /* If t= is present, ignore all other parameters.  Show everything
+    ** with that tag. */
+    blob_appendf(&sql, " AND event.type='ci'");
+    blob_appendf(&sql, " AND EXISTS (SELECT 1 FROM tagxref WHERE tagid=%d"
+                                      " AND tagtype>0 AND rid=blob.rid)",
+                 tagid);
+    db_multi_exec("%s", blob_str(&sql));
+    blob_appendf(&desc, "All check-ins tagged with \"%h\"",
+       db_text("??", "SELECT substr(tagname,5) FROM tag WHERE tagid=%d",
+               tagid)
+    );
   }else{
     int n;
     const char *zEType = "event";
     char *zDate;