@@ -18,10 +18,30 @@
18 18 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** This file contains code to compute a revision history graph.
19 19 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
20 20 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#include "config.h"
21 21 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#include "graph.h"
22 22 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#include <assert.h>
23 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+
24 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ /* Notes:
25 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ **
26 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** The graph is laid out in 1 or more "rails". A "rail" is a vertical
27 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** band in the graph in which one can place nodes or arrows connecting
28 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** nodes. There can be between 1 and GR_MAX_RAIL rails. If the graph
29 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** is to complex to be displayed in GR_MAX_RAIL rails, it is omitted.
30 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ **
31 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** A "riser" is the thick line that comes out of the top of a node and
32 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** goes up to the next node on the branch, or to the top of the screen.
33 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** A "descender" is a thick line that comes out of the bottom of a node
34 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** and proceeds down to the bottom of the page.
35 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ **
36 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** Invoke graph_init() to create a new GraphContext object. Then
37 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** call graph_add_row() to add nodes, one by one, to the graph.
38 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** Nodes must be added in display order, from top to bottom.
39 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** Then invoke graph_render() to run the layout algorithm. The
40 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** layout algorithm computes which rails all of the nodes sit on, and
41 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** the rails used for merge arrows.
42 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ */
23 43 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
24 44 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#if INTERFACE
25 45 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
26 46 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define GR_MAX_RAIL 40 /* Max number of "rails" to display */
27 47 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
@@ -33,11 +53,11 @@
33 53 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** The nParent field is -1 for entires that do not participate in the graph
34 54 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** but which are included just so that we can capture their background color.
35 55 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
36 56 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
struct GraphRow {
37 57 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int rid; /* The rid for the check-in */
38 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- i8 nParent; /* Number of parents. -1 for technote lines */
58 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ i8 nParent; /* Number of parents. */
39 59 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
i8 nCherrypick; /* Subset of aParent that are cherrypicks */
40 60 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
i8 nNonCherrypick; /* Number of non-cherrypick parents */
41 61 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int *aParent; /* Array of parents. 0 element is primary .*/
42 62 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
char *zBranch; /* Branch name */
43 63 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
char *zBgClr; /* Background Color */
@@ -44,11 +64,11 @@
44 64 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
char zUuid[HNAME_MAX+1]; /* Check-in for file ID */
45 65 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
46 66 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
GraphRow *pNext; /* Next row down in the list of all rows */
47 67 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
GraphRow *pPrev; /* Previous row */
48 68 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
49 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- int idx; /* Row index. First is 1. 0 used for "none" */
69 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ int idx; /* Row index. Top row is smallest. */
50 70 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int idxTop; /* Direct descendent highest up on the graph */
51 71 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
GraphRow *pChild; /* Child immediately above this node */
52 72 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
u8 isDup; /* True if this is duplicate of a prior entry */
53 73 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
u8 isLeaf; /* True if this is a leaf node */
54 74 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
u8 isStepParent; /* pChild is actually a step-child */
@@ -61,11 +81,10 @@
61 81 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */
62 82 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int mergeUpto; /* Draw the mergeOut rail up to this level */
63 83 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int cherrypickUpto; /* Continue the mergeOut rail up to here */
64 84 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
u64 mergeDown; /* Draw merge lines up from bottom of graph */
65 85 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
u64 cherrypickDown; /* Draw cherrypick lines up from bottom */
66 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
-
67 86 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
u64 railInUse; /* Mask of occupied rails at this row */
68 87 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
};
69 88 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
70 89 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Context while building a graph
71 90 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
@@ -83,10 +102,17 @@
83 102 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
84 103 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#endif
85 104 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
86 105 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* The N-th bit */
87 106 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define BIT(N) (((u64)1)<<(N))
107 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+
108 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ /*
109 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** Number of rows before and answer a node with a riser or descender
110 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** that goes off-screen before we can reuse that rail.
111 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ */
112 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ #define RISER_MARGIN 4
113 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+
88 114 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
89 115 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/*
90 116 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** Malloc for zeroed space. Panic if unable to provide the
91 117 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** requested space.
92 118 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
@@ -246,11 +272,11 @@
246 272 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(pRow=p->pFirst; pRow && pRow->idx<top; pRow=pRow->pNext){}
247 273 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
while( pRow && pRow->idx<=btm ){
248 274 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
inUseMask |= pRow->railInUse;
249 275 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow = pRow->pNext;
250 276 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
251 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- for(i=0; i<32; i++){
277 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ for(i=0; i<GR_MAX_RAIL; i++){
252 278 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( (inUseMask & BIT(i))==0 ){
253 279 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int dist;
254 280 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( iNearto<=0 ){
255 281 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
return i;
256 282 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
@@ -268,11 +294,11 @@
268 294 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
269 295 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
270 296 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/*
271 297 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** Assign all children of node pBottom to the same rail as pBottom.
272 298 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
273 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- static void assignChildrenToRail(GraphRow *pBottom){
299 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ static void assignChildrenToRail(GraphRow *pBottom, u32 tmFlags){
274 300 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int iRail = pBottom->iRail;
275 301 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
GraphRow *pCurrent;
276 302 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
GraphRow *pPrior;
277 303 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
u64 mask = ((u64)1)<<iRail;
278 304 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
@@ -287,10 +313,18 @@
287 313 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
while( pPrior->idx > pCurrent->idx ){
288 314 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pPrior->railInUse |= mask;
289 315 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pPrior = pPrior->pPrev;
290 316 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
assert( pPrior!=0 );
291 317 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
318 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ }
319 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ /* Mask of additional rows for the riser to infinity */
320 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( !pPrior->isLeaf && (tmFlags & TIMELINE_DISJOINT)==0 ){
321 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ int n = RISER_MARGIN;
322 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ GraphRow *p;
323 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ for(p=pPrior; p && (n--)>0; p=p->pPrev){
324 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ p->railInUse |= mask;
325 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ }
292 326 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
293 327 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
294 328 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
295 329 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/*
296 330 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** Create a merge-arrow riser going from pParent up to pChild.
@@ -305,20 +339,21 @@
305 339 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
u64 mask;
306 340 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
GraphRow *pLoop;
307 341 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
308 342 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pParent->mergeOut<0 ){
309 343 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
u = pParent->aiRiser[pParent->iRail];
310 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- if( u>=0 && u<pChild->idx ){
344 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( u>0 && u<pChild->idx ){
311 345 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* The thick arrow up to the next primary child of pDesc goes
312 346 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** further up than the thin merge arrow riser, so draw them both
313 347 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** on the same rail. */
314 348 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pParent->mergeOut = pParent->iRail;
315 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- }else{
349 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ }else{
316 350 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* The thin merge arrow riser is taller than the thick primary
317 351 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** child riser, so use separate rails. */
318 352 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int iTarget = pParent->iRail;
319 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- pParent->mergeOut = findFreeRail(p, pChild->idx, pParent->idx-1, iTarget);
353 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ int iBtm = pParent->idx - (u==0 ? RISER_MARGIN : 1);
354 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ pParent->mergeOut = findFreeRail(p, pChild->idx, iBtm, iTarget);
320 355 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
mask = BIT(pParent->mergeOut);
321 356 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(pLoop=pChild->pNext; pLoop && pLoop->rid!=pParent->rid;
322 357 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pLoop=pLoop->pNext){
323 358 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pLoop->railInUse |= mask;
324 359 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
@@ -353,16 +388,18 @@
353 388 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
354 389 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
355 390 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
356 391 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
357 392 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/*
358 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- ** Draw a riser from pRow to the top of the graph
393 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** Draw a riser from pRow upward to indicate that it is going
394 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** to a node that is off the graph to the top.
359 395 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
360 396 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
static void riser_to_top(GraphRow *pRow){
361 397 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
u64 mask = BIT(pRow->iRail);
398 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ int n = RISER_MARGIN;
362 399 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->aiRiser[pRow->iRail] = 0;
363 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- while( pRow ){
400 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ while( pRow && (n--)>0 ){
364 401 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->railInUse |= mask;
365 402 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow = pRow->pPrev;
366 403 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
367 404 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
368 405 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
@@ -378,10 +415,11 @@
378 415 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** The tmFlags parameter is zero or more of the TIMELINE_* constants.
379 416 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** Only the following are honored:
380 417 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
**
381 418 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** TIMELINE_DISJOINT: Omit descenders
382 419 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** TIMELINE_FILLGAPS: Use step-children
420 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** TIMELINE_XMERGE: Omit off-graph merge lines
383 421 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
384 422 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
void graph_finish(GraphContext *p, u32 tmFlags){
385 423 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
386 424 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int i, j;
387 425 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
u64 mask;
@@ -421,11 +459,11 @@
421 459 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** A merge parent is a prior check-in from which changes were merged into
422 460 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** the current check-in. If a merge parent is not in the visible section
423 461 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** of this graph, then no arrows will be drawn for it, so remove it from
424 462 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** the aParent[] array.
425 463 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
426 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- if( omitDescenders ){
464 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( (tmFlags & (TIMELINE_DISJOINT|TIMELINE_XMERGE))!=0 ){
427 465 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
428 466 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(i=1; i<pRow->nParent; i++){
429 467 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( hashFind(p, pRow->aParent[i])==0 ){
430 468 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
memmove(pRow->aParent+i, pRow->aParent+i+1,
431 469 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
sizeof(pRow->aParent[0])*(pRow->nParent-i-1));
@@ -477,71 +515,72 @@
477 515 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pRow->nParent<=0 ) continue; /* Root node */
478 516 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pParent = hashFind(p, pRow->aParent[0]);
479 517 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pParent==0 ) continue; /* Parent off-screen */
480 518 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pParent->zBranch!=pRow->zBranch ) continue; /* Different branch */
481 519 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pParent->idx <= pRow->idx ){
482 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- pParent->timeWarp = 1;
483 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- continue; /* Time-warp */
484 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- }
485 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- if( pRow->idxTop < pParent->idxTop ){
520 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ pParent->timeWarp = 1;
521 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ }else if( pRow->idx < pParent->idx ){
486 522 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pParent->pChild = pRow;
487 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- pParent->idxTop = pRow->idxTop;
488 523 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
489 524 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
490 525 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
491 526 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( tmFlags & TIMELINE_FILLGAPS ){
492 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- /* If a node has no pChild, and there is a later node (a node higher
493 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- ** up on the graph) in the same branch that has no parent, then make
494 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- ** the lower node a step-child of the upper node.
527 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ /* If a node has no pChild but there is a node higher up in the graph
528 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** that is in the same branch and that other node has no parent in
529 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** the graph, the lower node a step-child of the upper node. This will
530 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** be represented on the graph by a thick dotted line without an arrowhead.
495 531 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
496 532 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
497 533 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pRow->pChild ) continue;
498 534 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(pLoop=pRow->pPrev; pLoop; pLoop=pLoop->pPrev){
499 535 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pLoop->nParent>0
500 536 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
&& pLoop->zBranch==pRow->zBranch
501 537 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
&& hashFind(p,pLoop->aParent[0])==0
502 538 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
){
503 539 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->pChild = pLoop;
504 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- pRow->idxTop = pLoop->idxTop;
505 540 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->isStepParent = 1;
506 541 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pLoop->aParent[0] = pRow->rid;
507 542 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
break;
508 543 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
509 544 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
510 545 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
511 546 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
547 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+
548 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ /* Set the idxTop values for all entries. The idxTop value is the
549 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** "idx" value for the top entry in its stack of children.
550 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ */
551 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
552 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ GraphRow *pChild = pRow->pChild;
553 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( pChild && pRow->idxTop>pChild->idxTop ){
554 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ pRow->idxTop = pChild->idxTop;
555 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ }
556 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ }
512 557 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
513 558 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Identify rows where the primary parent is off screen. Assign
514 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- ** each to a rail and draw descenders to the bottom of the screen.
559 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** each to a rail and draw descenders downward.
515 560 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
**
516 561 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** Strive to put the "trunk" branch on far left.
517 562 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
518 563 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
zTrunk = persistBranchName(p, "trunk");
519 564 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(i=0; i<2; i++){
520 565 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(pRow=p->pLast; pRow; pRow=pRow->pPrev){
566 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( i==0 && pRow->zBranch!=zTrunk ) continue;
567 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ if( pRow->iRail>=0 ) continue;
521 568 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pRow->isDup ) continue;
522 569 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pRow->nParent<0 ) continue;
523 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- if( i==0 ){
524 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- if( pRow->zBranch!=zTrunk ) continue;
525 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- }else {
526 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- if( pRow->iRail>=0 ) continue;
527 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- }
528 570 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pRow->nParent==0 || hashFind(p,pRow->aParent[0])==0 ){
529 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- if( omitDescenders ){
530 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- pRow->iRail = findFreeRail(p, pRow->idxTop, pRow->idx, 0);
531 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- }else{
532 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- pRow->iRail = ++p->mxRail;
533 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- }
571 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ pRow->iRail = findFreeRail(p, pRow->idxTop, pRow->idx+RISER_MARGIN, 0);
534 572 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( p->mxRail>=GR_MAX_RAIL ) return;
535 573 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
mask = BIT(pRow->iRail);
536 574 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( !omitDescenders ){
575 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ int n = RISER_MARGIN;
537 576 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->bDescender = pRow->nParent>0;
538 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- for(pLoop=pRow; pLoop; pLoop=pLoop->pNext){
577 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ for(pLoop=pRow; pLoop && (n--)>0; pLoop=pLoop->pNext){
539 578 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pLoop->railInUse |= mask;
540 579 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
541 580 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
542 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- assignChildrenToRail(pRow);
581 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ assignChildrenToRail(pRow, tmFlags);
543 582 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
544 583 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
545 584 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
546 585 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
547 586 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Assign rails to all rows that are still unassigned.
@@ -570,11 +609,12 @@
570 609 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
continue;
571 610 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
572 611 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pParent->idx>pRow->idx ){
573 612 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Common case: Child occurs after parent and is above the
574 613 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** parent in the timeline */
575 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- pRow->iRail = findFreeRail(p, 0, pParent->idx, pParent->iRail);
614 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ pRow->iRail = findFreeRail(p, pRow->idxTop, pParent->idx,
615 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ pParent->iRail);
576 616 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( p->mxRail>=GR_MAX_RAIL ) return;
577 617 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pParent->aiRiser[pRow->iRail] = pRow->idx;
578 618 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}else{
579 619 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Timewarp case: Child occurs earlier in time than parent and
580 620 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** appears below the parent in the timeline. */
@@ -591,11 +631,11 @@
591 631 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
592 632 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
593 633 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
mask = BIT(pRow->iRail);
594 634 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->railInUse |= mask;
595 635 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pRow->pChild ){
596 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- assignChildrenToRail(pRow);
636 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ assignChildrenToRail(pRow, tmFlags);
597 637 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}else if( !omitDescenders && count_nonbranch_children(pRow->rid)!=0 ){
598 638 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( !pRow->timeWarp ) riser_to_top(pRow);
599 639 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
600 640 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pParent ){
601 641 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(pLoop=pParent->pPrev; pLoop && pLoop!=pRow; pLoop=pLoop->pPrev){
602 642 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!