Fossil SCM

After each item of the branch list, give a hyperlink to the timeline that shows all check-ins with the branch tag.

drh 2009-01-21 03:34 trunk
Commit bdcac6293748bd3fe9458e653d51d6affd3595ae
2 files changed +25 -1 +6 -2
+25 -1
--- src/branch.c
+++ src/branch.c
@@ -212,10 +212,33 @@
212212
}else{
213213
fossil_panic("branch subcommand should be one of: "
214214
"new list");
215215
}
216216
}
217
+
218
+/*
219
+** This routine is called while for each check-in that is rendered by
220
+** the timeline of a "brlist" page. Add some additional hyperlinks
221
+** to the end of the line.
222
+*/
223
+static void brlist_extra(int rid){
224
+ Stmt q;
225
+ db_prepare(&q,
226
+ "SELECT tagname, tagxref.tagid FROM tagxref, tag"
227
+ " WHERE tagxref.rid=%d"
228
+ " AND tagxref.tagid=tag.tagid"
229
+ " AND tagxref.tagtype>0"
230
+ " AND tag.tagname GLOB 'sym-*'",
231
+ rid
232
+ );
233
+ while( db_step(&q)==SQLITE_ROW ){
234
+ const char *zTagName = db_column_text(&q, 0);
235
+ int tagid = db_column_int(&q, 1);
236
+ @ [<a href="%s(g.zBaseURL)/timeline?t=%d(tagid)">%h(&zTagName[4])</a>]
237
+ }
238
+ db_finalize(&q);
239
+}
217240
218241
/*
219242
** WEBPAGE: brlist
220243
**
221244
** Show a timeline of all branches
@@ -226,16 +249,17 @@
226249
login_check_credentials();
227250
if( !g.okRead ){ login_needed(); return; }
228251
229252
style_header("Branches");
230253
login_anonymous_available();
254
+ @ <h2>The initial check-in for each branch:</h2>
231255
db_prepare(&q,
232256
"%s AND blob.rid IN (SELECT rid FROM tagxref WHERE tagtype>0 AND tagid=%d)"
233257
" ORDER BY event.mtime DESC",
234258
timeline_query_for_www(), TAG_NEWBRANCH
235259
);
236
- www_print_timeline(&q, 0, 0);
260
+ www_print_timeline(&q, 0, brlist_extra);
237261
db_finalize(&q);
238262
@ <br clear="both">
239263
@ <script>
240264
@ function xin(id){
241265
@ }
242266
--- src/branch.c
+++ src/branch.c
@@ -212,10 +212,33 @@
212 }else{
213 fossil_panic("branch subcommand should be one of: "
214 "new list");
215 }
216 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
218 /*
219 ** WEBPAGE: brlist
220 **
221 ** Show a timeline of all branches
@@ -226,16 +249,17 @@
226 login_check_credentials();
227 if( !g.okRead ){ login_needed(); return; }
228
229 style_header("Branches");
230 login_anonymous_available();
 
231 db_prepare(&q,
232 "%s AND blob.rid IN (SELECT rid FROM tagxref WHERE tagtype>0 AND tagid=%d)"
233 " ORDER BY event.mtime DESC",
234 timeline_query_for_www(), TAG_NEWBRANCH
235 );
236 www_print_timeline(&q, 0, 0);
237 db_finalize(&q);
238 @ <br clear="both">
239 @ <script>
240 @ function xin(id){
241 @ }
242
--- src/branch.c
+++ src/branch.c
@@ -212,10 +212,33 @@
212 }else{
213 fossil_panic("branch subcommand should be one of: "
214 "new list");
215 }
216 }
217
218 /*
219 ** This routine is called while for each check-in that is rendered by
220 ** the timeline of a "brlist" page. Add some additional hyperlinks
221 ** to the end of the line.
222 */
223 static void brlist_extra(int rid){
224 Stmt q;
225 db_prepare(&q,
226 "SELECT tagname, tagxref.tagid FROM tagxref, tag"
227 " WHERE tagxref.rid=%d"
228 " AND tagxref.tagid=tag.tagid"
229 " AND tagxref.tagtype>0"
230 " AND tag.tagname GLOB 'sym-*'",
231 rid
232 );
233 while( db_step(&q)==SQLITE_ROW ){
234 const char *zTagName = db_column_text(&q, 0);
235 int tagid = db_column_int(&q, 1);
236 @ [<a href="%s(g.zBaseURL)/timeline?t=%d(tagid)">%h(&zTagName[4])</a>]
237 }
238 db_finalize(&q);
239 }
240
241 /*
242 ** WEBPAGE: brlist
243 **
244 ** Show a timeline of all branches
@@ -226,16 +249,17 @@
249 login_check_credentials();
250 if( !g.okRead ){ login_needed(); return; }
251
252 style_header("Branches");
253 login_anonymous_available();
254 @ <h2>The initial check-in for each branch:</h2>
255 db_prepare(&q,
256 "%s AND blob.rid IN (SELECT rid FROM tagxref WHERE tagtype>0 AND tagid=%d)"
257 " ORDER BY event.mtime DESC",
258 timeline_query_for_www(), TAG_NEWBRANCH
259 );
260 www_print_timeline(&q, 0, brlist_extra);
261 db_finalize(&q);
262 @ <br clear="both">
263 @ <script>
264 @ function xin(id){
265 @ }
266
+6 -2
--- src/timeline.c
+++ src/timeline.c
@@ -199,14 +199,18 @@
199199
}else{
200200
wiki_convert(&comment, 0, wikiFlags);
201201
}
202202
blob_reset(&comment);
203203
if( zTagList && zTagList[0] ){
204
- @ (user: %h(zUser), tags: %h(zTagList))</td></tr>
204
+ @ (user: %h(zUser), tags: %h(zTagList))
205205
}else{
206
- @ (user: %h(zUser))</td></tr>
206
+ @ (user: %h(zUser))
207
+ }
208
+ if( xExtra ){
209
+ xExtra(rid);
207210
}
211
+ @ </td></tr>
208212
}
209213
@ </table>
210214
}
211215
212216
/*
213217
--- src/timeline.c
+++ src/timeline.c
@@ -199,14 +199,18 @@
199 }else{
200 wiki_convert(&comment, 0, wikiFlags);
201 }
202 blob_reset(&comment);
203 if( zTagList && zTagList[0] ){
204 @ (user: %h(zUser), tags: %h(zTagList))</td></tr>
205 }else{
206 @ (user: %h(zUser))</td></tr>
 
 
 
207 }
 
208 }
209 @ </table>
210 }
211
212 /*
213
--- src/timeline.c
+++ src/timeline.c
@@ -199,14 +199,18 @@
199 }else{
200 wiki_convert(&comment, 0, wikiFlags);
201 }
202 blob_reset(&comment);
203 if( zTagList && zTagList[0] ){
204 @ (user: %h(zUser), tags: %h(zTagList))
205 }else{
206 @ (user: %h(zUser))
207 }
208 if( xExtra ){
209 xExtra(rid);
210 }
211 @ </td></tr>
212 }
213 @ </table>
214 }
215
216 /*
217

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button