Fossil SCM
New ml=TAGLIST query parameter to /timeline works like "tl=TAGLIST with "mionly".
Commit
7f06e5ca6e5e94f145c091a5623f1308aaad95478d600cf7012b67179e007576
Parent
fc62ce69e909fdc…
1 file changed
+17
-8
+17
-8
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1552,10 +1552,11 @@ | ||
| 1552 | 1552 | ** from=CX ... shortest path from CX up to CHECKIN |
| 1553 | 1553 | ** t=TAG Show only check-ins with the given TAG |
| 1554 | 1554 | ** r=TAG Show check-ins related to TAG, equivalent to t=TAG&rel |
| 1555 | 1555 | ** tl=TAGLIST Same as 't=TAGLIST&ms=brlist' |
| 1556 | 1556 | ** rl=TAGLIST Same as 'r=TAGLIST&ms=brlist' |
| 1557 | +** ml=TAGLIST Same as 't=TAGLIST&ms=brlist&mionly' | |
| 1557 | 1558 | ** bo=TAGLIST Show branches of the graph in the order defined TAGLIST |
| 1558 | 1559 | ** rel Show related check-ins as well as those matching t=TAG |
| 1559 | 1560 | ** mionly Limit rel to show ancestors but not descendants |
| 1560 | 1561 | ** nowiki Do not show wiki associated with branch or tag |
| 1561 | 1562 | ** ms=MATCHSTYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP |
| @@ -1691,10 +1692,13 @@ | ||
| 1691 | 1692 | login_check_credentials(); |
| 1692 | 1693 | url_initialize(&url, "timeline"); |
| 1693 | 1694 | cgi_query_parameters_to_url(&url); |
| 1694 | 1695 | blob_init(&allSql, 0, 0); |
| 1695 | 1696 | |
| 1697 | + /* The "mionly" query parameter is like "rel", but shows merge-ins only */ | |
| 1698 | + if( P("mionly")!=0 ) related = 2; | |
| 1699 | + | |
| 1696 | 1700 | (void)P_NoBot("ss") |
| 1697 | 1701 | /* "ss" is processed via the udc but at least one spider likes to |
| 1698 | 1702 | ** try to SQL inject via this argument, so let's catch that. */; |
| 1699 | 1703 | |
| 1700 | 1704 | /* Set number of rows to display */ |
| @@ -1811,14 +1815,19 @@ | ||
| 1811 | 1815 | if( zBrName==0 && zTagName==0 ){ |
| 1812 | 1816 | const char *z; |
| 1813 | 1817 | if( (z = P("tl"))!=0 ){ |
| 1814 | 1818 | zTagName = z; |
| 1815 | 1819 | zMatchStyle = "brlist"; |
| 1816 | - } | |
| 1820 | + }else | |
| 1817 | 1821 | if( (z = P("rl"))!=0 ){ |
| 1818 | 1822 | zBrName = z; |
| 1819 | - related = 1; | |
| 1823 | + if( related==0 ) related = 1; | |
| 1824 | + zMatchStyle = "brlist"; | |
| 1825 | + }else | |
| 1826 | + if( (z = P("ml"))!=0 ){ | |
| 1827 | + zBrName = z; | |
| 1828 | + if( related==0 ) related = 2; | |
| 1820 | 1829 | zMatchStyle = "brlist"; |
| 1821 | 1830 | } |
| 1822 | 1831 | } |
| 1823 | 1832 | |
| 1824 | 1833 | /* Convert r=TAG to t=TAG&rel in order to populate the UI style widgets. */ |
| @@ -1825,11 +1834,11 @@ | ||
| 1825 | 1834 | if( zBrName ){ |
| 1826 | 1835 | cgi_delete_query_parameter("r"); |
| 1827 | 1836 | cgi_set_query_parameter("t", zBrName); (void)P("t"); |
| 1828 | 1837 | cgi_set_query_parameter("rel", "1"); |
| 1829 | 1838 | zTagName = zBrName; |
| 1830 | - related = 1; | |
| 1839 | + if( related==0 ) related = 1; | |
| 1831 | 1840 | zType = "ci"; |
| 1832 | 1841 | } |
| 1833 | 1842 | |
| 1834 | 1843 | /* Ignore empty tag query strings. */ |
| 1835 | 1844 | if( zTagName && !*zTagName ){ |
| @@ -2089,17 +2098,17 @@ | ||
| 2089 | 2098 | } |
| 2090 | 2099 | } |
| 2091 | 2100 | path_reset(); |
| 2092 | 2101 | db_multi_exec("%s", blob_str(&ins)/*safe-for-%s*/); |
| 2093 | 2102 | blob_reset(&ins); |
| 2094 | - if( related || P("mionly") ){ | |
| 2103 | + if( related ){ | |
| 2095 | 2104 | db_multi_exec( |
| 2096 | 2105 | "CREATE TEMP TABLE IF NOT EXISTS related(x INTEGER PRIMARY KEY);" |
| 2097 | 2106 | "INSERT OR IGNORE INTO related(x)" |
| 2098 | 2107 | " SELECT pid FROM plink WHERE cid IN pathnode AND NOT isprim;" |
| 2099 | 2108 | ); |
| 2100 | - if( P("mionly")==0 ){ | |
| 2109 | + if( related==1 ){ | |
| 2101 | 2110 | db_multi_exec( |
| 2102 | 2111 | "INSERT OR IGNORE INTO related(x)" |
| 2103 | 2112 | " SELECT cid FROM plink WHERE pid IN pathnode;" |
| 2104 | 2113 | ); |
| 2105 | 2114 | } |
| @@ -2106,11 +2115,11 @@ | ||
| 2106 | 2115 | if( showCherrypicks ){ |
| 2107 | 2116 | db_multi_exec( |
| 2108 | 2117 | "INSERT OR IGNORE INTO related(x)" |
| 2109 | 2118 | " SELECT parentid FROM cherrypick WHERE childid IN pathnode;" |
| 2110 | 2119 | ); |
| 2111 | - if( P("mionly")==0 ){ | |
| 2120 | + if( related==1 ){ | |
| 2112 | 2121 | db_multi_exec( |
| 2113 | 2122 | "INSERT OR IGNORE INTO related(x)" |
| 2114 | 2123 | " SELECT childid FROM cherrypick WHERE parentid IN pathnode;" |
| 2115 | 2124 | ); |
| 2116 | 2125 | } |
| @@ -2536,11 +2545,11 @@ | ||
| 2536 | 2545 | int ridMark = name_to_rid(zMark); |
| 2537 | 2546 | db_multi_exec( |
| 2538 | 2547 | "INSERT OR IGNORE INTO selected_nodes(rid) VALUES(%d)", ridMark); |
| 2539 | 2548 | } |
| 2540 | 2549 | add_extra_rids("selected_nodes",P("x")); |
| 2541 | - if( !related && !PB("mionly") ){ | |
| 2550 | + if( related==0 ){ | |
| 2542 | 2551 | blob_append_sql(&cond, " AND blob.rid IN selected_nodes"); |
| 2543 | 2552 | }else{ |
| 2544 | 2553 | db_multi_exec( |
| 2545 | 2554 | "CREATE TEMP TABLE related_nodes(rid INTEGER PRIMARY KEY);" |
| 2546 | 2555 | "INSERT INTO related_nodes SELECT rid FROM selected_nodes;" |
| @@ -2555,11 +2564,11 @@ | ||
| 2555 | 2564 | db_multi_exec( |
| 2556 | 2565 | "INSERT OR IGNORE INTO related_nodes\n" |
| 2557 | 2566 | " SELECT pid FROM selected_nodes CROSS JOIN plink\n" |
| 2558 | 2567 | " WHERE selected_nodes.rid=plink.cid;" |
| 2559 | 2568 | ); |
| 2560 | - if( P("mionly")==0 ){ | |
| 2569 | + if( related==1 ){ | |
| 2561 | 2570 | db_multi_exec( |
| 2562 | 2571 | "INSERT OR IGNORE INTO related_nodes\n" |
| 2563 | 2572 | " SELECT cid FROM selected_nodes CROSS JOIN plink\n" |
| 2564 | 2573 | " WHERE selected_nodes.rid=plink.pid;" |
| 2565 | 2574 | ); |
| 2566 | 2575 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1552,10 +1552,11 @@ | |
| 1552 | ** from=CX ... shortest path from CX up to CHECKIN |
| 1553 | ** t=TAG Show only check-ins with the given TAG |
| 1554 | ** r=TAG Show check-ins related to TAG, equivalent to t=TAG&rel |
| 1555 | ** tl=TAGLIST Same as 't=TAGLIST&ms=brlist' |
| 1556 | ** rl=TAGLIST Same as 'r=TAGLIST&ms=brlist' |
| 1557 | ** bo=TAGLIST Show branches of the graph in the order defined TAGLIST |
| 1558 | ** rel Show related check-ins as well as those matching t=TAG |
| 1559 | ** mionly Limit rel to show ancestors but not descendants |
| 1560 | ** nowiki Do not show wiki associated with branch or tag |
| 1561 | ** ms=MATCHSTYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP |
| @@ -1691,10 +1692,13 @@ | |
| 1691 | login_check_credentials(); |
| 1692 | url_initialize(&url, "timeline"); |
| 1693 | cgi_query_parameters_to_url(&url); |
| 1694 | blob_init(&allSql, 0, 0); |
| 1695 | |
| 1696 | (void)P_NoBot("ss") |
| 1697 | /* "ss" is processed via the udc but at least one spider likes to |
| 1698 | ** try to SQL inject via this argument, so let's catch that. */; |
| 1699 | |
| 1700 | /* Set number of rows to display */ |
| @@ -1811,14 +1815,19 @@ | |
| 1811 | if( zBrName==0 && zTagName==0 ){ |
| 1812 | const char *z; |
| 1813 | if( (z = P("tl"))!=0 ){ |
| 1814 | zTagName = z; |
| 1815 | zMatchStyle = "brlist"; |
| 1816 | } |
| 1817 | if( (z = P("rl"))!=0 ){ |
| 1818 | zBrName = z; |
| 1819 | related = 1; |
| 1820 | zMatchStyle = "brlist"; |
| 1821 | } |
| 1822 | } |
| 1823 | |
| 1824 | /* Convert r=TAG to t=TAG&rel in order to populate the UI style widgets. */ |
| @@ -1825,11 +1834,11 @@ | |
| 1825 | if( zBrName ){ |
| 1826 | cgi_delete_query_parameter("r"); |
| 1827 | cgi_set_query_parameter("t", zBrName); (void)P("t"); |
| 1828 | cgi_set_query_parameter("rel", "1"); |
| 1829 | zTagName = zBrName; |
| 1830 | related = 1; |
| 1831 | zType = "ci"; |
| 1832 | } |
| 1833 | |
| 1834 | /* Ignore empty tag query strings. */ |
| 1835 | if( zTagName && !*zTagName ){ |
| @@ -2089,17 +2098,17 @@ | |
| 2089 | } |
| 2090 | } |
| 2091 | path_reset(); |
| 2092 | db_multi_exec("%s", blob_str(&ins)/*safe-for-%s*/); |
| 2093 | blob_reset(&ins); |
| 2094 | if( related || P("mionly") ){ |
| 2095 | db_multi_exec( |
| 2096 | "CREATE TEMP TABLE IF NOT EXISTS related(x INTEGER PRIMARY KEY);" |
| 2097 | "INSERT OR IGNORE INTO related(x)" |
| 2098 | " SELECT pid FROM plink WHERE cid IN pathnode AND NOT isprim;" |
| 2099 | ); |
| 2100 | if( P("mionly")==0 ){ |
| 2101 | db_multi_exec( |
| 2102 | "INSERT OR IGNORE INTO related(x)" |
| 2103 | " SELECT cid FROM plink WHERE pid IN pathnode;" |
| 2104 | ); |
| 2105 | } |
| @@ -2106,11 +2115,11 @@ | |
| 2106 | if( showCherrypicks ){ |
| 2107 | db_multi_exec( |
| 2108 | "INSERT OR IGNORE INTO related(x)" |
| 2109 | " SELECT parentid FROM cherrypick WHERE childid IN pathnode;" |
| 2110 | ); |
| 2111 | if( P("mionly")==0 ){ |
| 2112 | db_multi_exec( |
| 2113 | "INSERT OR IGNORE INTO related(x)" |
| 2114 | " SELECT childid FROM cherrypick WHERE parentid IN pathnode;" |
| 2115 | ); |
| 2116 | } |
| @@ -2536,11 +2545,11 @@ | |
| 2536 | int ridMark = name_to_rid(zMark); |
| 2537 | db_multi_exec( |
| 2538 | "INSERT OR IGNORE INTO selected_nodes(rid) VALUES(%d)", ridMark); |
| 2539 | } |
| 2540 | add_extra_rids("selected_nodes",P("x")); |
| 2541 | if( !related && !PB("mionly") ){ |
| 2542 | blob_append_sql(&cond, " AND blob.rid IN selected_nodes"); |
| 2543 | }else{ |
| 2544 | db_multi_exec( |
| 2545 | "CREATE TEMP TABLE related_nodes(rid INTEGER PRIMARY KEY);" |
| 2546 | "INSERT INTO related_nodes SELECT rid FROM selected_nodes;" |
| @@ -2555,11 +2564,11 @@ | |
| 2555 | db_multi_exec( |
| 2556 | "INSERT OR IGNORE INTO related_nodes\n" |
| 2557 | " SELECT pid FROM selected_nodes CROSS JOIN plink\n" |
| 2558 | " WHERE selected_nodes.rid=plink.cid;" |
| 2559 | ); |
| 2560 | if( P("mionly")==0 ){ |
| 2561 | db_multi_exec( |
| 2562 | "INSERT OR IGNORE INTO related_nodes\n" |
| 2563 | " SELECT cid FROM selected_nodes CROSS JOIN plink\n" |
| 2564 | " WHERE selected_nodes.rid=plink.pid;" |
| 2565 | ); |
| 2566 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1552,10 +1552,11 @@ | |
| 1552 | ** from=CX ... shortest path from CX up to CHECKIN |
| 1553 | ** t=TAG Show only check-ins with the given TAG |
| 1554 | ** r=TAG Show check-ins related to TAG, equivalent to t=TAG&rel |
| 1555 | ** tl=TAGLIST Same as 't=TAGLIST&ms=brlist' |
| 1556 | ** rl=TAGLIST Same as 'r=TAGLIST&ms=brlist' |
| 1557 | ** ml=TAGLIST Same as 't=TAGLIST&ms=brlist&mionly' |
| 1558 | ** bo=TAGLIST Show branches of the graph in the order defined TAGLIST |
| 1559 | ** rel Show related check-ins as well as those matching t=TAG |
| 1560 | ** mionly Limit rel to show ancestors but not descendants |
| 1561 | ** nowiki Do not show wiki associated with branch or tag |
| 1562 | ** ms=MATCHSTYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP |
| @@ -1691,10 +1692,13 @@ | |
| 1692 | login_check_credentials(); |
| 1693 | url_initialize(&url, "timeline"); |
| 1694 | cgi_query_parameters_to_url(&url); |
| 1695 | blob_init(&allSql, 0, 0); |
| 1696 | |
| 1697 | /* The "mionly" query parameter is like "rel", but shows merge-ins only */ |
| 1698 | if( P("mionly")!=0 ) related = 2; |
| 1699 | |
| 1700 | (void)P_NoBot("ss") |
| 1701 | /* "ss" is processed via the udc but at least one spider likes to |
| 1702 | ** try to SQL inject via this argument, so let's catch that. */; |
| 1703 | |
| 1704 | /* Set number of rows to display */ |
| @@ -1811,14 +1815,19 @@ | |
| 1815 | if( zBrName==0 && zTagName==0 ){ |
| 1816 | const char *z; |
| 1817 | if( (z = P("tl"))!=0 ){ |
| 1818 | zTagName = z; |
| 1819 | zMatchStyle = "brlist"; |
| 1820 | }else |
| 1821 | if( (z = P("rl"))!=0 ){ |
| 1822 | zBrName = z; |
| 1823 | if( related==0 ) related = 1; |
| 1824 | zMatchStyle = "brlist"; |
| 1825 | }else |
| 1826 | if( (z = P("ml"))!=0 ){ |
| 1827 | zBrName = z; |
| 1828 | if( related==0 ) related = 2; |
| 1829 | zMatchStyle = "brlist"; |
| 1830 | } |
| 1831 | } |
| 1832 | |
| 1833 | /* Convert r=TAG to t=TAG&rel in order to populate the UI style widgets. */ |
| @@ -1825,11 +1834,11 @@ | |
| 1834 | if( zBrName ){ |
| 1835 | cgi_delete_query_parameter("r"); |
| 1836 | cgi_set_query_parameter("t", zBrName); (void)P("t"); |
| 1837 | cgi_set_query_parameter("rel", "1"); |
| 1838 | zTagName = zBrName; |
| 1839 | if( related==0 ) related = 1; |
| 1840 | zType = "ci"; |
| 1841 | } |
| 1842 | |
| 1843 | /* Ignore empty tag query strings. */ |
| 1844 | if( zTagName && !*zTagName ){ |
| @@ -2089,17 +2098,17 @@ | |
| 2098 | } |
| 2099 | } |
| 2100 | path_reset(); |
| 2101 | db_multi_exec("%s", blob_str(&ins)/*safe-for-%s*/); |
| 2102 | blob_reset(&ins); |
| 2103 | if( related ){ |
| 2104 | db_multi_exec( |
| 2105 | "CREATE TEMP TABLE IF NOT EXISTS related(x INTEGER PRIMARY KEY);" |
| 2106 | "INSERT OR IGNORE INTO related(x)" |
| 2107 | " SELECT pid FROM plink WHERE cid IN pathnode AND NOT isprim;" |
| 2108 | ); |
| 2109 | if( related==1 ){ |
| 2110 | db_multi_exec( |
| 2111 | "INSERT OR IGNORE INTO related(x)" |
| 2112 | " SELECT cid FROM plink WHERE pid IN pathnode;" |
| 2113 | ); |
| 2114 | } |
| @@ -2106,11 +2115,11 @@ | |
| 2115 | if( showCherrypicks ){ |
| 2116 | db_multi_exec( |
| 2117 | "INSERT OR IGNORE INTO related(x)" |
| 2118 | " SELECT parentid FROM cherrypick WHERE childid IN pathnode;" |
| 2119 | ); |
| 2120 | if( related==1 ){ |
| 2121 | db_multi_exec( |
| 2122 | "INSERT OR IGNORE INTO related(x)" |
| 2123 | " SELECT childid FROM cherrypick WHERE parentid IN pathnode;" |
| 2124 | ); |
| 2125 | } |
| @@ -2536,11 +2545,11 @@ | |
| 2545 | int ridMark = name_to_rid(zMark); |
| 2546 | db_multi_exec( |
| 2547 | "INSERT OR IGNORE INTO selected_nodes(rid) VALUES(%d)", ridMark); |
| 2548 | } |
| 2549 | add_extra_rids("selected_nodes",P("x")); |
| 2550 | if( related==0 ){ |
| 2551 | blob_append_sql(&cond, " AND blob.rid IN selected_nodes"); |
| 2552 | }else{ |
| 2553 | db_multi_exec( |
| 2554 | "CREATE TEMP TABLE related_nodes(rid INTEGER PRIMARY KEY);" |
| 2555 | "INSERT INTO related_nodes SELECT rid FROM selected_nodes;" |
| @@ -2555,11 +2564,11 @@ | |
| 2564 | db_multi_exec( |
| 2565 | "INSERT OR IGNORE INTO related_nodes\n" |
| 2566 | " SELECT pid FROM selected_nodes CROSS JOIN plink\n" |
| 2567 | " WHERE selected_nodes.rid=plink.cid;" |
| 2568 | ); |
| 2569 | if( related==1 ){ |
| 2570 | db_multi_exec( |
| 2571 | "INSERT OR IGNORE INTO related_nodes\n" |
| 2572 | " SELECT cid FROM selected_nodes CROSS JOIN plink\n" |
| 2573 | " WHERE selected_nodes.rid=plink.pid;" |
| 2574 | ); |
| 2575 |