Fossil SCM
Enable the graph for tag timelines, but omit descenders.
Commit
22b6887e40adf0cf59a2d4c588124a886f2a290c
Parent
f2626a53c30aa43…
2 files changed
+14
-5
+3
-2
+14
-5
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -170,11 +170,11 @@ | ||
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /* |
| 173 | 173 | ** Compute the complete graph |
| 174 | 174 | */ |
| 175 | -void graph_finish(GraphContext *p){ | |
| 175 | +void graph_finish(GraphContext *p, int omitDescenders){ | |
| 176 | 176 | GraphRow *pRow, *pDesc; |
| 177 | 177 | Bag allRids; |
| 178 | 178 | int i; |
| 179 | 179 | int nRow; |
| 180 | 180 | u32 mask; |
| @@ -208,15 +208,24 @@ | ||
| 208 | 208 | /* Identify rows where the primary parent is off screen. Assign |
| 209 | 209 | ** each to a rail and draw descenders to the bottom of the screen. |
| 210 | 210 | */ |
| 211 | 211 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 212 | 212 | if( pRow->nParent==0 || !bag_find(&allRids,pRow->aParent[0]) ){ |
| 213 | - pRow->iRail = ++p->mxRail; | |
| 214 | - pRow->bDescender = pRow->nParent>0; | |
| 213 | + if( omitDescenders ){ | |
| 214 | + pRow->iRail = findFreeRail(p, pRow->idx, pRow->idx, 0); | |
| 215 | + }else{ | |
| 216 | + pRow->iRail = ++p->mxRail; | |
| 217 | + } | |
| 215 | 218 | mask = 1<<(pRow->iRail); |
| 216 | - for(pDesc=pRow; pDesc; pDesc=pDesc->pNext){ | |
| 217 | - pDesc->railInUse |= mask; | |
| 219 | + if( omitDescenders ){ | |
| 220 | + pRow->railInUse |= mask; | |
| 221 | + if( pRow->pNext ) pRow->pNext->railInUse |= mask; | |
| 222 | + }else{ | |
| 223 | + pRow->bDescender = pRow->nParent>0; | |
| 224 | + for(pDesc=pRow; pDesc; pDesc=pDesc->pNext){ | |
| 225 | + pDesc->railInUse |= mask; | |
| 226 | + } | |
| 218 | 227 | } |
| 219 | 228 | } |
| 220 | 229 | } |
| 221 | 230 | |
| 222 | 231 | /* Assign rails to all rows that are still unassigned. |
| 223 | 232 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -170,11 +170,11 @@ | |
| 170 | } |
| 171 | |
| 172 | /* |
| 173 | ** Compute the complete graph |
| 174 | */ |
| 175 | void graph_finish(GraphContext *p){ |
| 176 | GraphRow *pRow, *pDesc; |
| 177 | Bag allRids; |
| 178 | int i; |
| 179 | int nRow; |
| 180 | u32 mask; |
| @@ -208,15 +208,24 @@ | |
| 208 | /* Identify rows where the primary parent is off screen. Assign |
| 209 | ** each to a rail and draw descenders to the bottom of the screen. |
| 210 | */ |
| 211 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 212 | if( pRow->nParent==0 || !bag_find(&allRids,pRow->aParent[0]) ){ |
| 213 | pRow->iRail = ++p->mxRail; |
| 214 | pRow->bDescender = pRow->nParent>0; |
| 215 | mask = 1<<(pRow->iRail); |
| 216 | for(pDesc=pRow; pDesc; pDesc=pDesc->pNext){ |
| 217 | pDesc->railInUse |= mask; |
| 218 | } |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | /* Assign rails to all rows that are still unassigned. |
| 223 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -170,11 +170,11 @@ | |
| 170 | } |
| 171 | |
| 172 | /* |
| 173 | ** Compute the complete graph |
| 174 | */ |
| 175 | void graph_finish(GraphContext *p, int omitDescenders){ |
| 176 | GraphRow *pRow, *pDesc; |
| 177 | Bag allRids; |
| 178 | int i; |
| 179 | int nRow; |
| 180 | u32 mask; |
| @@ -208,15 +208,24 @@ | |
| 208 | /* Identify rows where the primary parent is off screen. Assign |
| 209 | ** each to a rail and draw descenders to the bottom of the screen. |
| 210 | */ |
| 211 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 212 | if( pRow->nParent==0 || !bag_find(&allRids,pRow->aParent[0]) ){ |
| 213 | if( omitDescenders ){ |
| 214 | pRow->iRail = findFreeRail(p, pRow->idx, pRow->idx, 0); |
| 215 | }else{ |
| 216 | pRow->iRail = ++p->mxRail; |
| 217 | } |
| 218 | mask = 1<<(pRow->iRail); |
| 219 | if( omitDescenders ){ |
| 220 | pRow->railInUse |= mask; |
| 221 | if( pRow->pNext ) pRow->pNext->railInUse |= mask; |
| 222 | }else{ |
| 223 | pRow->bDescender = pRow->nParent>0; |
| 224 | for(pDesc=pRow; pDesc; pDesc=pDesc->pNext){ |
| 225 | pDesc->railInUse |= mask; |
| 226 | } |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | /* Assign rails to all rows that are still unassigned. |
| 232 |
+3
-2
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -154,10 +154,11 @@ | ||
| 154 | 154 | #if INTERFACE |
| 155 | 155 | #define TIMELINE_ARTID 0x0001 /* Show artifact IDs on non-check-in lines */ |
| 156 | 156 | #define TIMELINE_LEAFONLY 0x0002 /* Show "Leaf", but not "Merge", "Fork" etc */ |
| 157 | 157 | #define TIMELINE_BRIEF 0x0004 /* Combine adjacent elements of same object */ |
| 158 | 158 | #define TIMELINE_GRAPH 0x0008 /* Compute a graph */ |
| 159 | +#define TIMELINE_DISJOINT 0x0010 /* Elements are not contiguous */ | |
| 159 | 160 | #endif |
| 160 | 161 | |
| 161 | 162 | /* |
| 162 | 163 | ** Output a timeline in the web format given a query. The query |
| 163 | 164 | ** should return these columns: |
| @@ -348,11 +349,11 @@ | ||
| 348 | 349 | @ <small><i>... %d(suppressCnt) similar |
| 349 | 350 | @ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr> |
| 350 | 351 | suppressCnt = 0; |
| 351 | 352 | } |
| 352 | 353 | if( pGraph ){ |
| 353 | - graph_finish(pGraph); | |
| 354 | + graph_finish(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0); | |
| 354 | 355 | if( pGraph->nErr ){ |
| 355 | 356 | graph_free(pGraph); |
| 356 | 357 | pGraph = 0; |
| 357 | 358 | }else{ |
| 358 | 359 | @ <tr><td><td><div style="width:%d(pGraph->mxRail*20+30)px;"></div> |
| @@ -858,11 +859,11 @@ | ||
| 858 | 859 | if( zUser ){ |
| 859 | 860 | blob_appendf(&desc, " by user %h", zUser); |
| 860 | 861 | } |
| 861 | 862 | if( tagid>0 ){ |
| 862 | 863 | blob_appendf(&desc, " tagged with \"%h\"", zTagName); |
| 863 | - tmFlags &= ~TIMELINE_GRAPH; | |
| 864 | + tmFlags |= TIMELINE_DISJOINT; | |
| 864 | 865 | } |
| 865 | 866 | if( zAfter ){ |
| 866 | 867 | blob_appendf(&desc, " occurring on or after %h.<br>", zAfter); |
| 867 | 868 | }else if( zBefore ){ |
| 868 | 869 | blob_appendf(&desc, " occurring on or before %h.<br>", zBefore); |
| 869 | 870 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -154,10 +154,11 @@ | |
| 154 | #if INTERFACE |
| 155 | #define TIMELINE_ARTID 0x0001 /* Show artifact IDs on non-check-in lines */ |
| 156 | #define TIMELINE_LEAFONLY 0x0002 /* Show "Leaf", but not "Merge", "Fork" etc */ |
| 157 | #define TIMELINE_BRIEF 0x0004 /* Combine adjacent elements of same object */ |
| 158 | #define TIMELINE_GRAPH 0x0008 /* Compute a graph */ |
| 159 | #endif |
| 160 | |
| 161 | /* |
| 162 | ** Output a timeline in the web format given a query. The query |
| 163 | ** should return these columns: |
| @@ -348,11 +349,11 @@ | |
| 348 | @ <small><i>... %d(suppressCnt) similar |
| 349 | @ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr> |
| 350 | suppressCnt = 0; |
| 351 | } |
| 352 | if( pGraph ){ |
| 353 | graph_finish(pGraph); |
| 354 | if( pGraph->nErr ){ |
| 355 | graph_free(pGraph); |
| 356 | pGraph = 0; |
| 357 | }else{ |
| 358 | @ <tr><td><td><div style="width:%d(pGraph->mxRail*20+30)px;"></div> |
| @@ -858,11 +859,11 @@ | |
| 858 | if( zUser ){ |
| 859 | blob_appendf(&desc, " by user %h", zUser); |
| 860 | } |
| 861 | if( tagid>0 ){ |
| 862 | blob_appendf(&desc, " tagged with \"%h\"", zTagName); |
| 863 | tmFlags &= ~TIMELINE_GRAPH; |
| 864 | } |
| 865 | if( zAfter ){ |
| 866 | blob_appendf(&desc, " occurring on or after %h.<br>", zAfter); |
| 867 | }else if( zBefore ){ |
| 868 | blob_appendf(&desc, " occurring on or before %h.<br>", zBefore); |
| 869 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -154,10 +154,11 @@ | |
| 154 | #if INTERFACE |
| 155 | #define TIMELINE_ARTID 0x0001 /* Show artifact IDs on non-check-in lines */ |
| 156 | #define TIMELINE_LEAFONLY 0x0002 /* Show "Leaf", but not "Merge", "Fork" etc */ |
| 157 | #define TIMELINE_BRIEF 0x0004 /* Combine adjacent elements of same object */ |
| 158 | #define TIMELINE_GRAPH 0x0008 /* Compute a graph */ |
| 159 | #define TIMELINE_DISJOINT 0x0010 /* Elements are not contiguous */ |
| 160 | #endif |
| 161 | |
| 162 | /* |
| 163 | ** Output a timeline in the web format given a query. The query |
| 164 | ** should return these columns: |
| @@ -348,11 +349,11 @@ | |
| 349 | @ <small><i>... %d(suppressCnt) similar |
| 350 | @ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr> |
| 351 | suppressCnt = 0; |
| 352 | } |
| 353 | if( pGraph ){ |
| 354 | graph_finish(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0); |
| 355 | if( pGraph->nErr ){ |
| 356 | graph_free(pGraph); |
| 357 | pGraph = 0; |
| 358 | }else{ |
| 359 | @ <tr><td><td><div style="width:%d(pGraph->mxRail*20+30)px;"></div> |
| @@ -858,11 +859,11 @@ | |
| 859 | if( zUser ){ |
| 860 | blob_appendf(&desc, " by user %h", zUser); |
| 861 | } |
| 862 | if( tagid>0 ){ |
| 863 | blob_appendf(&desc, " tagged with \"%h\"", zTagName); |
| 864 | tmFlags |= TIMELINE_DISJOINT; |
| 865 | } |
| 866 | if( zAfter ){ |
| 867 | blob_appendf(&desc, " occurring on or after %h.<br>", zAfter); |
| 868 | }else if( zBefore ){ |
| 869 | blob_appendf(&desc, " occurring on or before %h.<br>", zBefore); |
| 870 |