Fossil SCM
Enhance the from=/to= query parameters on the /timeline page so that when the "rel" query parameter is present, the graph shows checkins that merge with checkins on the choose path.
Commit
7759a00e3e03e531d093d7974b82df64dad4a1b826b9bd253d7042f6a7d621c6
Parent
4da95b254396d1f…
1 file changed
+36
-6
+36
-6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1434,12 +1434,13 @@ | ||
| 1434 | 1434 | ** ncp Omit cherrypick merges |
| 1435 | 1435 | ** nd Do not highlight the focus check-in |
| 1436 | 1436 | ** v Show details of files changed |
| 1437 | 1437 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1438 | 1438 | ** from=CHECKIN Path from... |
| 1439 | -** to=CHECKIN ... to this | |
| 1440 | -** shortest ... show only the shortest path | |
| 1439 | +** to=CHECKIN ... to this | |
| 1440 | +** shorest ... show only the shortest path | |
| 1441 | +** rel ... also show related checkins | |
| 1441 | 1442 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| 1442 | 1443 | ** chng=GLOBLIST Show only check-ins that involve changes to a file whose |
| 1443 | 1444 | ** name matches one of the comma-separate GLOBLIST |
| 1444 | 1445 | ** brbg Background color from branch name |
| 1445 | 1446 | ** ubg Background color from user |
| @@ -1721,10 +1722,11 @@ | ||
| 1721 | 1722 | /* If from= and to= are present, display all nodes on a path connecting |
| 1722 | 1723 | ** the two */ |
| 1723 | 1724 | PathNode *p = 0; |
| 1724 | 1725 | const char *zFrom = 0; |
| 1725 | 1726 | const char *zTo = 0; |
| 1727 | + Blob ins; | |
| 1726 | 1728 | |
| 1727 | 1729 | if( from_rid && to_rid ){ |
| 1728 | 1730 | p = path_shortest(from_rid, to_rid, noMerge, 0); |
| 1729 | 1731 | zFrom = P("from"); |
| 1730 | 1732 | zTo = P("to"); |
| @@ -1733,17 +1735,45 @@ | ||
| 1733 | 1735 | p = path_first(); |
| 1734 | 1736 | } |
| 1735 | 1737 | zFrom = P("me"); |
| 1736 | 1738 | zTo = P("you"); |
| 1737 | 1739 | } |
| 1738 | - blob_append(&sql, " AND event.objid IN (0", -1); | |
| 1739 | - while( p ){ | |
| 1740 | - blob_append_sql(&sql, ",%d", p->rid); | |
| 1740 | + blob_init(&ins, 0, 0); | |
| 1741 | + db_multi_exec( | |
| 1742 | + "CREATE TABLE IF NOT EXISTS temp.pathnode(x INTEGER PRIMARY KEY);" | |
| 1743 | + ); | |
| 1744 | + if( p ){ | |
| 1745 | + blob_init(&ins, 0, 0); | |
| 1746 | + blob_append_sql(&ins, "INSERT INTO pathnode(x) VALUES(%d)", p->rid); | |
| 1741 | 1747 | p = p->u.pTo; |
| 1748 | + while( p ){ | |
| 1749 | + blob_append_sql(&ins, ",(%d)", p->rid); | |
| 1750 | + p = p->u.pTo; | |
| 1751 | + } | |
| 1742 | 1752 | } |
| 1743 | - blob_append(&sql, ")", -1); | |
| 1744 | 1753 | path_reset(); |
| 1754 | + db_multi_exec("%s", blob_str(&ins)/*safe-for-%s*/); | |
| 1755 | + blob_reset(&ins); | |
| 1756 | + if( related ){ | |
| 1757 | + db_multi_exec( | |
| 1758 | + "CREATE TABLE IF NOT EXISTS temp.related(x INTEGER PRIMARY KEY);" | |
| 1759 | + "INSERT OR IGNORE INTO related(x)" | |
| 1760 | + " SELECT cid FROM plink WHERE pid IN pathnode;" | |
| 1761 | + "INSERT OR IGNORE INTO related(x)" | |
| 1762 | + " SELECT pid FROM plink WHERE cid IN pathnode;" | |
| 1763 | + ); | |
| 1764 | + if( showCherrypicks ){ | |
| 1765 | + db_multi_exec( | |
| 1766 | + "INSERT OR IGNORE INTO related(x)" | |
| 1767 | + " SELECT childid FROM cherrypick WHERE parentid IN pathnode;" | |
| 1768 | + "INSERT OR IGNORE INTO related(x)" | |
| 1769 | + " SELECT parentid FROM cherrypick WHERE childid IN pathnode;" | |
| 1770 | + ); | |
| 1771 | + } | |
| 1772 | + db_multi_exec("INSERT OR IGNORE INTO pathnode SELECT x FROM related"); | |
| 1773 | + } | |
| 1774 | + blob_append_sql(&sql, " AND event.objid IN pathnode"); | |
| 1745 | 1775 | addFileGlobExclusion(zChng, &sql); |
| 1746 | 1776 | tmFlags |= TIMELINE_DISJOINT; |
| 1747 | 1777 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1748 | 1778 | if( advancedMenu ){ |
| 1749 | 1779 | style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0); |
| 1750 | 1780 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1434,12 +1434,13 @@ | |
| 1434 | ** ncp Omit cherrypick merges |
| 1435 | ** nd Do not highlight the focus check-in |
| 1436 | ** v Show details of files changed |
| 1437 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1438 | ** from=CHECKIN Path from... |
| 1439 | ** to=CHECKIN ... to this |
| 1440 | ** shortest ... show only the shortest path |
| 1441 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| 1442 | ** chng=GLOBLIST Show only check-ins that involve changes to a file whose |
| 1443 | ** name matches one of the comma-separate GLOBLIST |
| 1444 | ** brbg Background color from branch name |
| 1445 | ** ubg Background color from user |
| @@ -1721,10 +1722,11 @@ | |
| 1721 | /* If from= and to= are present, display all nodes on a path connecting |
| 1722 | ** the two */ |
| 1723 | PathNode *p = 0; |
| 1724 | const char *zFrom = 0; |
| 1725 | const char *zTo = 0; |
| 1726 | |
| 1727 | if( from_rid && to_rid ){ |
| 1728 | p = path_shortest(from_rid, to_rid, noMerge, 0); |
| 1729 | zFrom = P("from"); |
| 1730 | zTo = P("to"); |
| @@ -1733,17 +1735,45 @@ | |
| 1733 | p = path_first(); |
| 1734 | } |
| 1735 | zFrom = P("me"); |
| 1736 | zTo = P("you"); |
| 1737 | } |
| 1738 | blob_append(&sql, " AND event.objid IN (0", -1); |
| 1739 | while( p ){ |
| 1740 | blob_append_sql(&sql, ",%d", p->rid); |
| 1741 | p = p->u.pTo; |
| 1742 | } |
| 1743 | blob_append(&sql, ")", -1); |
| 1744 | path_reset(); |
| 1745 | addFileGlobExclusion(zChng, &sql); |
| 1746 | tmFlags |= TIMELINE_DISJOINT; |
| 1747 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1748 | if( advancedMenu ){ |
| 1749 | style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0); |
| 1750 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1434,12 +1434,13 @@ | |
| 1434 | ** ncp Omit cherrypick merges |
| 1435 | ** nd Do not highlight the focus check-in |
| 1436 | ** v Show details of files changed |
| 1437 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1438 | ** from=CHECKIN Path from... |
| 1439 | ** to=CHECKIN ... to this |
| 1440 | ** shorest ... show only the shortest path |
| 1441 | ** rel ... also show related checkins |
| 1442 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| 1443 | ** chng=GLOBLIST Show only check-ins that involve changes to a file whose |
| 1444 | ** name matches one of the comma-separate GLOBLIST |
| 1445 | ** brbg Background color from branch name |
| 1446 | ** ubg Background color from user |
| @@ -1721,10 +1722,11 @@ | |
| 1722 | /* If from= and to= are present, display all nodes on a path connecting |
| 1723 | ** the two */ |
| 1724 | PathNode *p = 0; |
| 1725 | const char *zFrom = 0; |
| 1726 | const char *zTo = 0; |
| 1727 | Blob ins; |
| 1728 | |
| 1729 | if( from_rid && to_rid ){ |
| 1730 | p = path_shortest(from_rid, to_rid, noMerge, 0); |
| 1731 | zFrom = P("from"); |
| 1732 | zTo = P("to"); |
| @@ -1733,17 +1735,45 @@ | |
| 1735 | p = path_first(); |
| 1736 | } |
| 1737 | zFrom = P("me"); |
| 1738 | zTo = P("you"); |
| 1739 | } |
| 1740 | blob_init(&ins, 0, 0); |
| 1741 | db_multi_exec( |
| 1742 | "CREATE TABLE IF NOT EXISTS temp.pathnode(x INTEGER PRIMARY KEY);" |
| 1743 | ); |
| 1744 | if( p ){ |
| 1745 | blob_init(&ins, 0, 0); |
| 1746 | blob_append_sql(&ins, "INSERT INTO pathnode(x) VALUES(%d)", p->rid); |
| 1747 | p = p->u.pTo; |
| 1748 | while( p ){ |
| 1749 | blob_append_sql(&ins, ",(%d)", p->rid); |
| 1750 | p = p->u.pTo; |
| 1751 | } |
| 1752 | } |
| 1753 | path_reset(); |
| 1754 | db_multi_exec("%s", blob_str(&ins)/*safe-for-%s*/); |
| 1755 | blob_reset(&ins); |
| 1756 | if( related ){ |
| 1757 | db_multi_exec( |
| 1758 | "CREATE TABLE IF NOT EXISTS temp.related(x INTEGER PRIMARY KEY);" |
| 1759 | "INSERT OR IGNORE INTO related(x)" |
| 1760 | " SELECT cid FROM plink WHERE pid IN pathnode;" |
| 1761 | "INSERT OR IGNORE INTO related(x)" |
| 1762 | " SELECT pid FROM plink WHERE cid IN pathnode;" |
| 1763 | ); |
| 1764 | if( showCherrypicks ){ |
| 1765 | db_multi_exec( |
| 1766 | "INSERT OR IGNORE INTO related(x)" |
| 1767 | " SELECT childid FROM cherrypick WHERE parentid IN pathnode;" |
| 1768 | "INSERT OR IGNORE INTO related(x)" |
| 1769 | " SELECT parentid FROM cherrypick WHERE childid IN pathnode;" |
| 1770 | ); |
| 1771 | } |
| 1772 | db_multi_exec("INSERT OR IGNORE INTO pathnode SELECT x FROM related"); |
| 1773 | } |
| 1774 | blob_append_sql(&sql, " AND event.objid IN pathnode"); |
| 1775 | addFileGlobExclusion(zChng, &sql); |
| 1776 | tmFlags |= TIMELINE_DISJOINT; |
| 1777 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1778 | if( advancedMenu ){ |
| 1779 | style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0); |
| 1780 |