Fossil SCM

Further refinements to the graph layout for file histories.

drh 2010-04-04 22:40 trunk
Commit 1f607de1db8a9a30bc7accab4c107b15410ff862
1 file changed +3 -4
+3 -4
--- src/graph.c
+++ src/graph.c
@@ -206,11 +206,10 @@
206206
}
207207
for(i=0; i<32; i++){
208208
if( (inUseMask & (1<<i))==0 ){
209209
int dist;
210210
if( iNearto<=0 ){
211
- if( i>p->mxRail ) p->mxRail = i;
212211
return i;
213212
}
214213
dist = i - iNearto;
215214
if( dist<0 ) dist = -dist;
216215
if( dist<iBestDist ){
@@ -218,11 +217,10 @@
218217
iBest = i;
219218
}
220219
}
221220
}
222221
if( iBestDist>1000 ) p->nErr++;
223
- if( iBest>p->mxRail ) p->mxRail = iBest;
224222
return iBest;
225223
}
226224
227225
/*
228226
** Compute the complete graph
@@ -261,18 +259,19 @@
261259
}
262260
}
263261
}
264262
265263
/* Figure out which nodes have no direct children (children on
266
- ** the same rail). Mark such nodes is isLeaf.
264
+ ** the same rail). Mark such nodes as isLeaf.
267265
*/
268266
memset(p->apHash, 0, sizeof(p->apHash[0])*p->nHash);
269267
for(pRow=p->pLast; pRow; pRow=pRow->pPrev) pRow->isLeaf = 1;
270268
for(pRow=p->pLast; pRow; pRow=pRow->pPrev){
271269
GraphRow *pParent;
272270
hashInsert(p, pRow, 0);
273
- if( pRow->nParent>0
271
+ if( !pRow->isDup
272
+ && pRow->nParent>0
274273
&& (pParent = hashFind(p, pRow->aParent[0]))!=0
275274
&& pRow->zBranch==pParent->zBranch
276275
){
277276
pParent->isLeaf = 0;
278277
}
279278
--- src/graph.c
+++ src/graph.c
@@ -206,11 +206,10 @@
206 }
207 for(i=0; i<32; i++){
208 if( (inUseMask & (1<<i))==0 ){
209 int dist;
210 if( iNearto<=0 ){
211 if( i>p->mxRail ) p->mxRail = i;
212 return i;
213 }
214 dist = i - iNearto;
215 if( dist<0 ) dist = -dist;
216 if( dist<iBestDist ){
@@ -218,11 +217,10 @@
218 iBest = i;
219 }
220 }
221 }
222 if( iBestDist>1000 ) p->nErr++;
223 if( iBest>p->mxRail ) p->mxRail = iBest;
224 return iBest;
225 }
226
227 /*
228 ** Compute the complete graph
@@ -261,18 +259,19 @@
261 }
262 }
263 }
264
265 /* Figure out which nodes have no direct children (children on
266 ** the same rail). Mark such nodes is isLeaf.
267 */
268 memset(p->apHash, 0, sizeof(p->apHash[0])*p->nHash);
269 for(pRow=p->pLast; pRow; pRow=pRow->pPrev) pRow->isLeaf = 1;
270 for(pRow=p->pLast; pRow; pRow=pRow->pPrev){
271 GraphRow *pParent;
272 hashInsert(p, pRow, 0);
273 if( pRow->nParent>0
 
274 && (pParent = hashFind(p, pRow->aParent[0]))!=0
275 && pRow->zBranch==pParent->zBranch
276 ){
277 pParent->isLeaf = 0;
278 }
279
--- src/graph.c
+++ src/graph.c
@@ -206,11 +206,10 @@
206 }
207 for(i=0; i<32; i++){
208 if( (inUseMask & (1<<i))==0 ){
209 int dist;
210 if( iNearto<=0 ){
 
211 return i;
212 }
213 dist = i - iNearto;
214 if( dist<0 ) dist = -dist;
215 if( dist<iBestDist ){
@@ -218,11 +217,10 @@
217 iBest = i;
218 }
219 }
220 }
221 if( iBestDist>1000 ) p->nErr++;
 
222 return iBest;
223 }
224
225 /*
226 ** Compute the complete graph
@@ -261,18 +259,19 @@
259 }
260 }
261 }
262
263 /* Figure out which nodes have no direct children (children on
264 ** the same rail). Mark such nodes as isLeaf.
265 */
266 memset(p->apHash, 0, sizeof(p->apHash[0])*p->nHash);
267 for(pRow=p->pLast; pRow; pRow=pRow->pPrev) pRow->isLeaf = 1;
268 for(pRow=p->pLast; pRow; pRow=pRow->pPrev){
269 GraphRow *pParent;
270 hashInsert(p, pRow, 0);
271 if( !pRow->isDup
272 && pRow->nParent>0
273 && (pParent = hashFind(p, pRow->aParent[0]))!=0
274 && pRow->zBranch==pParent->zBranch
275 ){
276 pParent->isLeaf = 0;
277 }
278

Keyboard Shortcuts

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