Fossil SCM

Add timeline links on the leaves page. Also on the leaves page, do not show Merge labels on check-ins. The second part is the fix for ticket [d6bb26f436d8299f95d63f45fa51c92acdc91c5a].

drh 2009-01-21 18:59 trunk
Commit 2fa4df1e47f17f1c10a79d024a817f13a7d0bf6f
+1 -1
--- src/branch.c
+++ src/branch.c
@@ -230,11 +230,11 @@
230230
" AND tag.tagname GLOB 'sym-*'",
231231
rid
232232
);
233233
while( db_step(&q)==SQLITE_ROW ){
234234
const char *zTagName = db_column_text(&q, 0);
235
- @ [<a href="%s(g.zBaseURL)/timeline?t=%T(zTagName)">%h(zTagName)</a>]
235
+ @ <a href="%s(g.zBaseURL)/timeline?t=%T(zTagName)">[timeline]</a>
236236
}
237237
db_finalize(&q);
238238
}
239239
240240
/*
241241
--- src/branch.c
+++ src/branch.c
@@ -230,11 +230,11 @@
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 @ [<a href="%s(g.zBaseURL)/timeline?t=%T(zTagName)">%h(zTagName)</a>]
236 }
237 db_finalize(&q);
238 }
239
240 /*
241
--- src/branch.c
+++ src/branch.c
@@ -230,11 +230,11 @@
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 @ <a href="%s(g.zBaseURL)/timeline?t=%T(zTagName)">[timeline]</a>
236 }
237 db_finalize(&q);
238 }
239
240 /*
241
--- src/descendants.c
+++ src/descendants.c
@@ -248,10 +248,19 @@
248248
timeline_query_for_tty()
249249
);
250250
print_timeline(&q, 2000);
251251
db_finalize(&q);
252252
}
253
+
254
+/*
255
+** This routine is called while for each check-in that is rendered by
256
+** the "leaves" page. Add some additional hyperlink to show the
257
+** ancestors of the leaf.
258
+*/
259
+static void leaves_extra(int rid){
260
+ @ <a href="%s(g.zBaseURL)/timeline?p=%d(rid)">[timeline]</a>
261
+}
253262
254263
/*
255264
** WEBPAGE: leaves
256265
**
257266
** Find leaves of all branches.
@@ -298,11 +307,11 @@
298307
"%s"
299308
" AND blob.rid IN leaves"
300309
" ORDER BY event.mtime DESC",
301310
timeline_query_for_www()
302311
);
303
- www_print_timeline(&q, 0, 0);
312
+ www_print_timeline(&q, TIMELINE_LEAFONLY, leaves_extra);
304313
db_finalize(&q);
305314
@ <br clear="both">
306315
@ <script>
307316
@ function xin(id){
308317
@ }
309318
--- src/descendants.c
+++ src/descendants.c
@@ -248,10 +248,19 @@
248 timeline_query_for_tty()
249 );
250 print_timeline(&q, 2000);
251 db_finalize(&q);
252 }
 
 
 
 
 
 
 
 
 
253
254 /*
255 ** WEBPAGE: leaves
256 **
257 ** Find leaves of all branches.
@@ -298,11 +307,11 @@
298 "%s"
299 " AND blob.rid IN leaves"
300 " ORDER BY event.mtime DESC",
301 timeline_query_for_www()
302 );
303 www_print_timeline(&q, 0, 0);
304 db_finalize(&q);
305 @ <br clear="both">
306 @ <script>
307 @ function xin(id){
308 @ }
309
--- src/descendants.c
+++ src/descendants.c
@@ -248,10 +248,19 @@
248 timeline_query_for_tty()
249 );
250 print_timeline(&q, 2000);
251 db_finalize(&q);
252 }
253
254 /*
255 ** This routine is called while for each check-in that is rendered by
256 ** the "leaves" page. Add some additional hyperlink to show the
257 ** ancestors of the leaf.
258 */
259 static void leaves_extra(int rid){
260 @ <a href="%s(g.zBaseURL)/timeline?p=%d(rid)">[timeline]</a>
261 }
262
263 /*
264 ** WEBPAGE: leaves
265 **
266 ** Find leaves of all branches.
@@ -298,11 +307,11 @@
307 "%s"
308 " AND blob.rid IN leaves"
309 " ORDER BY event.mtime DESC",
310 timeline_query_for_www()
311 );
312 www_print_timeline(&q, TIMELINE_LEAFONLY, leaves_extra);
313 db_finalize(&q);
314 @ <br clear="both">
315 @ <script>
316 @ function xin(id){
317 @ }
318
+12 -9
--- src/timeline.c
+++ src/timeline.c
@@ -98,11 +98,12 @@
9898
9999
/*
100100
** Allowed flags for the tmFlags argument to www_print_timeline
101101
*/
102102
#if INTERFACE
103
-#define TIMELINE_ARTID 0x0001 /* Show artifact IDs on non-check-in lines */
103
+#define TIMELINE_ARTID 0x0001 /* Show artifact IDs on non-check-in lines */
104
+#define TIMELINE_LEAFONLY 0x0002 /* Show "Leaf", but not "Merge", "Fork" etc */
104105
#endif
105106
106107
/*
107108
** Output a timeline in the web format given a query. The query
108109
** should return these columns:
@@ -170,18 +171,20 @@
170171
}else{
171172
@ <td valign="top" align="left">
172173
}
173174
if( zType[0]=='c' ){
174175
hyperlink_to_uuid_with_mouseover(zUuid, "xin", "xout", rid);
175
- if( nParent>1 ){
176
- @ <b>Merge</b>
177
- }
178
- if( nPChild>1 ){
179
- if( count_nonbranch_children(rid)>1 ){
180
- @ <b>Fork</b>
181
- }else{
182
- @ <b>Branch</b>
176
+ if( (tmFlags & TIMELINE_LEAFONLY)==0 ){
177
+ if( nParent>1 ){
178
+ @ <b>Merge</b>
179
+ }
180
+ if( nPChild>1 ){
181
+ if( count_nonbranch_children(rid)>1 ){
182
+ @ <b>Fork</b>
183
+ }else{
184
+ @ <b>Branch</b>
185
+ }
183186
}
184187
}
185188
if( isLeaf ){
186189
@ <b>Leaf</b>
187190
}
188191
--- src/timeline.c
+++ src/timeline.c
@@ -98,11 +98,12 @@
98
99 /*
100 ** Allowed flags for the tmFlags argument to www_print_timeline
101 */
102 #if INTERFACE
103 #define TIMELINE_ARTID 0x0001 /* Show artifact IDs on non-check-in lines */
 
