| | @@ -238,16 +238,17 @@ |
| 238 | 238 | ** 8. list of symbolic tags. |
| 239 | 239 | ** 9. tagid for ticket or wiki or event |
| 240 | 240 | ** 10. Short comment to user for repeated tickets and wiki |
| 241 | 241 | */ |
| 242 | 242 | void www_print_timeline( |
| 243 | | - Stmt *pQuery, /* Query to implement the timeline */ |
| 244 | | - int tmFlags, /* Flags controlling display behavior */ |
| 245 | | - const char *zThisUser, /* Suppress links to this user */ |
| 246 | | - const char *zThisTag, /* Suppress links to this tag */ |
| 247 | | - int selectedRid, /* Highlight the line with this RID value */ |
| 248 | | - void (*xExtra)(int) /* Routine to call on each line of display */ |
| 243 | + Stmt *pQuery, /* Query to implement the timeline */ |
| 244 | + int tmFlags, /* Flags controlling display behavior */ |
| 245 | + const char *zThisUser, /* Suppress links to this user */ |
| 246 | + const char *zThisTag, /* Suppress links to this tag */ |
| 247 | + const char *zLeftBranch, /* Strive to put this branch on the left margin */ |
| 248 | + int selectedRid, /* Highlight the line with this RID value */ |
| 249 | + void (*xExtra)(int) /* Routine to call on each line of display */ |
| 249 | 250 | ){ |
| 250 | 251 | int mxWikiLen; |
| 251 | 252 | Blob comment; |
| 252 | 253 | int prevTagid = 0; |
| 253 | 254 | int suppressCnt = 0; |
| | @@ -759,11 +760,11 @@ |
| 759 | 760 | } |
| 760 | 761 | if( pendingEndTr ){ |
| 761 | 762 | @ </td></tr> |
| 762 | 763 | } |
| 763 | 764 | if( pGraph ){ |
| 764 | | - graph_finish(pGraph, tmFlags); |
| 765 | + graph_finish(pGraph, zLeftBranch, tmFlags); |
| 765 | 766 | if( pGraph->nErr ){ |
| 766 | 767 | graph_free(pGraph); |
| 767 | 768 | pGraph = 0; |
| 768 | 769 | }else{ |
| 769 | 770 | @ <tr class="timelineBottom" id="btm-%d(iTableId)">\ |
| | @@ -829,10 +830,11 @@ |
| 829 | 830 | int colorGraph; /* Use colors for graph lines */ |
| 830 | 831 | int iTopRow; /* Index of the top row of the graph */ |
| 831 | 832 | int fileDiff; /* True for file diff. False for check-in diff */ |
| 832 | 833 | int omitDescenders; /* True to omit descenders */ |
| 833 | 834 | int scrollToSelect; /* True to scroll to the selection */ |
| 835 | + u8 *aiMap; /* The rail map */ |
| 834 | 836 | |
| 835 | 837 | iRailPitch = atoi(PD("railpitch","0")); |
| 836 | 838 | showArrowheads = skin_detail_boolean("timeline-arrowheads"); |
| 837 | 839 | circleNodes = skin_detail_boolean("timeline-circle-nodes"); |
| 838 | 840 | colorGraph = skin_detail_boolean("timeline-color-graph-lines"); |
| | @@ -903,20 +905,21 @@ |
| 903 | 905 | ** merges. |
| 904 | 906 | ** ci: "cherrypick-in". Like "mi" except for cherrypick merges. |
| 905 | 907 | ** omitted if there are no cherrypick merges. |
| 906 | 908 | ** h: The artifact hash of the object being graphed |
| 907 | 909 | */ |
| 910 | + aiMap = pGraph->aiRailMap; |
| 908 | 911 | for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){ |
| 909 | 912 | int k = 0; |
| 910 | 913 | cgi_printf("{\"id\":%d,", pRow->idx); |
| 911 | 914 | cgi_printf("\"bg\":\"%s\",", pRow->zBgClr); |
| 912 | | - cgi_printf("\"r\":%d,", pRow->iRail); |
| 915 | + cgi_printf("\"r\":%d,", aiMap[pRow->iRail]); |
| 913 | 916 | if( pRow->bDescender ){ |
| 914 | 917 | cgi_printf("\"d\":%d,", pRow->bDescender); |
| 915 | 918 | } |
| 916 | 919 | if( pRow->mergeOut>=0 ){ |
| 917 | | - cgi_printf("\"mo\":%d,", pRow->mergeOut); |
| 920 | + cgi_printf("\"mo\":%d,", aiMap[pRow->mergeOut]); |
| 918 | 921 | if( pRow->mergeUpto==0 ) pRow->mergeUpto = pRow->idx; |
| 919 | 922 | cgi_printf("\"mu\":%d,", pRow->mergeUpto); |
| 920 | 923 | if( pRow->cherrypickUpto>0 && pRow->cherrypickUpto<pRow->mergeUpto ){ |
| 921 | 924 | cgi_printf("\"cu\":%d,", pRow->cherrypickUpto); |
| 922 | 925 | } |
| | @@ -935,11 +938,11 @@ |
| 935 | 938 | if( k==0 ){ |
| 936 | 939 | cgi_printf("\"au\":"); |
| 937 | 940 | cSep = '['; |
| 938 | 941 | } |
| 939 | 942 | k++; |
| 940 | | - cgi_printf("%c%d,%d", cSep, i, pRow->aiRiser[i]); |
| 943 | + cgi_printf("%c%d,%d", cSep, aiMap[i], pRow->aiRiser[i]); |
| 941 | 944 | cSep = ','; |
| 942 | 945 | } |
| 943 | 946 | } |
| 944 | 947 | if( k ){ |
| 945 | 948 | cgi_printf("],"); |
| | @@ -948,11 +951,11 @@ |
| 948 | 951 | cgi_printf("\"fg\":\"%s\",", bg_to_fg(pRow->zBgClr)); |
| 949 | 952 | } |
| 950 | 953 | /* mi */ |
| 951 | 954 | for(i=k=0; i<GR_MAX_RAIL; i++){ |
| 952 | 955 | if( pRow->mergeIn[i]==1 ){ |
| 953 | | - int mi = i; |
| 956 | + int mi = aiMap[i]; |
| 954 | 957 | if( (pRow->mergeDown >> i) & 1 ) mi = -mi; |
| 955 | 958 | if( k==0 ){ |
| 956 | 959 | cgi_printf("\"mi\":"); |
| 957 | 960 | cSep = '['; |
| 958 | 961 | } |
| | @@ -963,11 +966,11 @@ |
| 963 | 966 | } |
| 964 | 967 | if( k ) cgi_printf("],"); |
| 965 | 968 | /* ci */ |
| 966 | 969 | for(i=k=0; i<GR_MAX_RAIL; i++){ |
| 967 | 970 | if( pRow->mergeIn[i]==2 ){ |
| 968 | | - int mi = i; |
| 971 | + int mi = aiMap[i]; |
| 969 | 972 | if( (pRow->cherrypickDown >> i) & 1 ) mi = -mi; |
| 970 | 973 | if( k==0 ){ |
| 971 | 974 | cgi_printf("\"ci\":"); |
| 972 | 975 | cSep = '['; |
| 973 | 976 | } |
| | @@ -2379,11 +2382,12 @@ |
| 2379 | 2382 | } |
| 2380 | 2383 | |
| 2381 | 2384 | if( zNewerButton ){ |
| 2382 | 2385 | @ %z(chref("button","%z",zNewerButton))More ↑</a> |
| 2383 | 2386 | } |
| 2384 | | - www_print_timeline(&q, tmFlags, zThisUser, zThisTag, selectedRid, 0); |
| 2387 | + www_print_timeline(&q, tmFlags, zThisUser, zThisTag, zBrName, |
| 2388 | + selectedRid, 0); |
| 2385 | 2389 | db_finalize(&q); |
| 2386 | 2390 | if( zOlderButton ){ |
| 2387 | 2391 | @ %z(chref("button","%z",zOlderButton))More ↓</a> |
| 2388 | 2392 | } |
| 2389 | 2393 | style_footer(); |
| | @@ -2872,11 +2876,11 @@ |
| 2872 | 2876 | zId = db_text(0, "SELECT timestamp FROM timeline" |
| 2873 | 2877 | " ORDER BY sortby DESC LIMIT 1"); |
| 2874 | 2878 | @ <h2>%d(iAgo) Year%s(iAgo>1?"s":"") Ago |
| 2875 | 2879 | @ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\ |
| 2876 | 2880 | @ </small></h2> |
| 2877 | | - www_print_timeline(&q, TIMELINE_GRAPH, 0, 0, 0, 0); |
| 2881 | + www_print_timeline(&q, TIMELINE_GRAPH, 0, 0, 0, 0, 0); |
| 2878 | 2882 | } |
| 2879 | 2883 | db_finalize(&q); |
| 2880 | 2884 | style_footer(); |
| 2881 | 2885 | } |
| 2882 | 2886 | |
| 2883 | 2887 | |