Fossil SCM

On a branch timeline, in addition to showing the checkins of the branch, also show check-ins of other branches that merge into or from the branch being displayed. This helps to show what has happened to an infrequently changing branch which is part of a much more active project.

drh 2010-06-16 20:33 trunk
Commit 67529340264cf8bb2383593a8aadae16428094cb
3 files changed +3 -3 +2 -2 +30 -5
+3 -3
--- src/branch.c
+++ src/branch.c
@@ -252,11 +252,11 @@
252252
@ <h2>Open Branches:</h2>
253253
@ <ul>
254254
cnt++;
255255
}
256256
if( g.okHistory ){
257
- @ <li><a href="%s(g.zBaseURL)/timeline?t=%T(zBr)">%h(zBr)</a></li>
257
+ @ <li><a href="%s(g.zBaseURL)/timeline?r=%T(zBr)">%h(zBr)</a></li>
258258
}else{
259259
@ <li><b>%h(zBr)</b></li>
260260
}
261261
}
262262
db_finalize(&q);
@@ -280,11 +280,11 @@
280280
@ <h2>Closed Branches:</h2>
281281
@ <ul>
282282
cnt++;
283283
}
284284
if( g.okHistory ){
285
- @ <li><a href="%s(g.zBaseURL)/timeline?t=%T(zBr)">%h(zBr)</a></li>
285
+ @ <li><a href="%s(g.zBaseURL)/timeline?r=%T(zBr)">%h(zBr)</a></li>
286286
}else{
287287
@ <li><b>%h(zBr)</b></li>
288288
}
289289
}
290290
if( cnt ){
@@ -318,11 +318,11 @@
318318
" AND tag.tagname GLOB 'sym-*'",
319319
rid
320320
);
321321
while( db_step(&q)==SQLITE_ROW ){
322322
const char *zTagName = db_column_text(&q, 0);
323
- @ <a href="%s(g.zBaseURL)/timeline?t=%T(zTagName)">[timeline]</a>
323
+ @ <a href="%s(g.zBaseURL)/timeline?r=%T(zTagName)">[timeline]</a>
324324
}
325325
db_finalize(&q);
326326
}
327327
328328
/*
329329
--- src/branch.c
+++ src/branch.c
@@ -252,11 +252,11 @@
252 @ <h2>Open Branches:</h2>
253 @ <ul>
254 cnt++;
255 }
256 if( g.okHistory ){
257 @ <li><a href="%s(g.zBaseURL)/timeline?t=%T(zBr)">%h(zBr)</a></li>
258 }else{
259 @ <li><b>%h(zBr)</b></li>
260 }
261 }
262 db_finalize(&q);
@@ -280,11 +280,11 @@
280 @ <h2>Closed Branches:</h2>
281 @ <ul>
282 cnt++;
283 }
284 if( g.okHistory ){
285 @ <li><a href="%s(g.zBaseURL)/timeline?t=%T(zBr)">%h(zBr)</a></li>
286 }else{
287 @ <li><b>%h(zBr)</b></li>
288 }
289 }
290 if( cnt ){
@@ -318,11 +318,11 @@
318 " AND tag.tagname GLOB 'sym-*'",
319 rid
320 );
321 while( db_step(&q)==SQLITE_ROW ){
322 const char *zTagName = db_column_text(&q, 0);
323 @ <a href="%s(g.zBaseURL)/timeline?t=%T(zTagName)">[timeline]</a>
324 }
325 db_finalize(&q);
326 }
327
328 /*
329
--- src/branch.c
+++ src/branch.c
@@ -252,11 +252,11 @@
252 @ <h2>Open Branches:</h2>
253 @ <ul>
254 cnt++;
255 }
256 if( g.okHistory ){
257 @ <li><a href="%s(g.zBaseURL)/timeline?r=%T(zBr)">%h(zBr)</a></li>
258 }else{
259 @ <li><b>%h(zBr)</b></li>
260 }
261 }
262 db_finalize(&q);
@@ -280,11 +280,11 @@
280 @ <h2>Closed Branches:</h2>
281 @ <ul>
282 cnt++;
283 }
284 if( g.okHistory ){
285 @ <li><a href="%s(g.zBaseURL)/timeline?r=%T(zBr)">%h(zBr)</a></li>
286 }else{
287 @ <li><b>%h(zBr)</b></li>
288 }
289 }
290 if( cnt ){
@@ -318,11 +318,11 @@
318 " AND tag.tagname GLOB 'sym-*'",
319 rid
320 );
321 while( db_step(&q)==SQLITE_ROW ){
322 const char *zTagName = db_column_text(&q, 0);
323 @ <a href="%s(g.zBaseURL)/timeline?r=%T(zTagName)">[timeline]</a>
324 }
325 db_finalize(&q);
326 }
327
328 /*
329
+2 -2
--- src/info.c
+++ src/info.c
@@ -202,11 +202,11 @@
202202
}else{
203203
@ propagates to descendants
204204
}
205205
if( zValue && strcmp(zTagname,"branch")==0 ){
206206
@ &nbsp;&nbsp;
207
- @ <a href="%s(g.zBaseURL)/timeline?t=%T(zValue)">branch timeline</a>
207
+ @ <a href="%s(g.zBaseURL)/timeline?r=%T(zValue)">branch timeline</a>
208208
}
209209
}
210210
if( zSrcUuid && zSrcUuid[0] ){
211211
if( tagtype==0 ){
212212
@ by
@@ -351,11 +351,11 @@
351351
" WHERE rid=%d AND tagtype>0 "
352352
" AND tag.tagid=tagxref.tagid "
353353
" AND +tag.tagname GLOB 'sym-*'", rid);
354354
while( db_step(&q)==SQLITE_ROW ){
355355
const char *zTagName = db_column_text(&q, 0);
356
- @ | <a href="%s(g.zTop)/timeline?t=%T(zTagName)">%h(zTagName)</a>
356
+ @ | <a href="%s(g.zTop)/timeline?r=%T(zTagName)">%h(zTagName)</a>
357357
}
358358
db_finalize(&q);
359359
@ </td></tr>
360360
@ <tr><th>Other&nbsp;Links:</th>
361361
@ <td>
362362
--- src/info.c
+++ src/info.c
@@ -202,11 +202,11 @@
202 }else{
203 @ propagates to descendants
204 }
205 if( zValue && strcmp(zTagname,"branch")==0 ){
206 @ &nbsp;&nbsp;
207 @ <a href="%s(g.zBaseURL)/timeline?t=%T(zValue)">branch timeline</a>
208 }
209 }
210 if( zSrcUuid && zSrcUuid[0] ){
211 if( tagtype==0 ){
212 @ by
@@ -351,11 +351,11 @@
351 " WHERE rid=%d AND tagtype>0 "
352 " AND tag.tagid=tagxref.tagid "
353 " AND +tag.tagname GLOB 'sym-*'", rid);
354 while( db_step(&q)==SQLITE_ROW ){
355 const char *zTagName = db_column_text(&q, 0);
356 @ | <a href="%s(g.zTop)/timeline?t=%T(zTagName)">%h(zTagName)</a>
357 }
358 db_finalize(&q);
359 @ </td></tr>
360 @ <tr><th>Other&nbsp;Links:</th>
361 @ <td>
362
--- src/info.c
+++ src/info.c
@@ -202,11 +202,11 @@
202 }else{
203 @ propagates to descendants
204 }
205 if( zValue && strcmp(zTagname,"branch")==0 ){
206 @ &nbsp;&nbsp;
207 @ <a href="%s(g.zBaseURL)/timeline?r=%T(zValue)">branch timeline</a>
208 }
209 }
210 if( zSrcUuid && zSrcUuid[0] ){
211 if( tagtype==0 ){
212 @ by
@@ -351,11 +351,11 @@
351 " WHERE rid=%d AND tagtype>0 "
352 " AND tag.tagid=tagxref.tagid "
353 " AND +tag.tagname GLOB 'sym-*'", rid);
354 while( db_step(&q)==SQLITE_ROW ){
355 const char *zTagName = db_column_text(&q, 0);
356 @ | <a href="%s(g.zTop)/timeline?r=%T(zTagName)">%h(zTagName)</a>
357 }
358 db_finalize(&q);
359 @ </td></tr>
360 @ <tr><th>Other&nbsp;Links:</th>
361 @ <td>
362
+30 -5
--- src/timeline.c
+++ src/timeline.c
@@ -625,10 +625,11 @@
625625
** c=TIMESTAMP "circa" this date.
626626
** n=COUNT number of events in output
627627
** p=RID artifact RID and up to COUNT parents and ancestors
628628
** d=RID artifact RID and up to COUNT descendants
629629
** t=TAGID show only check-ins with the given tagid
630
+** r=TAGID show check-ins related to tagid
630631
** u=USER only if belonging to this user
631632
** y=TYPE 'ci', 'w', 't'
632633
** s=TEXT string search (comment and brief)
633634
** ng Suppress the graph if present
634635
**
@@ -651,10 +652,11 @@
651652
const char *zType = PD("y","all"); /* Type of events. All if NULL */
652653
const char *zAfter = P("a"); /* Events after this time */
653654
const char *zBefore = P("b"); /* Events before this time */
654655
const char *zCirca = P("c"); /* Events near this time */
655656
const char *zTagName = P("t"); /* Show events with this tag */
657
+ const char *zBrName = P("r"); /* Show events related to this tag */
656658
const char *zSearch = P("s"); /* Search string */
657659
HQuery url; /* URL for various branch links */
658660
int tagid; /* Tag ID */
659661
int tmFlags; /* Timeline flags */
660662
@@ -662,10 +664,12 @@
662664
*/
663665
login_check_credentials();
664666
if( !g.okRead && !g.okRdTkt && !g.okRdWiki ){ login_needed(); return; }
665667
if( zTagName && g.okRead ){
666668
tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName);
669
+ }else if( zBrName && g.okRead ){
670
+ tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName);
667671
}else{
668672
tagid = 0;
669673
}
670674
if( zType[0]=='a' ){
671675
tmFlags = TIMELINE_BRIEF | TIMELINE_GRAPH;
@@ -740,14 +744,32 @@
740744
char *zNEntry = mprintf("%d", nEntry);
741745
url_initialize(&url, "timeline");
742746
url_add_parameter(&url, "n", zNEntry);
743747
if( tagid>0 ){
744748
zType = "ci";
745
- url_add_parameter(&url, "t", zTagName);
746
- blob_appendf(&sql, " AND EXISTS (SELECT 1 FROM tagxref WHERE tagid=%d"
747
- " AND tagtype>0 AND rid=blob.rid)",
748
- tagid);
749
+ blob_appendf(&sql,
750
+ "AND (EXISTS(SELECT 1 FROM tagxref"
751
+ " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)", tagid);
752
+
753
+ if( zBrName ){
754
+ /* The next two blob_appendf() calls add SQL that causes checkins that
755
+ ** are not part of the branch which are parents or childen of the branch
756
+ ** to be included in the report. This related check-ins are useful
757
+ ** in helping to visualize what has happened on a quiescent branch
758
+ ** that is infrequently merged with a much more activate branch.
759
+ */
760
+ url_add_parameter(&url, "r", zBrName);
761
+ blob_appendf(&sql,
762
+ " OR EXISTS(SELECT 1 FROM plink JOIN tagxref ON rid=cid"
763
+ " WHERE tagid=%d AND tagtype>0 AND pid=blob.rid)", tagid);
764
+ blob_appendf(&sql,
765
+ " OR EXISTS(SELECT 1 FROM plink JOIN tagxref ON rid=pid"
766
+ " WHERE tagid=%d AND tagtype>0 AND cid=blob.rid)", tagid);
767
+ }else{
768
+ url_add_parameter(&url, "t", zTagName);
769
+ }
770
+ blob_appendf(&sql, ")");
749771
}
750772
if( (zType[0]=='w' && !g.okRdWiki)
751773
|| (zType[0]=='t' && !g.okRdTkt)
752774
|| (zType[0]=='c' && !g.okRead)
753775
){
@@ -852,13 +874,16 @@
852874
}
853875
if( zUser ){
854876
blob_appendf(&desc, " by user %h", zUser);
855877
tmFlags |= TIMELINE_DISJOINT;
856878
}
857
- if( tagid>0 ){
879
+ if( zTagName ){
858880
blob_appendf(&desc, " tagged with \"%h\"", zTagName);
859881
tmFlags |= TIMELINE_DISJOINT;
882
+ }else if( zBrName ){
883
+ blob_appendf(&desc, " related to \"%h\"", zBrName);
884
+ tmFlags |= TIMELINE_DISJOINT;
860885
}
861886
if( zAfter ){
862887
blob_appendf(&desc, " occurring on or after %h.<br>", zAfter);
863888
}else if( zBefore ){
864889
blob_appendf(&desc, " occurring on or before %h.<br>", zBefore);
865890
--- src/timeline.c
+++ src/timeline.c
@@ -625,10 +625,11 @@
625 ** c=TIMESTAMP "circa" this date.
626 ** n=COUNT number of events in output
627 ** p=RID artifact RID and up to COUNT parents and ancestors
628 ** d=RID artifact RID and up to COUNT descendants
629 ** t=TAGID show only check-ins with the given tagid
 
630 ** u=USER only if belonging to this user
631 ** y=TYPE 'ci', 'w', 't'
632 ** s=TEXT string search (comment and brief)
633 ** ng Suppress the graph if present
634 **
@@ -651,10 +652,11 @@
651 const char *zType = PD("y","all"); /* Type of events. All if NULL */
652 const char *zAfter = P("a"); /* Events after this time */
653 const char *zBefore = P("b"); /* Events before this time */
654 const char *zCirca = P("c"); /* Events near this time */
655 const char *zTagName = P("t"); /* Show events with this tag */
 
656 const char *zSearch = P("s"); /* Search string */
657 HQuery url; /* URL for various branch links */
658 int tagid; /* Tag ID */
659 int tmFlags; /* Timeline flags */
660
@@ -662,10 +664,12 @@
662 */
663 login_check_credentials();
664 if( !g.okRead && !g.okRdTkt && !g.okRdWiki ){ login_needed(); return; }
665 if( zTagName && g.okRead ){
666 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName);
 
 
667 }else{
668 tagid = 0;
669 }
670 if( zType[0]=='a' ){
671 tmFlags = TIMELINE_BRIEF | TIMELINE_GRAPH;
@@ -740,14 +744,32 @@
740 char *zNEntry = mprintf("%d", nEntry);
741 url_initialize(&url, "timeline");
742 url_add_parameter(&url, "n", zNEntry);
743 if( tagid>0 ){
744 zType = "ci";
745 url_add_parameter(&url, "t", zTagName);
746 blob_appendf(&sql, " AND EXISTS (SELECT 1 FROM tagxref WHERE tagid=%d"
747 " AND tagtype>0 AND rid=blob.rid)",
748 tagid);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
749 }
750 if( (zType[0]=='w' && !g.okRdWiki)
751 || (zType[0]=='t' && !g.okRdTkt)
752 || (zType[0]=='c' && !g.okRead)
753 ){
@@ -852,13 +874,16 @@
852 }
853 if( zUser ){
854 blob_appendf(&desc, " by user %h", zUser);
855 tmFlags |= TIMELINE_DISJOINT;
856 }
857 if( tagid>0 ){
858 blob_appendf(&desc, " tagged with \"%h\"", zTagName);
859 tmFlags |= TIMELINE_DISJOINT;
 
 
 
860 }
861 if( zAfter ){
862 blob_appendf(&desc, " occurring on or after %h.<br>", zAfter);
863 }else if( zBefore ){
864 blob_appendf(&desc, " occurring on or before %h.<br>", zBefore);
865
--- src/timeline.c
+++ src/timeline.c
@@ -625,10 +625,11 @@
625 ** c=TIMESTAMP "circa" this date.
626 ** n=COUNT number of events in output
627 ** p=RID artifact RID and up to COUNT parents and ancestors
628 ** d=RID artifact RID and up to COUNT descendants
629 ** t=TAGID show only check-ins with the given tagid
630 ** r=TAGID show check-ins related to tagid
631 ** u=USER only if belonging to this user
632 ** y=TYPE 'ci', 'w', 't'
633 ** s=TEXT string search (comment and brief)
634 ** ng Suppress the graph if present
635 **
@@ -651,10 +652,11 @@
652 const char *zType = PD("y","all"); /* Type of events. All if NULL */
653 const char *zAfter = P("a"); /* Events after this time */
654 const char *zBefore = P("b"); /* Events before this time */
655 const char *zCirca = P("c"); /* Events near this time */
656 const char *zTagName = P("t"); /* Show events with this tag */
657 const char *zBrName = P("r"); /* Show events related to this tag */
658 const char *zSearch = P("s"); /* Search string */
659 HQuery url; /* URL for various branch links */
660 int tagid; /* Tag ID */
661 int tmFlags; /* Timeline flags */
662
@@ -662,10 +664,12 @@
664 */
665 login_check_credentials();
666 if( !g.okRead && !g.okRdTkt && !g.okRdWiki ){ login_needed(); return; }
667 if( zTagName && g.okRead ){
668 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName);
669 }else if( zBrName && g.okRead ){
670 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName);
671 }else{
672 tagid = 0;
673 }
674 if( zType[0]=='a' ){
675 tmFlags = TIMELINE_BRIEF | TIMELINE_GRAPH;
@@ -740,14 +744,32 @@
744 char *zNEntry = mprintf("%d", nEntry);
745 url_initialize(&url, "timeline");
746 url_add_parameter(&url, "n", zNEntry);
747 if( tagid>0 ){
748 zType = "ci";
749 blob_appendf(&sql,
750 "AND (EXISTS(SELECT 1 FROM tagxref"
751 " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)", tagid);
752
753 if( zBrName ){
754 /* The next two blob_appendf() calls add SQL that causes checkins that
755 ** are not part of the branch which are parents or childen of the branch
756 ** to be included in the report. This related check-ins are useful
757 ** in helping to visualize what has happened on a quiescent branch
758 ** that is infrequently merged with a much more activate branch.
759 */
760 url_add_parameter(&url, "r", zBrName);
761 blob_appendf(&sql,
762 " OR EXISTS(SELECT 1 FROM plink JOIN tagxref ON rid=cid"
763 " WHERE tagid=%d AND tagtype>0 AND pid=blob.rid)", tagid);
764 blob_appendf(&sql,
765 " OR EXISTS(SELECT 1 FROM plink JOIN tagxref ON rid=pid"
766 " WHERE tagid=%d AND tagtype>0 AND cid=blob.rid)", tagid);
767 }else{
768 url_add_parameter(&url, "t", zTagName);
769 }
770 blob_appendf(&sql, ")");
771 }
772 if( (zType[0]=='w' && !g.okRdWiki)
773 || (zType[0]=='t' && !g.okRdTkt)
774 || (zType[0]=='c' && !g.okRead)
775 ){
@@ -852,13 +874,16 @@
874 }
875 if( zUser ){
876 blob_appendf(&desc, " by user %h", zUser);
877 tmFlags |= TIMELINE_DISJOINT;
878 }
879 if( zTagName ){
880 blob_appendf(&desc, " tagged with \"%h\"", zTagName);
881 tmFlags |= TIMELINE_DISJOINT;
882 }else if( zBrName ){
883 blob_appendf(&desc, " related to \"%h\"", zBrName);
884 tmFlags |= TIMELINE_DISJOINT;
885 }
886 if( zAfter ){
887 blob_appendf(&desc, " occurring on or after %h.<br>", zAfter);
888 }else if( zBefore ){
889 blob_appendf(&desc, " occurring on or before %h.<br>", zBefore);
890

Keyboard Shortcuts

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