Fossil SCM

Enable the graph for tag timelines, but omit descenders.

drh 2010-02-09 13:36 trunk
Commit 22b6887e40adf0cf59a2d4c588124a886f2a290c
2 files changed +14 -5 +3 -2
+14 -5
--- src/graph.c
+++ src/graph.c
@@ -170,11 +170,11 @@
170170
}
171171
172172
/*
173173
** Compute the complete graph
174174
*/
175
-void graph_finish(GraphContext *p){
175
+void graph_finish(GraphContext *p, int omitDescenders){
176176
GraphRow *pRow, *pDesc;
177177
Bag allRids;
178178
int i;
179179
int nRow;
180180
u32 mask;
@@ -208,15 +208,24 @@
208208
/* Identify rows where the primary parent is off screen. Assign
209209
** each to a rail and draw descenders to the bottom of the screen.
210210
*/
211211
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
212212
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
+ }
215218
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
+ }
218227
}
219228
}
220229
}
221230
222231
/* Assign rails to all rows that are still unassigned.
223232
--- 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 @@
154154
#if INTERFACE
155155
#define TIMELINE_ARTID 0x0001 /* Show artifact IDs on non-check-in lines */
156156
#define TIMELINE_LEAFONLY 0x0002 /* Show "Leaf", but not "Merge", "Fork" etc */
157157
#define TIMELINE_BRIEF 0x0004 /* Combine adjacent elements of same object */
158158
#define TIMELINE_GRAPH 0x0008 /* Compute a graph */
159
+#define TIMELINE_DISJOINT 0x0010 /* Elements are not contiguous */
159160
#endif
160161
161162
/*
162163
** Output a timeline in the web format given a query. The query
163164
** should return these columns:
@@ -348,11 +349,11 @@
348349
@ <small><i>... %d(suppressCnt) similar
349350
@ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr>
350351
suppressCnt = 0;
351352
}
352353
if( pGraph ){
353
- graph_finish(pGraph);
354
+ graph_finish(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0);
354355
if( pGraph->nErr ){
355356
graph_free(pGraph);
356357
pGraph = 0;
357358
}else{
358359
@ <tr><td><td><div style="width:%d(pGraph->mxRail*20+30)px;"></div>
@@ -858,11 +859,11 @@
858859
if( zUser ){
859860
blob_appendf(&desc, " by user %h", zUser);
860861
}
861862
if( tagid>0 ){
862863
blob_appendf(&desc, " tagged with \"%h\"", zTagName);
863
- tmFlags &= ~TIMELINE_GRAPH;
864
+ tmFlags |= TIMELINE_DISJOINT;
864865
}
865866
if( zAfter ){
866867
blob_appendf(&desc, " occurring on or after %h.<br>", zAfter);
867868
}else if( zBefore ){
868869
blob_appendf(&desc, " occurring on or before %h.<br>", zBefore);
869870
--- 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

Keyboard Shortcuts

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