Fossil SCM
Show cherrypick merges on the default timeline. Disable the display of cherrypicks using the "ncp" query parameter. Currently, the only display difference between a normal merge and a cherrypick merges is in the final horizontal segment of the merge line as it moves into the child node. More work is needed on the display logic.
Commit
55ab522ceee25230fb628d9e8cafbdb5fb11143d5e25bd5f0f0a9284f97ae5bc
Parent
c0a5083edaa3bc6…
5 files changed
+15
+1
-1
+34
-10
+32
-6
+44
-8
+15
| --- src/default_css.txt | ||
| +++ src/default_css.txt | ||
| @@ -158,10 +158,25 @@ | ||
| 158 | 158 | .tl-arrow.merge.r { |
| 159 | 159 | border-left: 3px solid #000; |
| 160 | 160 | } |
| 161 | 161 | .tl-line.merge { |
| 162 | 162 | width: 1px; |
| 163 | +} | |
| 164 | +.tl-arrow.cherrypick { | |
| 165 | + height: 1px; | |
| 166 | + border-width: 2px 0; | |
| 167 | +} | |
| 168 | +.tl-arrow.cherrypick.l { | |
| 169 | + border-right: 3px solid #000; | |
| 170 | +} | |
| 171 | +.tl-arrow.cherrypick.r { | |
| 172 | + border-left: 3px solid #000; | |
| 173 | +} | |
| 174 | +.tl-line.cherrypick { | |
| 175 | + width: 0px; | |
| 176 | + border-top: 1px dashed #000; | |
| 177 | + background: #fff; | |
| 163 | 178 | } |
| 164 | 179 | .tl-arrow.warp { |
| 165 | 180 | margin-left: 1px; |
| 166 | 181 | border-width: 3px 0; |
| 167 | 182 | border-left: 7px solid #600000; |
| 168 | 183 |
| --- src/default_css.txt | |
| +++ src/default_css.txt | |
| @@ -158,10 +158,25 @@ | |
| 158 | .tl-arrow.merge.r { |
| 159 | border-left: 3px solid #000; |
| 160 | } |
| 161 | .tl-line.merge { |
| 162 | width: 1px; |
| 163 | } |
| 164 | .tl-arrow.warp { |
| 165 | margin-left: 1px; |
| 166 | border-width: 3px 0; |
| 167 | border-left: 7px solid #600000; |
| 168 |
| --- src/default_css.txt | |
| +++ src/default_css.txt | |
| @@ -158,10 +158,25 @@ | |
| 158 | .tl-arrow.merge.r { |
| 159 | border-left: 3px solid #000; |
| 160 | } |
| 161 | .tl-line.merge { |
| 162 | width: 1px; |
| 163 | } |
| 164 | .tl-arrow.cherrypick { |
| 165 | height: 1px; |
| 166 | border-width: 2px 0; |
| 167 | } |
| 168 | .tl-arrow.cherrypick.l { |
| 169 | border-right: 3px solid #000; |
| 170 | } |
| 171 | .tl-arrow.cherrypick.r { |
| 172 | border-left: 3px solid #000; |
| 173 | } |
| 174 | .tl-line.cherrypick { |
| 175 | width: 0px; |
| 176 | border-top: 1px dashed #000; |
| 177 | background: #fff; |
| 178 | } |
| 179 | .tl-arrow.warp { |
| 180 | margin-left: 1px; |
| 181 | border-width: 3px 0; |
| 182 | border-left: 7px solid #600000; |
| 183 |
+1
-1
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -503,11 +503,11 @@ | ||
| 503 | 503 | zBgClr = hash_color(zUser); |
| 504 | 504 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 505 | 505 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| 506 | 506 | } |
| 507 | 507 | gidx = graph_add_row(pGraph, frid>0 ? frid : fpid+1000000000, |
| 508 | - nParent, aParent, zBr, zBgClr, | |
| 508 | + nParent, 0, aParent, zBr, zBgClr, | |
| 509 | 509 | zUuid, 0); |
| 510 | 510 | if( strncmp(zDate, zPrevDate, 10) ){ |
| 511 | 511 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 512 | 512 | @ <tr><td> |
| 513 | 513 | @ <div class="divider timelineDate">%s(zPrevDate)</div> |
| 514 | 514 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -503,11 +503,11 @@ | |
| 503 | zBgClr = hash_color(zUser); |
| 504 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 505 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| 506 | } |
| 507 | gidx = graph_add_row(pGraph, frid>0 ? frid : fpid+1000000000, |
| 508 | nParent, aParent, zBr, zBgClr, |
| 509 | zUuid, 0); |
| 510 | if( strncmp(zDate, zPrevDate, 10) ){ |
| 511 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 512 | @ <tr><td> |
| 513 | @ <div class="divider timelineDate">%s(zPrevDate)</div> |
| 514 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -503,11 +503,11 @@ | |
| 503 | zBgClr = hash_color(zUser); |
| 504 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 505 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| 506 | } |
| 507 | gidx = graph_add_row(pGraph, frid>0 ? frid : fpid+1000000000, |
| 508 | nParent, 0, aParent, zBr, zBgClr, |
| 509 | zUuid, 0); |
| 510 | if( strncmp(zDate, zPrevDate, 10) ){ |
| 511 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 512 | @ <tr><td> |
| 513 | @ <div class="divider timelineDate">%s(zPrevDate)</div> |
| 514 |
+34
-10
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -34,10 +34,12 @@ | ||
| 34 | 34 | ** but which are included just so that we can capture their background color. |
| 35 | 35 | */ |
| 36 | 36 | struct GraphRow { |
| 37 | 37 | int rid; /* The rid for the check-in */ |
| 38 | 38 | i8 nParent; /* Number of parents. -1 for technote lines */ |
| 39 | + i8 nCherrypick; /* Subset of aParent that are cherrypicks */ | |
| 40 | + i8 nNonCherrypick; /* Number of non-cherrypick parents */ | |
| 39 | 41 | int *aParent; /* Array of parents. 0 element is primary .*/ |
| 40 | 42 | char *zBranch; /* Branch name */ |
| 41 | 43 | char *zBgClr; /* Background Color */ |
| 42 | 44 | char zUuid[HNAME_MAX+1]; /* Check-in for file ID */ |
| 43 | 45 | |
| @@ -55,10 +57,11 @@ | ||
| 55 | 57 | i8 mergeOut; /* Merge out to this rail. -1 if no merge-out */ |
| 56 | 58 | u8 mergeIn[GR_MAX_RAIL]; /* Merge in from non-zero rails */ |
| 57 | 59 | int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */ |
| 58 | 60 | int mergeUpto; /* Draw the mergeOut rail up to this level */ |
| 59 | 61 | u64 mergeDown; /* Draw merge lines up from bottom of graph */ |
| 62 | + u64 cherrypickDown; /* Draw cherrypick lines up from bottom */ | |
| 60 | 63 | |
| 61 | 64 | u64 railInUse; /* Mask of occupied rails at this row */ |
| 62 | 65 | }; |
| 63 | 66 | |
| 64 | 67 | /* Context while building a graph |
| @@ -179,10 +182,11 @@ | ||
| 179 | 182 | */ |
| 180 | 183 | int graph_add_row( |
| 181 | 184 | GraphContext *p, /* The context to which the row is added */ |
| 182 | 185 | int rid, /* RID for the check-in */ |
| 183 | 186 | int nParent, /* Number of parents */ |
| 187 | + int nCherrypick, /* How many of aParent[] are actually cherrypicks */ | |
| 184 | 188 | int *aParent, /* Array of parents */ |
| 185 | 189 | const char *zBranch, /* Branch for this check-in */ |
| 186 | 190 | const char *zBgClr, /* Background color. NULL or "" for white. */ |
| 187 | 191 | const char *zUuid, /* hash name of the object being graphed */ |
| 188 | 192 | int isLeaf /* True if this row is a leaf */ |
| @@ -195,11 +199,16 @@ | ||
| 195 | 199 | nByte = sizeof(GraphRow); |
| 196 | 200 | if( nParent>0 ) nByte += sizeof(pRow->aParent[0])*nParent; |
| 197 | 201 | pRow = (GraphRow*)safeMalloc( nByte ); |
| 198 | 202 | pRow->aParent = nParent>0 ? (int*)&pRow[1] : 0; |
| 199 | 203 | pRow->rid = rid; |
| 204 | + if( nCherrypick>=nParent ){ | |
| 205 | + nCherrypick = nParent-1; /* Safety. Should never happen. */ | |
| 206 | + } | |
| 200 | 207 | pRow->nParent = nParent; |
| 208 | + pRow->nCherrypick = nCherrypick; | |
| 209 | + pRow->nNonCherrypick = nParent - nCherrypick; | |
| 201 | 210 | pRow->zBranch = persistBranchName(p, zBranch); |
| 202 | 211 | if( zUuid==0 ) zUuid = ""; |
| 203 | 212 | sqlite3_snprintf(sizeof(pRow->zUuid), pRow->zUuid, "%s", zUuid); |
| 204 | 213 | pRow->isLeaf = isLeaf; |
| 205 | 214 | memset(pRow->aiRiser, -1, sizeof(pRow->aiRiser)); |
| @@ -284,11 +293,12 @@ | ||
| 284 | 293 | ** Create a merge-arrow riser going from pParent up to pChild. |
| 285 | 294 | */ |
| 286 | 295 | static void createMergeRiser( |
| 287 | 296 | GraphContext *p, |
| 288 | 297 | GraphRow *pParent, |
| 289 | - GraphRow *pChild | |
| 298 | + GraphRow *pChild, | |
| 299 | + int isCherrypick | |
| 290 | 300 | ){ |
| 291 | 301 | int u; |
| 292 | 302 | u64 mask; |
| 293 | 303 | GraphRow *pLoop; |
| 294 | 304 | |
| @@ -311,11 +321,11 @@ | ||
| 311 | 321 | pLoop=pLoop->pNext){ |
| 312 | 322 | pLoop->railInUse |= mask; |
| 313 | 323 | } |
| 314 | 324 | } |
| 315 | 325 | } |
| 316 | - pChild->mergeIn[pParent->mergeOut] = 1; | |
| 326 | + pChild->mergeIn[pParent->mergeOut] = isCherrypick ? 2 : 1; | |
| 317 | 327 | } |
| 318 | 328 | |
| 319 | 329 | /* |
| 320 | 330 | ** Compute the maximum rail number. |
| 321 | 331 | */ |
| @@ -323,11 +333,13 @@ | ||
| 323 | 333 | GraphRow *pRow; |
| 324 | 334 | p->mxRail = 0; |
| 325 | 335 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 326 | 336 | if( pRow->iRail>p->mxRail ) p->mxRail = pRow->iRail; |
| 327 | 337 | if( pRow->mergeOut>p->mxRail ) p->mxRail = pRow->mergeOut; |
| 328 | - while( p->mxRail<GR_MAX_RAIL && pRow->mergeDown>(BIT(p->mxRail+1)-1) ){ | |
| 338 | + while( p->mxRail<GR_MAX_RAIL | |
| 339 | + && (pRow->mergeDown|pRow->cherrypickDown)>(BIT(p->mxRail+1)-1) | |
| 340 | + ){ | |
| 329 | 341 | p->mxRail++; |
| 330 | 342 | } |
| 331 | 343 | } |
| 332 | 344 | } |
| 333 | 345 | |
| @@ -395,11 +407,18 @@ | ||
| 395 | 407 | */ |
| 396 | 408 | if( omitDescenders ){ |
| 397 | 409 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 398 | 410 | for(i=1; i<pRow->nParent; i++){ |
| 399 | 411 | if( hashFind(p, pRow->aParent[i])==0 ){ |
| 400 | - pRow->aParent[i] = pRow->aParent[--pRow->nParent]; | |
| 412 | + memmove(pRow->aParent+i, pRow->aParent+i+1, | |
| 413 | + sizeof(pRow->aParent[0])*(pRow->nParent-i-1)); | |
| 414 | + pRow->nParent--; | |
| 415 | + if( i<pRow->nNonCherrypick ){ | |
| 416 | + pRow->nNonCherrypick--; | |
| 417 | + }else{ | |
| 418 | + pRow->nCherrypick--; | |
| 419 | + } | |
| 401 | 420 | i--; |
| 402 | 421 | } |
| 403 | 422 | } |
| 404 | 423 | } |
| 405 | 424 | } |
| @@ -408,15 +427,15 @@ | ||
| 408 | 427 | ** other parents in the same branch, reorder the parents to make |
| 409 | 428 | ** the parent from the same branch the primary parent. |
| 410 | 429 | */ |
| 411 | 430 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 412 | 431 | if( pRow->isDup ) continue; |
| 413 | - if( pRow->nParent<2 ) continue; /* Not a fork */ | |
| 432 | + if( pRow->nNonCherrypick<2 ) continue; /* Not a fork */ | |
| 414 | 433 | pParent = hashFind(p, pRow->aParent[0]); |
| 415 | 434 | if( pParent==0 ) continue; /* Parent off-screen */ |
| 416 | 435 | if( pParent->zBranch==pRow->zBranch ) continue; /* Same branch */ |
| 417 | - for(i=1; i<pRow->nParent; i++){ | |
| 436 | + for(i=1; i<pRow->nNonCherrypick; i++){ | |
| 418 | 437 | pParent = hashFind(p, pRow->aParent[i]); |
| 419 | 438 | if( pParent && pParent->zBranch==pRow->zBranch ){ |
| 420 | 439 | int t = pRow->aParent[0]; |
| 421 | 440 | pRow->aParent[0] = pRow->aParent[i]; |
| 422 | 441 | pRow->aParent[i] = t; |
| @@ -565,18 +584,23 @@ | ||
| 565 | 584 | iMrail = findFreeRail(p, pRow->idx, p->nRow, 0); |
| 566 | 585 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 567 | 586 | mergeRiserFrom[iMrail] = parentRid; |
| 568 | 587 | } |
| 569 | 588 | mask = BIT(iMrail); |
| 570 | - pRow->mergeIn[iMrail] = 1; | |
| 571 | - pRow->mergeDown |= mask; | |
| 589 | + if( i>=pRow->nNonCherrypick ){ | |
| 590 | + pRow->mergeIn[iMrail] = 2; | |
| 591 | + pRow->cherrypickDown |= mask; | |
| 592 | + }else{ | |
| 593 | + pRow->mergeIn[iMrail] = 1; | |
| 594 | + pRow->mergeDown |= mask; | |
| 595 | + } | |
| 572 | 596 | for(pLoop=pRow->pNext; pLoop; pLoop=pLoop->pNext){ |
| 573 | 597 | pLoop->railInUse |= mask; |
| 574 | 598 | } |
| 575 | 599 | }else{ |
| 576 | 600 | /* Merge from an on-screen node */ |
| 577 | - createMergeRiser(p, pDesc, pRow); | |
| 601 | + createMergeRiser(p, pDesc, pRow, i>=pRow->nNonCherrypick); | |
| 578 | 602 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 579 | 603 | } |
| 580 | 604 | } |
| 581 | 605 | } |
| 582 | 606 | |
| @@ -593,11 +617,11 @@ | ||
| 593 | 617 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 594 | 618 | if( !pRow->isDup ) continue; |
| 595 | 619 | pRow->iRail = dupRail; |
| 596 | 620 | pDesc = hashFind(p, pRow->rid); |
| 597 | 621 | assert( pDesc!=0 && pDesc!=pRow ); |
| 598 | - createMergeRiser(p, pDesc, pRow); | |
| 622 | + createMergeRiser(p, pDesc, pRow, 0); | |
| 599 | 623 | if( pDesc->mergeOut>mxRail ) mxRail = pDesc->mergeOut; |
| 600 | 624 | } |
| 601 | 625 | if( dupRail<=mxRail ){ |
| 602 | 626 | dupRail = mxRail+1; |
| 603 | 627 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 604 | 628 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -34,10 +34,12 @@ | |
| 34 | ** but which are included just so that we can capture their background color. |
| 35 | */ |
| 36 | struct GraphRow { |
| 37 | int rid; /* The rid for the check-in */ |
| 38 | i8 nParent; /* Number of parents. -1 for technote lines */ |
| 39 | int *aParent; /* Array of parents. 0 element is primary .*/ |
| 40 | char *zBranch; /* Branch name */ |
| 41 | char *zBgClr; /* Background Color */ |
| 42 | char zUuid[HNAME_MAX+1]; /* Check-in for file ID */ |
| 43 | |
| @@ -55,10 +57,11 @@ | |
| 55 | i8 mergeOut; /* Merge out to this rail. -1 if no merge-out */ |
| 56 | u8 mergeIn[GR_MAX_RAIL]; /* Merge in from non-zero rails */ |
| 57 | int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */ |
| 58 | int mergeUpto; /* Draw the mergeOut rail up to this level */ |
| 59 | u64 mergeDown; /* Draw merge lines up from bottom of graph */ |
| 60 | |
| 61 | u64 railInUse; /* Mask of occupied rails at this row */ |
| 62 | }; |
| 63 | |
| 64 | /* Context while building a graph |
| @@ -179,10 +182,11 @@ | |
| 179 | */ |
| 180 | int graph_add_row( |
| 181 | GraphContext *p, /* The context to which the row is added */ |
| 182 | int rid, /* RID for the check-in */ |
| 183 | int nParent, /* Number of parents */ |
| 184 | int *aParent, /* Array of parents */ |
| 185 | const char *zBranch, /* Branch for this check-in */ |
| 186 | const char *zBgClr, /* Background color. NULL or "" for white. */ |
| 187 | const char *zUuid, /* hash name of the object being graphed */ |
| 188 | int isLeaf /* True if this row is a leaf */ |
| @@ -195,11 +199,16 @@ | |
| 195 | nByte = sizeof(GraphRow); |
| 196 | if( nParent>0 ) nByte += sizeof(pRow->aParent[0])*nParent; |
| 197 | pRow = (GraphRow*)safeMalloc( nByte ); |
| 198 | pRow->aParent = nParent>0 ? (int*)&pRow[1] : 0; |
| 199 | pRow->rid = rid; |
| 200 | pRow->nParent = nParent; |
| 201 | pRow->zBranch = persistBranchName(p, zBranch); |
| 202 | if( zUuid==0 ) zUuid = ""; |
| 203 | sqlite3_snprintf(sizeof(pRow->zUuid), pRow->zUuid, "%s", zUuid); |
| 204 | pRow->isLeaf = isLeaf; |
| 205 | memset(pRow->aiRiser, -1, sizeof(pRow->aiRiser)); |
| @@ -284,11 +293,12 @@ | |
| 284 | ** Create a merge-arrow riser going from pParent up to pChild. |
| 285 | */ |
| 286 | static void createMergeRiser( |
| 287 | GraphContext *p, |
| 288 | GraphRow *pParent, |
| 289 | GraphRow *pChild |
| 290 | ){ |
| 291 | int u; |
| 292 | u64 mask; |
| 293 | GraphRow *pLoop; |
| 294 | |
| @@ -311,11 +321,11 @@ | |
| 311 | pLoop=pLoop->pNext){ |
| 312 | pLoop->railInUse |= mask; |
| 313 | } |
| 314 | } |
| 315 | } |
| 316 | pChild->mergeIn[pParent->mergeOut] = 1; |
| 317 | } |
| 318 | |
| 319 | /* |
| 320 | ** Compute the maximum rail number. |
| 321 | */ |
| @@ -323,11 +333,13 @@ | |
| 323 | GraphRow *pRow; |
| 324 | p->mxRail = 0; |
| 325 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 326 | if( pRow->iRail>p->mxRail ) p->mxRail = pRow->iRail; |
| 327 | if( pRow->mergeOut>p->mxRail ) p->mxRail = pRow->mergeOut; |
| 328 | while( p->mxRail<GR_MAX_RAIL && pRow->mergeDown>(BIT(p->mxRail+1)-1) ){ |
| 329 | p->mxRail++; |
| 330 | } |
| 331 | } |
| 332 | } |
| 333 | |
| @@ -395,11 +407,18 @@ | |
| 395 | */ |
| 396 | if( omitDescenders ){ |
| 397 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 398 | for(i=1; i<pRow->nParent; i++){ |
| 399 | if( hashFind(p, pRow->aParent[i])==0 ){ |
| 400 | pRow->aParent[i] = pRow->aParent[--pRow->nParent]; |
| 401 | i--; |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | } |
| @@ -408,15 +427,15 @@ | |
| 408 | ** other parents in the same branch, reorder the parents to make |
| 409 | ** the parent from the same branch the primary parent. |
| 410 | */ |
| 411 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 412 | if( pRow->isDup ) continue; |
| 413 | if( pRow->nParent<2 ) continue; /* Not a fork */ |
| 414 | pParent = hashFind(p, pRow->aParent[0]); |
| 415 | if( pParent==0 ) continue; /* Parent off-screen */ |
| 416 | if( pParent->zBranch==pRow->zBranch ) continue; /* Same branch */ |
| 417 | for(i=1; i<pRow->nParent; i++){ |
| 418 | pParent = hashFind(p, pRow->aParent[i]); |
| 419 | if( pParent && pParent->zBranch==pRow->zBranch ){ |
| 420 | int t = pRow->aParent[0]; |
| 421 | pRow->aParent[0] = pRow->aParent[i]; |
| 422 | pRow->aParent[i] = t; |
| @@ -565,18 +584,23 @@ | |
| 565 | iMrail = findFreeRail(p, pRow->idx, p->nRow, 0); |
| 566 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 567 | mergeRiserFrom[iMrail] = parentRid; |
| 568 | } |
| 569 | mask = BIT(iMrail); |
| 570 | pRow->mergeIn[iMrail] = 1; |
| 571 | pRow->mergeDown |= mask; |
| 572 | for(pLoop=pRow->pNext; pLoop; pLoop=pLoop->pNext){ |
| 573 | pLoop->railInUse |= mask; |
| 574 | } |
| 575 | }else{ |
| 576 | /* Merge from an on-screen node */ |
| 577 | createMergeRiser(p, pDesc, pRow); |
| 578 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 579 | } |
| 580 | } |
| 581 | } |
| 582 | |
| @@ -593,11 +617,11 @@ | |
| 593 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 594 | if( !pRow->isDup ) continue; |
| 595 | pRow->iRail = dupRail; |
| 596 | pDesc = hashFind(p, pRow->rid); |
| 597 | assert( pDesc!=0 && pDesc!=pRow ); |
| 598 | createMergeRiser(p, pDesc, pRow); |
| 599 | if( pDesc->mergeOut>mxRail ) mxRail = pDesc->mergeOut; |
| 600 | } |
| 601 | if( dupRail<=mxRail ){ |
| 602 | dupRail = mxRail+1; |
| 603 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 604 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -34,10 +34,12 @@ | |
| 34 | ** but which are included just so that we can capture their background color. |
| 35 | */ |
| 36 | struct GraphRow { |
| 37 | int rid; /* The rid for the check-in */ |
| 38 | i8 nParent; /* Number of parents. -1 for technote lines */ |
| 39 | i8 nCherrypick; /* Subset of aParent that are cherrypicks */ |
| 40 | i8 nNonCherrypick; /* Number of non-cherrypick parents */ |
| 41 | int *aParent; /* Array of parents. 0 element is primary .*/ |
| 42 | char *zBranch; /* Branch name */ |
| 43 | char *zBgClr; /* Background Color */ |
| 44 | char zUuid[HNAME_MAX+1]; /* Check-in for file ID */ |
| 45 | |
| @@ -55,10 +57,11 @@ | |
| 57 | i8 mergeOut; /* Merge out to this rail. -1 if no merge-out */ |
| 58 | u8 mergeIn[GR_MAX_RAIL]; /* Merge in from non-zero rails */ |
| 59 | int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */ |
| 60 | int mergeUpto; /* Draw the mergeOut rail up to this level */ |
| 61 | u64 mergeDown; /* Draw merge lines up from bottom of graph */ |
| 62 | u64 cherrypickDown; /* Draw cherrypick lines up from bottom */ |
| 63 | |
| 64 | u64 railInUse; /* Mask of occupied rails at this row */ |
| 65 | }; |
| 66 | |
| 67 | /* Context while building a graph |
| @@ -179,10 +182,11 @@ | |
| 182 | */ |
| 183 | int graph_add_row( |
| 184 | GraphContext *p, /* The context to which the row is added */ |
| 185 | int rid, /* RID for the check-in */ |
| 186 | int nParent, /* Number of parents */ |
| 187 | int nCherrypick, /* How many of aParent[] are actually cherrypicks */ |
| 188 | int *aParent, /* Array of parents */ |
| 189 | const char *zBranch, /* Branch for this check-in */ |
| 190 | const char *zBgClr, /* Background color. NULL or "" for white. */ |
| 191 | const char *zUuid, /* hash name of the object being graphed */ |
| 192 | int isLeaf /* True if this row is a leaf */ |
| @@ -195,11 +199,16 @@ | |
| 199 | nByte = sizeof(GraphRow); |
| 200 | if( nParent>0 ) nByte += sizeof(pRow->aParent[0])*nParent; |
| 201 | pRow = (GraphRow*)safeMalloc( nByte ); |
| 202 | pRow->aParent = nParent>0 ? (int*)&pRow[1] : 0; |
| 203 | pRow->rid = rid; |
| 204 | if( nCherrypick>=nParent ){ |
| 205 | nCherrypick = nParent-1; /* Safety. Should never happen. */ |
| 206 | } |
| 207 | pRow->nParent = nParent; |
| 208 | pRow->nCherrypick = nCherrypick; |
| 209 | pRow->nNonCherrypick = nParent - nCherrypick; |
| 210 | pRow->zBranch = persistBranchName(p, zBranch); |
| 211 | if( zUuid==0 ) zUuid = ""; |
| 212 | sqlite3_snprintf(sizeof(pRow->zUuid), pRow->zUuid, "%s", zUuid); |
| 213 | pRow->isLeaf = isLeaf; |
| 214 | memset(pRow->aiRiser, -1, sizeof(pRow->aiRiser)); |
| @@ -284,11 +293,12 @@ | |
| 293 | ** Create a merge-arrow riser going from pParent up to pChild. |
| 294 | */ |
| 295 | static void createMergeRiser( |
| 296 | GraphContext *p, |
| 297 | GraphRow *pParent, |
| 298 | GraphRow *pChild, |
| 299 | int isCherrypick |
| 300 | ){ |
| 301 | int u; |
| 302 | u64 mask; |
| 303 | GraphRow *pLoop; |
| 304 | |
| @@ -311,11 +321,11 @@ | |
| 321 | pLoop=pLoop->pNext){ |
| 322 | pLoop->railInUse |= mask; |
| 323 | } |
| 324 | } |
| 325 | } |
| 326 | pChild->mergeIn[pParent->mergeOut] = isCherrypick ? 2 : 1; |
| 327 | } |
| 328 | |
| 329 | /* |
| 330 | ** Compute the maximum rail number. |
| 331 | */ |
| @@ -323,11 +333,13 @@ | |
| 333 | GraphRow *pRow; |
| 334 | p->mxRail = 0; |
| 335 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 336 | if( pRow->iRail>p->mxRail ) p->mxRail = pRow->iRail; |
| 337 | if( pRow->mergeOut>p->mxRail ) p->mxRail = pRow->mergeOut; |
| 338 | while( p->mxRail<GR_MAX_RAIL |
| 339 | && (pRow->mergeDown|pRow->cherrypickDown)>(BIT(p->mxRail+1)-1) |
| 340 | ){ |
| 341 | p->mxRail++; |
| 342 | } |
| 343 | } |
| 344 | } |
| 345 | |
| @@ -395,11 +407,18 @@ | |
| 407 | */ |
| 408 | if( omitDescenders ){ |
| 409 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 410 | for(i=1; i<pRow->nParent; i++){ |
| 411 | if( hashFind(p, pRow->aParent[i])==0 ){ |
| 412 | memmove(pRow->aParent+i, pRow->aParent+i+1, |
| 413 | sizeof(pRow->aParent[0])*(pRow->nParent-i-1)); |
| 414 | pRow->nParent--; |
| 415 | if( i<pRow->nNonCherrypick ){ |
| 416 | pRow->nNonCherrypick--; |
| 417 | }else{ |
| 418 | pRow->nCherrypick--; |
| 419 | } |
| 420 | i--; |
| 421 | } |
| 422 | } |
| 423 | } |
| 424 | } |
| @@ -408,15 +427,15 @@ | |
| 427 | ** other parents in the same branch, reorder the parents to make |
| 428 | ** the parent from the same branch the primary parent. |
| 429 | */ |
| 430 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 431 | if( pRow->isDup ) continue; |
| 432 | if( pRow->nNonCherrypick<2 ) continue; /* Not a fork */ |
| 433 | pParent = hashFind(p, pRow->aParent[0]); |
| 434 | if( pParent==0 ) continue; /* Parent off-screen */ |
| 435 | if( pParent->zBranch==pRow->zBranch ) continue; /* Same branch */ |
| 436 | for(i=1; i<pRow->nNonCherrypick; i++){ |
| 437 | pParent = hashFind(p, pRow->aParent[i]); |
| 438 | if( pParent && pParent->zBranch==pRow->zBranch ){ |
| 439 | int t = pRow->aParent[0]; |
| 440 | pRow->aParent[0] = pRow->aParent[i]; |
| 441 | pRow->aParent[i] = t; |
| @@ -565,18 +584,23 @@ | |
| 584 | iMrail = findFreeRail(p, pRow->idx, p->nRow, 0); |
| 585 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 586 | mergeRiserFrom[iMrail] = parentRid; |
| 587 | } |
| 588 | mask = BIT(iMrail); |
| 589 | if( i>=pRow->nNonCherrypick ){ |
| 590 | pRow->mergeIn[iMrail] = 2; |
| 591 | pRow->cherrypickDown |= mask; |
| 592 | }else{ |
| 593 | pRow->mergeIn[iMrail] = 1; |
| 594 | pRow->mergeDown |= mask; |
| 595 | } |
| 596 | for(pLoop=pRow->pNext; pLoop; pLoop=pLoop->pNext){ |
| 597 | pLoop->railInUse |= mask; |
| 598 | } |
| 599 | }else{ |
| 600 | /* Merge from an on-screen node */ |
| 601 | createMergeRiser(p, pDesc, pRow, i>=pRow->nNonCherrypick); |
| 602 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 603 | } |
| 604 | } |
| 605 | } |
| 606 | |
| @@ -593,11 +617,11 @@ | |
| 617 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 618 | if( !pRow->isDup ) continue; |
| 619 | pRow->iRail = dupRail; |
| 620 | pDesc = hashFind(p, pRow->rid); |
| 621 | assert( pDesc!=0 && pDesc!=pRow ); |
| 622 | createMergeRiser(p, pDesc, pRow, 0); |
| 623 | if( pDesc->mergeOut>mxRail ) mxRail = pDesc->mergeOut; |
| 624 | } |
| 625 | if( dupRail<=mxRail ){ |
| 626 | dupRail = mxRail+1; |
| 627 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 628 |
+32
-6
| --- src/graph.js | ||
| +++ src/graph.js | ||
| @@ -83,11 +83,12 @@ | ||
| 83 | 83 | parent.appendChild(canvasDiv); |
| 84 | 84 | |
| 85 | 85 | var elems = {}; |
| 86 | 86 | var elemClasses = [ |
| 87 | 87 | "rail", "mergeoffset", "node", "arrow u", "arrow u sm", "line", |
| 88 | - "arrow merge r", "line merge", "arrow warp", "line warp" | |
| 88 | + "arrow merge r", "line merge", "arrow warp", "line warp", | |
| 89 | + "line cherrypick" | |
| 89 | 90 | ]; |
| 90 | 91 | for( var i=0; i<elemClasses.length; i++ ){ |
| 91 | 92 | var cls = elemClasses[i]; |
| 92 | 93 | var elem = document.createElement("div"); |
| 93 | 94 | elem.className = "tl-" + cls; |
| @@ -103,10 +104,11 @@ | ||
| 103 | 104 | arrow = elems.arrow_u; |
| 104 | 105 | arrowSmall = elems.arrow_u_sm; |
| 105 | 106 | line = elems.line; |
| 106 | 107 | mArrow = elems.arrow_merge_r; |
| 107 | 108 | mLine = elems.line_merge; |
| 109 | + cpLine = elems.line_cherrypick; | |
| 108 | 110 | wArrow = elems.arrow_warp; |
| 109 | 111 | wLine = elems.line_warp; |
| 110 | 112 | |
| 111 | 113 | var minRailPitch = Math.ceil((node.w+line.w)/2 + mArrow.w + 1); |
| 112 | 114 | if( window.innerWidth<400 ){ |
| @@ -186,14 +188,20 @@ | ||
| 186 | 188 | drawLine(line,color,x,y0,null,y1); |
| 187 | 189 | x = to.x + (node.w-arw.w)/2; |
| 188 | 190 | var n = drawBox(arw.cls,null,x,y); |
| 189 | 191 | if(color) n.style.borderBottomColor = color; |
| 190 | 192 | } |
| 193 | + /* Draw thin horizontal or vertical lines representing merges */ | |
| 191 | 194 | function drawMergeLine(x0,y0,x1,y1){ |
| 192 | 195 | drawLine(mLine,null,x0,y0,x1,y1); |
| 193 | 196 | } |
| 194 | - function drawMergeArrow(p,rail){ | |
| 197 | + function drawCherrypickLine(x0,y0,x1,y1){ | |
| 198 | + drawLine(cpLine,null,x0,y0,x1,y1); | |
| 199 | + } | |
| 200 | + /* Draw an arrow representing an in-bound merge from the "rail"-th rail | |
| 201 | + ** over to the node of "p". Make is a checkpoint merge is "isCP" is true */ | |
| 202 | + function drawMergeArrow(p,rail,isCP){ | |
| 195 | 203 | var x0 = rail*railPitch + node.w/2; |
| 196 | 204 | if( rail in mergeLines ){ |
| 197 | 205 | x0 += mergeLines[rail]; |
| 198 | 206 | if( p.r<rail ) x0 += mLine.w; |
| 199 | 207 | }else{ |
| @@ -200,13 +208,19 @@ | ||
| 200 | 208 | x0 += (p.r<rail ? -1 : 1)*line.w/2; |
| 201 | 209 | } |
| 202 | 210 | var x1 = mArrow.w ? mArrow.w/2 : -node.w/2; |
| 203 | 211 | x1 = p.x + (p.r<rail ? node.w + Math.ceil(x1) : -x1); |
| 204 | 212 | var y = miLineY(p); |
| 205 | - drawMergeLine(x0,y,x1,null); | |
| 206 | 213 | var x = p.x + (p.r<rail ? node.w : -mArrow.w); |
| 207 | - var cls = "arrow merge " + (p.r<rail ? "l" : "r"); | |
| 214 | + var cls; | |
| 215 | + if( isCP ){ | |
| 216 | + drawCherrypickLine(x0,y,x1,null); | |
| 217 | + cls = "arrow cherrypick " + (p.r<rail ? "l" : "r"); | |
| 218 | + }else{ | |
| 219 | + drawMergeLine(x0,y,x1,null); | |
| 220 | + cls = "arrow merge " + (p.r<rail ? "l" : "r"); | |
| 221 | + } | |
| 208 | 222 | drawBox(cls,null,x,y+(mLine.w-mArrow.h)/2); |
| 209 | 223 | } |
| 210 | 224 | function drawNode(p, btm){ |
| 211 | 225 | if( p.bg ){ |
| 212 | 226 | var e = document.getElementById("mc"+p.id); |
| @@ -225,11 +239,11 @@ | ||
| 225 | 239 | n.style.zIndex = 10; |
| 226 | 240 | if( !tx.omitDescenders ){ |
| 227 | 241 | if( p.u==0 ) drawUpArrow(p,{x: p.x, y: -node.h},p.fg); |
| 228 | 242 | if( p.hasOwnProperty('d') ) drawUpArrow({x: p.x, y: btm-node.h/2},p,p.fg); |
| 229 | 243 | } |
| 230 | - if( p.mo>=0 ){ | |
| 244 | + if( p.hasOwnProperty('mo') ){ | |
| 231 | 245 | var x0 = p.x + node.w/2; |
| 232 | 246 | var x1 = p.mo*railPitch + node.w/2; |
| 233 | 247 | var u = tx.rowinfo[p.mu-tx.iTopRow]; |
| 234 | 248 | var y1 = miLineY(u); |
| 235 | 249 | if( p.u<0 || p.mo!=p.r ){ |
| @@ -278,11 +292,23 @@ | ||
| 278 | 292 | rail = -rail; |
| 279 | 293 | mergeLines[rail] = -mLine.w/2; |
| 280 | 294 | var x = rail*railPitch + (node.w-mLine.w)/2; |
| 281 | 295 | drawMergeLine(x,miLineY(p),null,btm); |
| 282 | 296 | } |
| 283 | - drawMergeArrow(p,rail); | |
| 297 | + drawMergeArrow(p,rail,0); | |
| 298 | + } | |
| 299 | + } | |
| 300 | + if( p.hasOwnProperty('cpi') ){ | |
| 301 | + for( var i=0; i<p.cpi.length; i++ ){ | |
| 302 | + var rail = p.cpi[i]; | |
| 303 | + if( rail<0 ){ | |
| 304 | + rail = -rail; | |
| 305 | + mergeLines[rail] = -mLine.w/2; | |
| 306 | + var x = rail*railPitch + (node.w-mLine.w)/2; | |
| 307 | + drawMergeLine(x,miLineY(p),null,btm); | |
| 308 | + } | |
| 309 | + drawMergeArrow(p,rail,1); | |
| 284 | 310 | } |
| 285 | 311 | } |
| 286 | 312 | } |
| 287 | 313 | var mergeLines; |
| 288 | 314 | function renderGraph(){ |
| 289 | 315 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -83,11 +83,12 @@ | |
| 83 | parent.appendChild(canvasDiv); |
| 84 | |
| 85 | var elems = {}; |
| 86 | var elemClasses = [ |
| 87 | "rail", "mergeoffset", "node", "arrow u", "arrow u sm", "line", |
| 88 | "arrow merge r", "line merge", "arrow warp", "line warp" |
| 89 | ]; |
| 90 | for( var i=0; i<elemClasses.length; i++ ){ |
| 91 | var cls = elemClasses[i]; |
| 92 | var elem = document.createElement("div"); |
| 93 | elem.className = "tl-" + cls; |
| @@ -103,10 +104,11 @@ | |
| 103 | arrow = elems.arrow_u; |
| 104 | arrowSmall = elems.arrow_u_sm; |
| 105 | line = elems.line; |
| 106 | mArrow = elems.arrow_merge_r; |
| 107 | mLine = elems.line_merge; |
| 108 | wArrow = elems.arrow_warp; |
| 109 | wLine = elems.line_warp; |
| 110 | |
| 111 | var minRailPitch = Math.ceil((node.w+line.w)/2 + mArrow.w + 1); |
| 112 | if( window.innerWidth<400 ){ |
| @@ -186,14 +188,20 @@ | |
| 186 | drawLine(line,color,x,y0,null,y1); |
| 187 | x = to.x + (node.w-arw.w)/2; |
| 188 | var n = drawBox(arw.cls,null,x,y); |
| 189 | if(color) n.style.borderBottomColor = color; |
| 190 | } |
| 191 | function drawMergeLine(x0,y0,x1,y1){ |
| 192 | drawLine(mLine,null,x0,y0,x1,y1); |
| 193 | } |
| 194 | function drawMergeArrow(p,rail){ |
| 195 | var x0 = rail*railPitch + node.w/2; |
| 196 | if( rail in mergeLines ){ |
| 197 | x0 += mergeLines[rail]; |
| 198 | if( p.r<rail ) x0 += mLine.w; |
| 199 | }else{ |
| @@ -200,13 +208,19 @@ | |
| 200 | x0 += (p.r<rail ? -1 : 1)*line.w/2; |
| 201 | } |
| 202 | var x1 = mArrow.w ? mArrow.w/2 : -node.w/2; |
| 203 | x1 = p.x + (p.r<rail ? node.w + Math.ceil(x1) : -x1); |
| 204 | var y = miLineY(p); |
| 205 | drawMergeLine(x0,y,x1,null); |
| 206 | var x = p.x + (p.r<rail ? node.w : -mArrow.w); |
| 207 | var cls = "arrow merge " + (p.r<rail ? "l" : "r"); |
| 208 | drawBox(cls,null,x,y+(mLine.w-mArrow.h)/2); |
| 209 | } |
| 210 | function drawNode(p, btm){ |
| 211 | if( p.bg ){ |
| 212 | var e = document.getElementById("mc"+p.id); |
| @@ -225,11 +239,11 @@ | |
| 225 | n.style.zIndex = 10; |
| 226 | if( !tx.omitDescenders ){ |
| 227 | if( p.u==0 ) drawUpArrow(p,{x: p.x, y: -node.h},p.fg); |
| 228 | if( p.hasOwnProperty('d') ) drawUpArrow({x: p.x, y: btm-node.h/2},p,p.fg); |
| 229 | } |
| 230 | if( p.mo>=0 ){ |
| 231 | var x0 = p.x + node.w/2; |
| 232 | var x1 = p.mo*railPitch + node.w/2; |
| 233 | var u = tx.rowinfo[p.mu-tx.iTopRow]; |
| 234 | var y1 = miLineY(u); |
| 235 | if( p.u<0 || p.mo!=p.r ){ |
| @@ -278,11 +292,23 @@ | |
| 278 | rail = -rail; |
| 279 | mergeLines[rail] = -mLine.w/2; |
| 280 | var x = rail*railPitch + (node.w-mLine.w)/2; |
| 281 | drawMergeLine(x,miLineY(p),null,btm); |
| 282 | } |
| 283 | drawMergeArrow(p,rail); |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | var mergeLines; |
| 288 | function renderGraph(){ |
| 289 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -83,11 +83,12 @@ | |
| 83 | parent.appendChild(canvasDiv); |
| 84 | |
| 85 | var elems = {}; |
| 86 | var elemClasses = [ |
| 87 | "rail", "mergeoffset", "node", "arrow u", "arrow u sm", "line", |
| 88 | "arrow merge r", "line merge", "arrow warp", "line warp", |
| 89 | "line cherrypick" |
| 90 | ]; |
| 91 | for( var i=0; i<elemClasses.length; i++ ){ |
| 92 | var cls = elemClasses[i]; |
| 93 | var elem = document.createElement("div"); |
| 94 | elem.className = "tl-" + cls; |
| @@ -103,10 +104,11 @@ | |
| 104 | arrow = elems.arrow_u; |
| 105 | arrowSmall = elems.arrow_u_sm; |
| 106 | line = elems.line; |
| 107 | mArrow = elems.arrow_merge_r; |
| 108 | mLine = elems.line_merge; |
| 109 | cpLine = elems.line_cherrypick; |
| 110 | wArrow = elems.arrow_warp; |
| 111 | wLine = elems.line_warp; |
| 112 | |
| 113 | var minRailPitch = Math.ceil((node.w+line.w)/2 + mArrow.w + 1); |
| 114 | if( window.innerWidth<400 ){ |
| @@ -186,14 +188,20 @@ | |
| 188 | drawLine(line,color,x,y0,null,y1); |
| 189 | x = to.x + (node.w-arw.w)/2; |
| 190 | var n = drawBox(arw.cls,null,x,y); |
| 191 | if(color) n.style.borderBottomColor = color; |
| 192 | } |
| 193 | /* Draw thin horizontal or vertical lines representing merges */ |
| 194 | function drawMergeLine(x0,y0,x1,y1){ |
| 195 | drawLine(mLine,null,x0,y0,x1,y1); |
| 196 | } |
| 197 | function drawCherrypickLine(x0,y0,x1,y1){ |
| 198 | drawLine(cpLine,null,x0,y0,x1,y1); |
| 199 | } |
| 200 | /* Draw an arrow representing an in-bound merge from the "rail"-th rail |
| 201 | ** over to the node of "p". Make is a checkpoint merge is "isCP" is true */ |
| 202 | function drawMergeArrow(p,rail,isCP){ |
| 203 | var x0 = rail*railPitch + node.w/2; |
| 204 | if( rail in mergeLines ){ |
| 205 | x0 += mergeLines[rail]; |
| 206 | if( p.r<rail ) x0 += mLine.w; |
| 207 | }else{ |
| @@ -200,13 +208,19 @@ | |
| 208 | x0 += (p.r<rail ? -1 : 1)*line.w/2; |
| 209 | } |
| 210 | var x1 = mArrow.w ? mArrow.w/2 : -node.w/2; |
| 211 | x1 = p.x + (p.r<rail ? node.w + Math.ceil(x1) : -x1); |
| 212 | var y = miLineY(p); |
| 213 | var x = p.x + (p.r<rail ? node.w : -mArrow.w); |
| 214 | var cls; |
| 215 | if( isCP ){ |
| 216 | drawCherrypickLine(x0,y,x1,null); |
| 217 | cls = "arrow cherrypick " + (p.r<rail ? "l" : "r"); |
| 218 | }else{ |
| 219 | drawMergeLine(x0,y,x1,null); |
| 220 | cls = "arrow merge " + (p.r<rail ? "l" : "r"); |
| 221 | } |
| 222 | drawBox(cls,null,x,y+(mLine.w-mArrow.h)/2); |
| 223 | } |
| 224 | function drawNode(p, btm){ |
| 225 | if( p.bg ){ |
| 226 | var e = document.getElementById("mc"+p.id); |
| @@ -225,11 +239,11 @@ | |
| 239 | n.style.zIndex = 10; |
| 240 | if( !tx.omitDescenders ){ |
| 241 | if( p.u==0 ) drawUpArrow(p,{x: p.x, y: -node.h},p.fg); |
| 242 | if( p.hasOwnProperty('d') ) drawUpArrow({x: p.x, y: btm-node.h/2},p,p.fg); |
| 243 | } |
| 244 | if( p.hasOwnProperty('mo') ){ |
| 245 | var x0 = p.x + node.w/2; |
| 246 | var x1 = p.mo*railPitch + node.w/2; |
| 247 | var u = tx.rowinfo[p.mu-tx.iTopRow]; |
| 248 | var y1 = miLineY(u); |
| 249 | if( p.u<0 || p.mo!=p.r ){ |
| @@ -278,11 +292,23 @@ | |
| 292 | rail = -rail; |
| 293 | mergeLines[rail] = -mLine.w/2; |
| 294 | var x = rail*railPitch + (node.w-mLine.w)/2; |
| 295 | drawMergeLine(x,miLineY(p),null,btm); |
| 296 | } |
| 297 | drawMergeArrow(p,rail,0); |
| 298 | } |
| 299 | } |
| 300 | if( p.hasOwnProperty('cpi') ){ |
| 301 | for( var i=0; i<p.cpi.length; i++ ){ |
| 302 | var rail = p.cpi[i]; |
| 303 | if( rail<0 ){ |
| 304 | rail = -rail; |
| 305 | mergeLines[rail] = -mLine.w/2; |
| 306 | var x = rail*railPitch + (node.w-mLine.w)/2; |
| 307 | drawMergeLine(x,miLineY(p),null,btm); |
| 308 | } |
| 309 | drawMergeArrow(p,rail,1); |
| 310 | } |
| 311 | } |
| 312 | } |
| 313 | var mergeLines; |
| 314 | function renderGraph(){ |
| 315 |
+44
-8
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -429,10 +429,11 @@ | ||
| 429 | 429 | } |
| 430 | 430 | } |
| 431 | 431 | } |
| 432 | 432 | if( zType[0]=='c' && pGraph ){ |
| 433 | 433 | int nParent = 0; |
| 434 | + int nCherrypick = 0; | |
| 434 | 435 | int aParent[GR_MAX_RAIL]; |
| 435 | 436 | static Stmt qparent; |
| 436 | 437 | db_static_prepare(&qparent, |
| 437 | 438 | "SELECT pid FROM plink" |
| 438 | 439 | " WHERE cid=:rid AND pid NOT IN phantom" |
| @@ -450,22 +451,23 @@ | ||
| 450 | 451 | " WHERE childid=:rid AND parentid NOT IN phantom" |
| 451 | 452 | ); |
| 452 | 453 | db_bind_int(&qcherrypick, ":rid", rid); |
| 453 | 454 | while( db_step(&qcherrypick)==SQLITE_ROW && nParent<count(aParent) ){ |
| 454 | 455 | aParent[nParent++] = db_column_int(&qcherrypick, 0); |
| 456 | + nCherrypick++; | |
| 455 | 457 | } |
| 456 | 458 | db_reset(&qcherrypick); |
| 457 | 459 | } |
| 458 | - gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, | |
| 459 | - zUuid, isLeaf); | |
| 460 | + gidx = graph_add_row(pGraph, rid, nParent, nCherrypick, aParent, | |
| 461 | + zBr, zBgClr, zUuid, isLeaf); | |
| 460 | 462 | db_reset(&qbranch); |
| 461 | 463 | @ <div id="m%d(gidx)" class="tl-nodemark"></div> |
| 462 | 464 | }else if( zType[0]=='e' && pGraph && zBgClr && zBgClr[0] ){ |
| 463 | 465 | /* For technotes, make a graph node with nParent==(-1). This will |
| 464 | 466 | ** not actually draw anything on the graph, but it will set the |
| 465 | 467 | ** background color of the timeline entry */ |
| 466 | - gidx = graph_add_row(pGraph, rid, -1, 0, zBr, zBgClr, zUuid, 0); | |
| 468 | + gidx = graph_add_row(pGraph, rid, -1, 0, 0, zBr, zBgClr, zUuid, 0); | |
| 467 | 469 | @ <div id="m%d(gidx)" class="tl-nodemark"></div> |
| 468 | 470 | } |
| 469 | 471 | @</td> |
| 470 | 472 | if( !isSelectedOrCurrent ){ |
| 471 | 473 | @ <td class="timeline%s(zStyle)Cell" id='mc%d(gidx)'> |
| @@ -884,10 +886,12 @@ | ||
| 884 | 886 | ** merge arrows should be drawn into this node. If the value is |
| 885 | 887 | ** negative, then the rail position is the absolute value of mi[] |
| 886 | 888 | ** and a thin merge-arrow descender is drawn to the bottom of |
| 887 | 889 | ** the screen. This array is omitted if there are no inbound |
| 888 | 890 | ** merges. |
| 891 | + ** cpi: "cherrypick-in". Like "mi" except for cherrypick merges. | |
| 892 | + ** omitted if there are no cherrypick merges. | |
| 889 | 893 | ** h: The artifact hash of the object being graphed |
| 890 | 894 | */ |
| 891 | 895 | for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){ |
| 892 | 896 | int k = 0; |
| 893 | 897 | cgi_printf("{\"id\":%d,", pRow->idx); |
| @@ -920,17 +924,32 @@ | ||
| 920 | 924 | if( colorGraph && pRow->zBgClr[0]=='#' ){ |
| 921 | 925 | cgi_printf("\"fg\":\"%s\",", bg_to_fg(pRow->zBgClr)); |
| 922 | 926 | } |
| 923 | 927 | /* mi */ |
| 924 | 928 | for(i=k=0; i<GR_MAX_RAIL; i++){ |
| 925 | - if( pRow->mergeIn[i] ){ | |
| 929 | + if( pRow->mergeIn[i]==1 ){ | |
| 926 | 930 | int mi = i; |
| 927 | 931 | if( (pRow->mergeDown >> i) & 1 ) mi = -mi; |
| 928 | 932 | if( k==0 ){ |
| 929 | 933 | cgi_printf("\"mi\":"); |
| 930 | 934 | cSep = '['; |
| 931 | 935 | } |
| 936 | + k++; | |
| 937 | + cgi_printf("%c%d", cSep, mi); | |
| 938 | + cSep = ','; | |
| 939 | + } | |
| 940 | + } | |
| 941 | + if( k ) cgi_printf("],"); | |
| 942 | + /* cpi */ | |
| 943 | + for(i=k=0; i<GR_MAX_RAIL; i++){ | |
| 944 | + if( pRow->mergeIn[i]==2 ){ | |
| 945 | + int mi = i; | |
| 946 | + if( (pRow->cherrypickDown >> i) & 1 ) mi = -mi; | |
| 947 | + if( k==0 ){ | |
| 948 | + cgi_printf("\"cpi\":"); | |
| 949 | + cSep = '['; | |
| 950 | + } | |
| 932 | 951 | k++; |
| 933 | 952 | cgi_printf("%c%d", cSep, mi); |
| 934 | 953 | cSep = ','; |
| 935 | 954 | } |
| 936 | 955 | } |
| @@ -1401,10 +1420,11 @@ | ||
| 1401 | 1420 | ** u=USER Only show items associated with USER |
| 1402 | 1421 | ** y=TYPE 'ci', 'w', 't', 'e', 'f', or 'all'. |
| 1403 | 1422 | ** ss=VIEWSTYLE c: "Compact" v: "Verbose" m: "Modern" j: "Columnar" |
| 1404 | 1423 | ** advm Use the "Advanced" or "Busy" menu design. |
| 1405 | 1424 | ** ng No Graph. |
| 1425 | +** ncp Omit cherrypick merges | |
| 1406 | 1426 | ** nd Do not highlight the focus check-in |
| 1407 | 1427 | ** v Show details of files changed |
| 1408 | 1428 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1409 | 1429 | ** from=CHECKIN Path from... |
| 1410 | 1430 | ** to=CHECKIN ... to this |
| @@ -1585,16 +1605,19 @@ | ||
| 1585 | 1605 | ){ |
| 1586 | 1606 | nEntry = -1; |
| 1587 | 1607 | zCirca = 0; |
| 1588 | 1608 | } |
| 1589 | 1609 | if( zType[0]=='a' ){ |
| 1590 | - tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH; | |
| 1610 | + tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH | TIMELINE_CHPICK; | |
| 1591 | 1611 | }else{ |
| 1592 | - tmFlags |= TIMELINE_GRAPH; | |
| 1612 | + tmFlags |= TIMELINE_GRAPH | TIMELINE_CHPICK; | |
| 1613 | + } | |
| 1614 | + if( PB("ncp") ){ | |
| 1615 | + tmFlags &= ~TIMELINE_CHPICK; | |
| 1593 | 1616 | } |
| 1594 | 1617 | if( PB("ng") || zSearch!=0 ){ |
| 1595 | - tmFlags &= ~TIMELINE_GRAPH; | |
| 1618 | + tmFlags &= ~(TIMELINE_GRAPH|TIMELINE_CHPICK); | |
| 1596 | 1619 | } |
| 1597 | 1620 | if( PB("brbg") ){ |
| 1598 | 1621 | tmFlags |= TIMELINE_BRCOLOR; |
| 1599 | 1622 | } |
| 1600 | 1623 | if( PB("unhide") ){ |
| @@ -1856,11 +1879,11 @@ | ||
| 1856 | 1879 | " WHERE %s AND tagtype>0 AND rid=blob.rid)\n", zTagSql/*safe-for-%s*/); |
| 1857 | 1880 | |
| 1858 | 1881 | if( related ){ |
| 1859 | 1882 | /* The next two blob_appendf() calls add SQL that causes check-ins that |
| 1860 | 1883 | ** are not part of the branch which are parents or children of the |
| 1861 | - ** branch to be included in the report. This related check-ins are | |
| 1884 | + ** branch to be included in the report. These related check-ins are | |
| 1862 | 1885 | ** useful in helping to visualize what has happened on a quiescent |
| 1863 | 1886 | ** branch that is infrequently merged with a much more activate branch. |
| 1864 | 1887 | */ |
| 1865 | 1888 | blob_append_sql(&cond, |
| 1866 | 1889 | " OR EXISTS(SELECT 1 FROM plink CROSS JOIN tagxref ON rid=cid" |
| @@ -1885,10 +1908,23 @@ | ||
| 1885 | 1908 | " AND NOT EXISTS(SELECT 1 FROM plink JOIN tagxref ON rid=pid" |
| 1886 | 1909 | " WHERE tagid=%d AND tagtype>0 AND cid=blob.rid)\n", |
| 1887 | 1910 | TAG_HIDDEN |
| 1888 | 1911 | ); |
| 1889 | 1912 | } |
| 1913 | + } | |
| 1914 | + if( !PB("ncp") && db_table_exists("repository","cherrypick") ){ | |
| 1915 | + tmFlags |= TIMELINE_CHPICK; | |
| 1916 | + blob_append_sql(&cond, | |
| 1917 | + " OR EXISTS(SELECT 1 FROM cherrypick CROSS JOIN tagxref" | |
| 1918 | + " ON rid=childid NATURAL JOIN tag WHERE %s AND tagtype>0" | |
| 1919 | + " AND parentid=blob.rid)\n", zTagSql/*safe-for-%s*/ | |
| 1920 | + ); | |
| 1921 | + blob_append_sql(&cond, | |
| 1922 | + " OR EXISTS(SELECT 1 FROM cherrypick CROSS JOIN tagxref" | |
| 1923 | + " ON rid=parentid NATURAL JOIN tag WHERE %s AND tagtype>0" | |
| 1924 | + " AND childid=blob.rid)\n", zTagSql/*safe-for-%s*/ | |
| 1925 | + ); | |
| 1890 | 1926 | } |
| 1891 | 1927 | } |
| 1892 | 1928 | blob_append_sql(&cond, ")"); |
| 1893 | 1929 | } |
| 1894 | 1930 | if( (zType[0]=='w' && !g.perm.RdWiki) |
| 1895 | 1931 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -429,10 +429,11 @@ | |
| 429 | } |
| 430 | } |
| 431 | } |
| 432 | if( zType[0]=='c' && pGraph ){ |
| 433 | int nParent = 0; |
| 434 | int aParent[GR_MAX_RAIL]; |
| 435 | static Stmt qparent; |
| 436 | db_static_prepare(&qparent, |
| 437 | "SELECT pid FROM plink" |
| 438 | " WHERE cid=:rid AND pid NOT IN phantom" |
| @@ -450,22 +451,23 @@ | |
| 450 | " WHERE childid=:rid AND parentid NOT IN phantom" |
| 451 | ); |
| 452 | db_bind_int(&qcherrypick, ":rid", rid); |
| 453 | while( db_step(&qcherrypick)==SQLITE_ROW && nParent<count(aParent) ){ |
| 454 | aParent[nParent++] = db_column_int(&qcherrypick, 0); |
| 455 | } |
| 456 | db_reset(&qcherrypick); |
| 457 | } |
| 458 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, |
| 459 | zUuid, isLeaf); |
| 460 | db_reset(&qbranch); |
| 461 | @ <div id="m%d(gidx)" class="tl-nodemark"></div> |
| 462 | }else if( zType[0]=='e' && pGraph && zBgClr && zBgClr[0] ){ |
| 463 | /* For technotes, make a graph node with nParent==(-1). This will |
| 464 | ** not actually draw anything on the graph, but it will set the |
| 465 | ** background color of the timeline entry */ |
| 466 | gidx = graph_add_row(pGraph, rid, -1, 0, zBr, zBgClr, zUuid, 0); |
| 467 | @ <div id="m%d(gidx)" class="tl-nodemark"></div> |
| 468 | } |
| 469 | @</td> |
| 470 | if( !isSelectedOrCurrent ){ |
| 471 | @ <td class="timeline%s(zStyle)Cell" id='mc%d(gidx)'> |
| @@ -884,10 +886,12 @@ | |
| 884 | ** merge arrows should be drawn into this node. If the value is |
| 885 | ** negative, then the rail position is the absolute value of mi[] |
| 886 | ** and a thin merge-arrow descender is drawn to the bottom of |
| 887 | ** the screen. This array is omitted if there are no inbound |
| 888 | ** merges. |
| 889 | ** h: The artifact hash of the object being graphed |
| 890 | */ |
| 891 | for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){ |
| 892 | int k = 0; |
| 893 | cgi_printf("{\"id\":%d,", pRow->idx); |
| @@ -920,17 +924,32 @@ | |
| 920 | if( colorGraph && pRow->zBgClr[0]=='#' ){ |
| 921 | cgi_printf("\"fg\":\"%s\",", bg_to_fg(pRow->zBgClr)); |
| 922 | } |
| 923 | /* mi */ |
| 924 | for(i=k=0; i<GR_MAX_RAIL; i++){ |
| 925 | if( pRow->mergeIn[i] ){ |
| 926 | int mi = i; |
| 927 | if( (pRow->mergeDown >> i) & 1 ) mi = -mi; |
| 928 | if( k==0 ){ |
| 929 | cgi_printf("\"mi\":"); |
| 930 | cSep = '['; |
| 931 | } |
| 932 | k++; |
| 933 | cgi_printf("%c%d", cSep, mi); |
| 934 | cSep = ','; |
| 935 | } |
| 936 | } |
| @@ -1401,10 +1420,11 @@ | |
| 1401 | ** u=USER Only show items associated with USER |
| 1402 | ** y=TYPE 'ci', 'w', 't', 'e', 'f', or 'all'. |
| 1403 | ** ss=VIEWSTYLE c: "Compact" v: "Verbose" m: "Modern" j: "Columnar" |
| 1404 | ** advm Use the "Advanced" or "Busy" menu design. |
| 1405 | ** ng No Graph. |
| 1406 | ** nd Do not highlight the focus check-in |
| 1407 | ** v Show details of files changed |
| 1408 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1409 | ** from=CHECKIN Path from... |
| 1410 | ** to=CHECKIN ... to this |
| @@ -1585,16 +1605,19 @@ | |
| 1585 | ){ |
| 1586 | nEntry = -1; |
| 1587 | zCirca = 0; |
| 1588 | } |
| 1589 | if( zType[0]=='a' ){ |
| 1590 | tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH; |
| 1591 | }else{ |
| 1592 | tmFlags |= TIMELINE_GRAPH; |
| 1593 | } |
| 1594 | if( PB("ng") || zSearch!=0 ){ |
| 1595 | tmFlags &= ~TIMELINE_GRAPH; |
| 1596 | } |
| 1597 | if( PB("brbg") ){ |
| 1598 | tmFlags |= TIMELINE_BRCOLOR; |
| 1599 | } |
| 1600 | if( PB("unhide") ){ |
| @@ -1856,11 +1879,11 @@ | |
| 1856 | " WHERE %s AND tagtype>0 AND rid=blob.rid)\n", zTagSql/*safe-for-%s*/); |
| 1857 | |
| 1858 | if( related ){ |
| 1859 | /* The next two blob_appendf() calls add SQL that causes check-ins that |
| 1860 | ** are not part of the branch which are parents or children of the |
| 1861 | ** branch to be included in the report. This related check-ins are |
| 1862 | ** useful in helping to visualize what has happened on a quiescent |
| 1863 | ** branch that is infrequently merged with a much more activate branch. |
| 1864 | */ |
| 1865 | blob_append_sql(&cond, |
| 1866 | " OR EXISTS(SELECT 1 FROM plink CROSS JOIN tagxref ON rid=cid" |
| @@ -1885,10 +1908,23 @@ | |
| 1885 | " AND NOT EXISTS(SELECT 1 FROM plink JOIN tagxref ON rid=pid" |
| 1886 | " WHERE tagid=%d AND tagtype>0 AND cid=blob.rid)\n", |
| 1887 | TAG_HIDDEN |
| 1888 | ); |
| 1889 | } |
| 1890 | } |
| 1891 | } |
| 1892 | blob_append_sql(&cond, ")"); |
| 1893 | } |
| 1894 | if( (zType[0]=='w' && !g.perm.RdWiki) |
| 1895 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -429,10 +429,11 @@ | |
| 429 | } |
| 430 | } |
| 431 | } |
| 432 | if( zType[0]=='c' && pGraph ){ |
| 433 | int nParent = 0; |
| 434 | int nCherrypick = 0; |
| 435 | int aParent[GR_MAX_RAIL]; |
| 436 | static Stmt qparent; |
| 437 | db_static_prepare(&qparent, |
| 438 | "SELECT pid FROM plink" |
| 439 | " WHERE cid=:rid AND pid NOT IN phantom" |
| @@ -450,22 +451,23 @@ | |
| 451 | " WHERE childid=:rid AND parentid NOT IN phantom" |
| 452 | ); |
| 453 | db_bind_int(&qcherrypick, ":rid", rid); |
| 454 | while( db_step(&qcherrypick)==SQLITE_ROW && nParent<count(aParent) ){ |
| 455 | aParent[nParent++] = db_column_int(&qcherrypick, 0); |
| 456 | nCherrypick++; |
| 457 | } |
| 458 | db_reset(&qcherrypick); |
| 459 | } |
| 460 | gidx = graph_add_row(pGraph, rid, nParent, nCherrypick, aParent, |
| 461 | zBr, zBgClr, zUuid, isLeaf); |
| 462 | db_reset(&qbranch); |
| 463 | @ <div id="m%d(gidx)" class="tl-nodemark"></div> |
| 464 | }else if( zType[0]=='e' && pGraph && zBgClr && zBgClr[0] ){ |
| 465 | /* For technotes, make a graph node with nParent==(-1). This will |
| 466 | ** not actually draw anything on the graph, but it will set the |
| 467 | ** background color of the timeline entry */ |
| 468 | gidx = graph_add_row(pGraph, rid, -1, 0, 0, zBr, zBgClr, zUuid, 0); |
| 469 | @ <div id="m%d(gidx)" class="tl-nodemark"></div> |
| 470 | } |
| 471 | @</td> |
| 472 | if( !isSelectedOrCurrent ){ |
| 473 | @ <td class="timeline%s(zStyle)Cell" id='mc%d(gidx)'> |
| @@ -884,10 +886,12 @@ | |
| 886 | ** merge arrows should be drawn into this node. If the value is |
| 887 | ** negative, then the rail position is the absolute value of mi[] |
| 888 | ** and a thin merge-arrow descender is drawn to the bottom of |
| 889 | ** the screen. This array is omitted if there are no inbound |
| 890 | ** merges. |
| 891 | ** cpi: "cherrypick-in". Like "mi" except for cherrypick merges. |
| 892 | ** omitted if there are no cherrypick merges. |
| 893 | ** h: The artifact hash of the object being graphed |
| 894 | */ |
| 895 | for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){ |
| 896 | int k = 0; |
| 897 | cgi_printf("{\"id\":%d,", pRow->idx); |
| @@ -920,17 +924,32 @@ | |
| 924 | if( colorGraph && pRow->zBgClr[0]=='#' ){ |
| 925 | cgi_printf("\"fg\":\"%s\",", bg_to_fg(pRow->zBgClr)); |
| 926 | } |
| 927 | /* mi */ |
| 928 | for(i=k=0; i<GR_MAX_RAIL; i++){ |
| 929 | if( pRow->mergeIn[i]==1 ){ |
| 930 | int mi = i; |
| 931 | if( (pRow->mergeDown >> i) & 1 ) mi = -mi; |
| 932 | if( k==0 ){ |
| 933 | cgi_printf("\"mi\":"); |
| 934 | cSep = '['; |
| 935 | } |
| 936 | k++; |
| 937 | cgi_printf("%c%d", cSep, mi); |
| 938 | cSep = ','; |
| 939 | } |
| 940 | } |
| 941 | if( k ) cgi_printf("],"); |
| 942 | /* cpi */ |
| 943 | for(i=k=0; i<GR_MAX_RAIL; i++){ |
| 944 | if( pRow->mergeIn[i]==2 ){ |
| 945 | int mi = i; |
| 946 | if( (pRow->cherrypickDown >> i) & 1 ) mi = -mi; |
| 947 | if( k==0 ){ |
| 948 | cgi_printf("\"cpi\":"); |
| 949 | cSep = '['; |
| 950 | } |
| 951 | k++; |
| 952 | cgi_printf("%c%d", cSep, mi); |
| 953 | cSep = ','; |
| 954 | } |
| 955 | } |
| @@ -1401,10 +1420,11 @@ | |
| 1420 | ** u=USER Only show items associated with USER |
| 1421 | ** y=TYPE 'ci', 'w', 't', 'e', 'f', or 'all'. |
| 1422 | ** ss=VIEWSTYLE c: "Compact" v: "Verbose" m: "Modern" j: "Columnar" |
| 1423 | ** advm Use the "Advanced" or "Busy" menu design. |
| 1424 | ** ng No Graph. |
| 1425 | ** ncp Omit cherrypick merges |
| 1426 | ** nd Do not highlight the focus check-in |
| 1427 | ** v Show details of files changed |
| 1428 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1429 | ** from=CHECKIN Path from... |
| 1430 | ** to=CHECKIN ... to this |
| @@ -1585,16 +1605,19 @@ | |
| 1605 | ){ |
| 1606 | nEntry = -1; |
| 1607 | zCirca = 0; |
| 1608 | } |
| 1609 | if( zType[0]=='a' ){ |
| 1610 | tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH | TIMELINE_CHPICK; |
| 1611 | }else{ |
| 1612 | tmFlags |= TIMELINE_GRAPH | TIMELINE_CHPICK; |
| 1613 | } |
| 1614 | if( PB("ncp") ){ |
| 1615 | tmFlags &= ~TIMELINE_CHPICK; |
| 1616 | } |
| 1617 | if( PB("ng") || zSearch!=0 ){ |
| 1618 | tmFlags &= ~(TIMELINE_GRAPH|TIMELINE_CHPICK); |
| 1619 | } |
| 1620 | if( PB("brbg") ){ |
| 1621 | tmFlags |= TIMELINE_BRCOLOR; |
| 1622 | } |
| 1623 | if( PB("unhide") ){ |
| @@ -1856,11 +1879,11 @@ | |
| 1879 | " WHERE %s AND tagtype>0 AND rid=blob.rid)\n", zTagSql/*safe-for-%s*/); |
| 1880 | |
| 1881 | if( related ){ |
| 1882 | /* The next two blob_appendf() calls add SQL that causes check-ins that |
| 1883 | ** are not part of the branch which are parents or children of the |
| 1884 | ** branch to be included in the report. These related check-ins are |
| 1885 | ** useful in helping to visualize what has happened on a quiescent |
| 1886 | ** branch that is infrequently merged with a much more activate branch. |
| 1887 | */ |
| 1888 | blob_append_sql(&cond, |
| 1889 | " OR EXISTS(SELECT 1 FROM plink CROSS JOIN tagxref ON rid=cid" |
| @@ -1885,10 +1908,23 @@ | |
| 1908 | " AND NOT EXISTS(SELECT 1 FROM plink JOIN tagxref ON rid=pid" |
| 1909 | " WHERE tagid=%d AND tagtype>0 AND cid=blob.rid)\n", |
| 1910 | TAG_HIDDEN |
| 1911 | ); |
| 1912 | } |
| 1913 | } |
| 1914 | if( !PB("ncp") && db_table_exists("repository","cherrypick") ){ |
| 1915 | tmFlags |= TIMELINE_CHPICK; |
| 1916 | blob_append_sql(&cond, |
| 1917 | " OR EXISTS(SELECT 1 FROM cherrypick CROSS JOIN tagxref" |
| 1918 | " ON rid=childid NATURAL JOIN tag WHERE %s AND tagtype>0" |
| 1919 | " AND parentid=blob.rid)\n", zTagSql/*safe-for-%s*/ |
| 1920 | ); |
| 1921 | blob_append_sql(&cond, |
| 1922 | " OR EXISTS(SELECT 1 FROM cherrypick CROSS JOIN tagxref" |
| 1923 | " ON rid=parentid NATURAL JOIN tag WHERE %s AND tagtype>0" |
| 1924 | " AND childid=blob.rid)\n", zTagSql/*safe-for-%s*/ |
| 1925 | ); |
| 1926 | } |
| 1927 | } |
| 1928 | blob_append_sql(&cond, ")"); |
| 1929 | } |
| 1930 | if( (zType[0]=='w' && !g.perm.RdWiki) |
| 1931 |