Overview
SHA1 Hash: | fecb3e5cc90bf751160b0c6140da725a48f2a802 |
---|---|
Date: | 2009-01-20 23:39:50 |
User: | drh |
Comment: | On the "vinfo" page, add a link to a timeline of all other check-ins with the same tag. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/branch.c from [a8d6e457d2] to [124ac5fc7f].
@@ -211,6 +211,36 @@ db_finalize(&q); }else{ fossil_panic("branch subcommand should be one of: " "new list"); } +} + +/* +** WEBPAGE: brlist +** +** Show a timeline of all branches +*/ +void brlist_page(void){ + Stmt q; + + login_check_credentials(); + if( !g.okRead ){ login_needed(); return; } + + style_header("Branches"); + login_anonymous_available(); + db_prepare(&q, + "%s AND blob.rid IN (SELECT rid FROM tagxref WHERE tagtype>0 AND tagid=%d)" + " ORDER BY event.mtime DESC", + timeline_query_for_www(), TAG_NEWBRANCH + ); + www_print_timeline(&q); + db_finalize(&q); + @ <br clear="both"> + @ <script> + @ function xin(id){ + @ } + @ function xout(id){ + @ } + @ </script> + style_footer(); }
Modified src/info.c from [a275e2aa98] to [53c5bc287b].
@@ -369,14 +369,25 @@ } @ </td></tr> if( g.okHistory ){ char *zShortUuid = mprintf("%.10s", zUuid); const char *zProjName = db_get("project-name", "unnamed"); + Stmt q; @ <tr><th>Timelines:</th><td> @ <a href="%s(g.zBaseURL)/timeline?p=%d(rid)">ancestors</a> @ | <a href="%s(g.zBaseURL)/timeline?d=%d(rid)">descendants</a> @ | <a href="%s(g.zBaseURL)/timeline?d=%d(rid)&p=%d(rid)">both</a> + db_prepare(&q, "SELECT tag.tagid, tag.tagname FROM tagxref, tag " + " WHERE rid=%d AND tagtype>0 " + " AND tag.tagid=tagxref.tagid " + " AND +tag.tagname GLOB 'sym-*'", rid); + while( db_step(&q)==SQLITE_ROW ){ + int tagid = db_column_int(&q, 0); + const char *zTagName = db_column_text(&q, 1); + @ | <a href="%s(g.zBaseURL)/timeline?t=%d(tagid)">%h(&zTagName[4])</a> + } + db_finalize(&q); @ </td></tr> @ <tr><th>Commands:</th> @ <td> @ <a href="%s(g.zBaseURL)/vdiff/%d(rid)">diff</a> @ | <a href="%s(g.zBaseURL)/zip/%s(zProjName)-%s(zShortUuid).zip?uuid=%s(zUuid)">
Modified src/style.c from [ce8ef4ed6f] to [2f4e685f52].
@@ -193,11 +193,11 @@ @ html "<a href='$baseurl/dir'>Files</a>" @ } @ if {[hascap o]} { @ html "<a href='$baseurl/leaves'>Leaves</a>" @ html "<a href='$baseurl/timeline'>Timeline</a>" -@ html "<a href='$baseurl/tagview'>Tags</a>" +@ html "<a href='$baseurl/brlist'>Branches</a>" @ } @ if {[hascap r]} { @ html "<a href='$baseurl/reportlist'>Bugs</a>" @ } @ if {[hascap j]} {
Modified src/timeline.c from [c3f7f3d73d] to [73a9d3ab6c].
@@ -270,10 +270,11 @@ ** a=TIMESTAMP after this date ** 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= ** appear, then u=, y=, a=, and b= are ignored. @@ -288,10 +289,11 @@ Blob sql; /* text of SQL used to generate timeline */ 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 */ HQuery url; /* URL for various branch links */ @@ -343,11 +345,22 @@ blob_appendf(&desc, " of <a href='%s/info/%s'>[%.10s]</a>", 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; char *zNEntry = mprintf("%d", nEntry);