Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch graph-improvements Excluding Merge-Ins
This is equivalent to a diff from 5e9c1d5e04 to e0186fdb5e
|
2019-05-17
| ||
| 19:49 | Improvements to the timeline graph layout: (1) Use a dotted vertical line to indicate a gab of one or more check-ins in a branch. (2) Do not necessarily draw branch lines all the way to the top or bottom of the page. Leave space for the rail to be reused by other branches. check-in: d14590dbff user: drh tags: trunk | |
| 19:30 | In the graph layout, make sure that the idxTop value is properly relayed across gaps. Closed-Leaf check-in: e0186fdb5e user: drh tags: graph-improvements | |
| 14:04 | Fix a warning (a real one) on win32: Win32 printf doesn't know about "%lld". check-in: f6524ae5cc user: jan.nijtmans tags: trunk | |
| 13:54 | Merge the %j string formatter enhancement from trunk. check-in: 78d812e24d user: drh tags: graph-improvements | |
| 13:53 | Add the %j formatting directive to the customized printf() inside of Fossil. The %j format generates a string with appropriate backslash escapes so that the string can be part of a Javascript string literal. check-in: 5e9c1d5e04 user: drh tags: trunk | |
| 12:04 | Fix the openssl-1.1.1b build procedures. check-in: 003281772c user: drh tags: trunk | |
Changes to src/default_css.txt.
| ︙ | |||
187 188 189 190 191 192 193 | 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | - + - - + + |
margin-left: 1px;
border-width: 3px 0;
border-left: 7px solid #600000;
}
.tl-line.warp {
background: #600000;
}
|
| ︙ |
Changes to src/graph.c.
| ︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | + + + + + + + + + + + + + + + + + + + + - + - + - |
*******************************************************************************
**
** This file contains code to compute a revision history graph.
*/
#include "config.h"
#include "graph.h"
#include <assert.h>
/* Notes:
**
** The graph is laid out in 1 or more "rails". A "rail" is a vertical
** band in the graph in which one can place nodes or arrows connecting
** nodes. There can be between 1 and GR_MAX_RAIL rails. If the graph
** is to complex to be displayed in GR_MAX_RAIL rails, it is omitted.
**
** A "riser" is the thick line that comes out of the top of a node and
** goes up to the next node on the branch, or to the top of the screen.
** A "descender" is a thick line that comes out of the bottom of a node
** and proceeds down to the bottom of the page.
**
** Invoke graph_init() to create a new GraphContext object. Then
** call graph_add_row() to add nodes, one by one, to the graph.
** Nodes must be added in display order, from top to bottom.
** Then invoke graph_render() to run the layout algorithm. The
** layout algorithm computes which rails all of the nodes sit on, and
** the rails used for merge arrows.
*/
#if INTERFACE
#define GR_MAX_RAIL 40 /* Max number of "rails" to display */
/* The graph appears vertically beside a timeline. Each row in the
** timeline corresponds to a row in the graph. GraphRow.idx is 0 for
** the top-most row and increases moving down. Hence (in the absence of
** time skew) parents have a larger index than their children.
**
** The nParent field is -1 for entires that do not participate in the graph
** but which are included just so that we can capture their background color.
*/
struct GraphRow {
int rid; /* The rid for the check-in */
|
| ︙ | |||
81 82 83 84 85 86 87 88 89 90 91 92 93 94 | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | + + + + + + + |
GraphRow **apHash; /* Hash table of GraphRow objects. Key: rid */
};
#endif
/* The N-th bit */
#define BIT(N) (((u64)1)<<(N))
/*
** Number of rows before and answer a node with a riser or descender
** that goes off-screen before we can reuse that rail.
*/
#define RISER_MARGIN 4
/*
** Malloc for zeroed space. Panic if unable to provide the
** requested space.
*/
void *safeMalloc(int nByte){
void *p = fossil_malloc(nByte);
|
| ︙ | |||
244 245 246 247 248 249 250 | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | - + |
int iBestDist = 9999;
u64 inUseMask = 0;
for(pRow=p->pFirst; pRow && pRow->idx<top; pRow=pRow->pNext){}
while( pRow && pRow->idx<=btm ){
inUseMask |= pRow->railInUse;
pRow = pRow->pNext;
}
|
| ︙ | |||
266 267 268 269 270 271 272 | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | - + + + + + + + + + - + - + + - + | if( iBest>p->mxRail ) p->mxRail = iBest; return iBest; } /* ** Assign all children of node pBottom to the same rail as pBottom. */ |
| ︙ | |||
351 352 353 354 355 356 357 | 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | - + + + - + + |
){
p->mxRail++;
}
}
}
/*
|
| ︙ | |||
419 420 421 422 423 424 425 | 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 | - + | ** ** Each node has one primary parent and zero or more "merge" parents. ** A merge parent is a prior check-in from which changes were merged into ** the current check-in. If a merge parent is not in the visible section ** of this graph, then no arrows will be drawn for it, so remove it from ** the aParent[] array. */ |
| ︙ | |||
475 476 477 478 479 480 481 | 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | - + - - - + - - - - + + + + - + + + + + + + + + + - + + + - - - - - - - + - - - + - + - + |
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
if( pRow->isDup ) continue;
if( pRow->nParent<=0 ) continue; /* Root node */
pParent = hashFind(p, pRow->aParent[0]);
if( pParent==0 ) continue; /* Parent off-screen */
if( pParent->zBranch!=pRow->zBranch ) continue; /* Different branch */
if( pParent->idx <= pRow->idx ){
|
| ︙ | |||
568 569 570 571 572 573 574 | 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 | - + + - + |
if( p->mxRail>=GR_MAX_RAIL ) return;
pRow->railInUse = BIT(pRow->iRail);
continue;
}
if( pParent->idx>pRow->idx ){
/* Common case: Child occurs after parent and is above the
** parent in the timeline */
|
| ︙ |
Changes to src/graph.js.
| ︙ | |||
181 182 183 184 185 186 187 | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | - + - + - + + |
if( x1===null ){
x1 = x0+elem.w;
cls += "v";
}else{
y1 = y0+elem.w;
cls += "h";
}
|
| ︙ | |||
241 242 243 244 245 246 247 | 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | - + + + + + + + + + - - + + + + + + + + + + + - - + + + + + + + |
var e = document.getElementById("mc"+p.id);
if(e) e.style.backgroundColor = p.bg;
e = document.getElementById("md"+p.id);
if(e) e.style.backgroundColor = p.bg;
}
if( p.r<0 ) return;
if( p.u>0 ) drawUpArrow(p,tx.rowinfo[p.u-tx.iTopRow],p.fg);
|
| ︙ |
Changes to src/info.c.
| ︙ | |||
282 283 284 285 286 287 288 289 290 291 292 293 294 295 | 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | + |
}
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
db_prepare(&q, "%s", blob_sql_text(&sql));
www_print_timeline(&q,
TIMELINE_GRAPH
|TIMELINE_FILLGAPS
|TIMELINE_NOSCROLL
|TIMELINE_XMERGE
|TIMELINE_CHPICK,
0, 0, rid, 0);
db_finalize(&q);
}
/*
** Show a graph all wiki, tickets, and check-ins that refer to object zUuid.
|
| ︙ |
Changes to src/tag.c.
| ︙ | |||
748 749 750 751 752 753 754 | 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 | - + |
" WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n",
zUnaryOp/*safe-for-%s*/, TAG_HIDDEN);
}
db_prepare(&q, "%s ORDER BY event.mtime DESC /*sort*/", blob_sql_text(&sql));
blob_reset(&sql);
/* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
** many descenders to (off-screen) parents. */
|
| ︙ |
Changes to src/timeline.c.
| ︙ | |||
89 90 91 92 93 94 95 | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + | } } /* ** Allowed flags for the tmFlags argument to www_print_timeline */ #if INTERFACE |
| ︙ | |||
295 296 297 298 299 300 301 | 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | - - + + |
TAG_BRANCH
);
if( (tmFlags & TIMELINE_CHPICK)!=0
&& !db_table_exists("repository","cherrypick")
){
tmFlags &= ~TIMELINE_CHPICK;
}
|
| ︙ | |||
865 866 867 868 869 870 871 | 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 | - + + - + + |
** id: The id of the <div> element for the row. This is an integer.
** to get an actual id, prepend "m" to the integer. The top node
** is iTopRow and numbers increase moving down the timeline.
** bg: The background color for this row
** r: The "rail" that the node for this row sits on. The left-most
** rail is 0 and the number increases to the right.
** d: If exists and true then there is a "descender" - an arrow
|
| ︙ | |||
1492 1493 1494 1495 1496 1497 1498 | 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 | - + | ** ng No Graph. ** ncp Omit cherrypick merges ** nd Do not highlight the focus check-in ** v Show details of files changed ** f=CHECKIN Show family (immediate parents and children) of CHECKIN ** from=CHECKIN Path from... ** to=CHECKIN ... to this |
| ︙ | |||
1689 1690 1691 1692 1693 1694 1695 | 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 | - - + + |
}
if( zType[0]=='a' ){
tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH | TIMELINE_CHPICK;
}else{
tmFlags |= TIMELINE_GRAPH | TIMELINE_CHPICK;
}
if( related ){
|
| ︙ | |||
1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 | 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 | + |
}
}
db_multi_exec("INSERT OR IGNORE INTO pathnode SELECT x FROM related");
}
blob_append_sql(&sql, " AND event.objid IN pathnode");
addFileGlobExclusion(zChng, &sql);
tmFlags |= TIMELINE_DISJOINT;
tmFlags &= ~TIMELINE_CHPICK;
db_multi_exec("%s", blob_sql_text(&sql));
if( advancedMenu ){
style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0);
}
blob_appendf(&desc, "%d check-ins going from ", nNodeOnPath);
blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom);
blob_append(&desc, " to ", -1);
|
| ︙ | |||
1877 1878 1879 1880 1881 1882 1883 | 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 | - + |
}
addFileGlobDescription(zChng, &desc);
}else if( (p_rid || d_rid) && g.perm.Read && zTagSql==0 ){
/* If p= or d= is present, ignore all other parameters other than n= */
char *zUuid;
int np, nd;
|
| ︙ | |||
1945 1946 1947 1948 1949 1950 1951 | 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 | - + + - + |
}
blob_append_sql(&sql, " AND event.objid IN ok");
db_multi_exec("%s", blob_sql_text(&sql));
if( useDividers ) selectedRid = f_rid;
blob_appendf(&desc, "Parents and children of check-in ");
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid);
blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid);
|
| ︙ | |||
2218 2219 2220 2221 2222 2223 2224 | 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 | - + - + - + - + |
}else{
blob_appendf(&desc, "%d %s%s", n, zEType, zPlural);
}
if( zUses ){
char *zFilenames = names_of_file(zUses);
blob_appendf(&desc, " using file %s version %z%S</a>", zFilenames,
href("%R/artifact/%!S",zUses), zUses);
|
| ︙ |