@@ -41,10 +41,22 @@
41 41 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** the rails used for merge arrows.
42 42 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
43 43 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
44 44 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#if INTERFACE
45 45 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
46 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ /*
47 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** The type of integer identifiers for rows of the graph.
48 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ **
49 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** For a normal /timeline graph, the identifiers are never that big
50 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** an an ordinary 32-bit int will work fine. But for the /finfo page,
51 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** the identifier is a combination of the BLOB.RID and the FILENAME.FNID
52 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** values, and so it can become quite large for repos that have both many
53 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** check-ins and many files. For this reason, we make the identifier
54 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ ** a 64-bit integer, to dramatically reduce the risk of an overflow.
55 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ */
56 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ typedef sqlite3_int64 GraphRowId;
57 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+
46 58 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
#define GR_MAX_RAIL 40 /* Max number of "rails" to display */
47 59 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
48 60 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* The graph appears vertically beside a timeline. Each row in the
49 61 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** timeline corresponds to a row in the graph. GraphRow.idx is 0 for
50 62 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** the top-most row and increases moving down. Hence (in the absence of
@@ -52,16 +64,16 @@
52 64 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
**
53 65 { 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
54 66 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** but which are included just so that we can capture their background color.
55 67 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
56 68 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
struct GraphRow {
57 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- int rid; /* The rid for the check-in */
69 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ GraphRowId rid; /* The rid for the check-in */
58 70 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
i8 nParent; /* Number of parents. */
59 71 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
i8 nCherrypick; /* Subset of aParent that are cherrypicks */
60 72 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
i8 nNonCherrypick; /* Number of non-cherrypick parents */
61 73 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
u8 nMergeChild; /* Number of merge children */
62 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- int *aParent; /* Array of parents. 0 element is primary .*/
74 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ GraphRowId *aParent; /* Array of parents. 0 element is primary .*/
63 75 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
char *zBranch; /* Branch name */
64 76 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
char *zBgClr; /* Background Color */
65 77 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
char zUuid[HNAME_MAX+1]; /* Check-in for file ID */
66 78 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
67 79 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
GraphRow *pNext; /* Next row down in the list of all rows */
@@ -176,11 +188,11 @@
176 188 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
177 189 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
178 190 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/*
179 191 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** Look up the row with rid.
180 192 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
181 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- static GraphRow *hashFind(GraphContext *p, int rid){
193 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ static GraphRow *hashFind(GraphContext *p, GraphRowId rid){
182 194 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int h = rid % p->nHash;
183 195 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
while( p->apHash[h] && p->apHash[h]->rid!=rid ){
184 196 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
h++;
185 197 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( h>=p->nHash ) h = 0;
186 198 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
@@ -212,14 +224,14 @@
212 224 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/*
213 225 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** Add a new row to the graph context. Rows are added from top to bottom.
214 226 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
215 227 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int graph_add_row(
216 228 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
GraphContext *p, /* The context to which the row is added */
217 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- int rid, /* RID for the check-in */
229 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ GraphRowId rid, /* RID for the check-in */
218 230 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int nParent, /* Number of parents */
219 231 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int nCherrypick, /* How many of aParent[] are actually cherrypicks */
220 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- int *aParent, /* Array of parents */
232 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ GraphRowId *aParent, /* Array of parents */
221 233 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
const char *zBranch, /* Branch for this check-in */
222 234 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
const char *zBgClr, /* Background color. NULL or "" for white. */
223 235 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
const char *zUuid, /* hash name of the object being graphed */
224 236 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int isLeaf /* True if this row is a leaf */
225 237 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
){
@@ -229,11 +241,11 @@
229 241 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
230 242 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( p->nErr ) return 0;
231 243 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
nByte = sizeof(GraphRow);
232 244 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( nParent>0 ) nByte += sizeof(pRow->aParent[0])*nParent;
233 245 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow = (GraphRow*)safeMalloc( nByte );
234 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- pRow->aParent = nParent>0 ? (int*)&pRow[1] : 0;
246 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ pRow->aParent = nParent>0 ? (GraphRowId*)&pRow[1] : 0;
235 247 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->rid = rid;
236 248 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( nCherrypick>=nParent ){
237 249 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
nCherrypick = nParent-1; /* Safety. Should never happen. */
238 250 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
239 251 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->nParent = nParent;
@@ -440,11 +452,11 @@
440 452 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
441 453 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* If mergeRiserFrom[X]==Y that means rail X holds a merge riser
442 454 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** coming up from the bottom of the graph from off-screen check-in Y
443 455 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** where Y is the RID. There is no riser on rail X if mergeRiserFrom[X]==0.
444 456 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
445 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- int mergeRiserFrom[GR_MAX_RAIL];
457 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ GraphRowId mergeRiserFrom[GR_MAX_RAIL];
446 458 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
447 459 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( p==0 || p->pFirst==0 || p->nErr ) return;
448 460 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
p->nErr = 1; /* Assume an error until proven otherwise */
449 461 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
450 462 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Initialize all rows */
@@ -514,11 +526,11 @@
514 526 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
iBest = i;
515 527 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
516 528 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
517 529 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
i = pRow->nNonCherrypick;
518 530 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( iBest>i ){
519 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- int x = pRow->aParent[i];
531 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ GraphRowId x = pRow->aParent[i];
520 532 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->aParent[i] = pRow->aParent[iBest];
521 533 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->aParent[iBest] = x;
522 534 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
523 535 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
524 536 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pRow->nNonCherrypick>2 ){
@@ -534,11 +546,11 @@
534 546 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
iDeepest = pParent->idx;
535 547 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
iBest = i;
536 548 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
537 549 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
538 550 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( iBest>1 ){
539 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- int x = pRow->aParent[1];
551 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ GraphRowId x = pRow->aParent[1];
540 552 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->aParent[1] = pRow->aParent[iBest];
541 553 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->aParent[iBest] = x;
542 554 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
543 555 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
544 556 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
@@ -554,11 +566,11 @@
554 566 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pParent==0 ) continue; /* Parent off-screen */
555 567 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pParent->zBranch==pRow->zBranch ) continue; /* Same branch */
556 568 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(i=1; i<pRow->nNonCherrypick; i++){
557 569 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pParent = hashFind(p, pRow->aParent[i]);
558 570 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pParent && pParent->zBranch==pRow->zBranch ){
559 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- int t = pRow->aParent[0];
571 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ GraphRowId t = pRow->aParent[0];
560 572 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->aParent[0] = pRow->aParent[i];
561 573 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
pRow->aParent[i] = t;
562 574 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
break;
563 575 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
564 576 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
@@ -652,11 +664,11 @@
652 664 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
}
653 665 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
654 666 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Assign rails to all rows that are still unassigned.
655 667 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
*/
656 668 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(pRow=p->pLast; pRow; pRow=pRow->pPrev){
657 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- int parentRid;
669 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ GraphRowId parentRid;
658 670 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
659 671 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pRow->iRail>=0 ){
660 672 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( pRow->pChild==0 && !pRow->timeWarp ){
661 673 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( !omitDescenders && count_nonbranch_children(pRow->rid)!=0 ){
662 674 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
riser_to_top(pRow);
@@ -726,11 +738,11 @@
726 738 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
727 739 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int iReuseIdx = -1;
728 740 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int iReuseRail = -1;
729 741 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
int isCherrypick = 0;
730 742 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
for(i=1; i<pRow->nParent; i++){
731 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
- int parentRid = pRow->aParent[i];
743 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
+ GraphRowId parentRid = pRow->aParent[i];
732 744 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
if( i==pRow->nNonCherrypick ){
733 745 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
/* Because full merges are laid out before cherrypicks,
734 746 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** it is ok to use a full-merge raise for a cherrypick.
735 747 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** See the graph on check-in 8ac66ef33b464d28 for example
736 748 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!
** iReuseIdx = -1;
737 749 { copied = false; pop = false }, 1000)" :class="copied && 'copied'">Copy link Copied!