104 #endif
105
106 /*
107 ** Output a timeline in the web format given a query. The query
108 ** should return these columns:
@@ -170,18 +171,20 @@
170 }else{
171 @ <td valign="top" align="left">
172 }
173 if( zType[0]=='c' ){
174 hyperlink_to_uuid_with_mouseover(zUuid, "xin", "xout", rid);
175 if( nParent>1 ){
176 @ <b>Merge</b>
177 }
178 if( nPChild>1 ){
179 if( count_nonbranch_children(rid)>1 ){
180 @ <b>Fork</b>
181 }else{
182 @ <b>Branch</b>
 
 
183 }
184 }
185 if( isLeaf ){
186 @ <b>Leaf</b>
187 }
188
--- src/timeline.c
+++ src/timeline.c
@@ -98,11 +98,12 @@
98
99 /*
100 ** Allowed flags for the tmFlags argument to www_print_timeline
101 */
102 #if INTERFACE
103 #define TIMELINE_ARTID 0x0001 /* Show artifact IDs on non-check-in lines */
104 #define TIMELINE_LEAFONLY 0x0002 /* Show "Leaf", but not "Merge", "Fork" etc */
105 #endif
106
107 /*
108 ** Output a timeline in the web format given a query. The query
109 ** should return these columns:
@@ -170,18 +171,20 @@
171 }else{
172 @ <td valign="top" align="left">
173 }
174 if( zType[0]=='c' ){
175 hyperlink_to_uuid_with_mouseover(zUuid, "xin", "xout", rid);
176 if( (tmFlags & TIMELINE_LEAFONLY)==0 ){
177 if( nParent>1 ){
178 @ <b>Merge</b>
179 }
180 if( nPChild>1 ){
181 if( count_nonbranch_children(rid)>1 ){
182 @ <b>Fork</b>
183 }else{
184 @ <b>Branch</b>
185 }
186 }
187 }
188 if( isLeaf ){
189 @ <b>Leaf</b>
190 }
191

Keyboard Shortcuts

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