Fossil SCM
Add the "basic=1" query parameter to /timeline, to declutter the display.
Commit
5ec5a403ae74ffd5b7cbb84aa13ee746c52d543e9b0f03d169493737b76e2be9
Parent
77dfcc91edbc8bc…
1 file changed
+41
-15
+41
-15
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -103,10 +103,11 @@ | ||
| 103 | 103 | #define TIMELINE_UCOLOR 0x0080 /* Background color by user */ |
| 104 | 104 | #define TIMELINE_FRENAMES 0x0100 /* Detail only file name changes */ |
| 105 | 105 | #define TIMELINE_UNHIDE 0x0200 /* Unhide check-ins with "hidden" tag */ |
| 106 | 106 | #define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */ |
| 107 | 107 | #define TIMELINE_BISECT 0x0800 /* Show supplimental bisect information */ |
| 108 | +#define TIMELINE_BASIC 0x1000 /* Minimize clutter and distraction */ | |
| 108 | 109 | #endif |
| 109 | 110 | |
| 110 | 111 | /* |
| 111 | 112 | ** Hash a string and use the hash to determine a background color. |
| 112 | 113 | */ |
| @@ -264,11 +265,15 @@ | ||
| 264 | 265 | } |
| 265 | 266 | zPrevDate[0] = 0; |
| 266 | 267 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 267 | 268 | dateFormat = db_get_int("timeline-date-format", 0); |
| 268 | 269 | bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0); |
| 269 | - eCommentFormat = db_get_int("timeline-comment-format", 0); | |
| 270 | + if( tmFlags & TIMELINE_BASIC ){ | |
| 271 | + eCommentFormat = 5; /* Comment only */ | |
| 272 | + }else{ | |
| 273 | + eCommentFormat = db_get_int("timeline-comment-format", 0); | |
| 274 | + } | |
| 270 | 275 | bShowDetail = (eCommentFormat & 1)==0; /* Bit 0 suppresses the comment */ |
| 271 | 276 | bSeparateDetail = (eCommentFormat & 8)!=0; /* Bit 3 turns on the detail column */ |
| 272 | 277 | switch( (eCommentFormat>>1)&3 ){ |
| 273 | 278 | case 1: bHashAfterComment = 1; break; |
| 274 | 279 | case 2: bHashInDetail = 1; break; |
| @@ -1584,10 +1589,11 @@ | ||
| 1584 | 1589 | ** u=USER Only show items associated with USER |
| 1585 | 1590 | ** y=TYPE 'ci', 'w', 't', 'e', or (default) 'all' |
| 1586 | 1591 | ** ng No Graph. |
| 1587 | 1592 | ** nd Do not highlight the focus check-in |
| 1588 | 1593 | ** v Show details of files changed |
| 1594 | +** basic Minimum clutter and distraction | |
| 1589 | 1595 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1590 | 1596 | ** from=CHECKIN Path from... |
| 1591 | 1597 | ** to=CHECKIN ... to this |
| 1592 | 1598 | ** shortest ... show only the shortest path |
| 1593 | 1599 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| @@ -1640,10 +1646,11 @@ | ||
| 1640 | 1646 | const char *zChng = P("chng"); /* List of GLOBs for files that changed */ |
| 1641 | 1647 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1642 | 1648 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1643 | 1649 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1644 | 1650 | int bisectOnly = PB("bisect"); /* Show the check-ins of the bisect */ |
| 1651 | + int bBasic = PB("basic"); /* Minimize clutter and distraction */ | |
| 1645 | 1652 | int tmFlags = 0; /* Timeline flags */ |
| 1646 | 1653 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| 1647 | 1654 | const char *zThisUser = 0; /* Suppress links to this user */ |
| 1648 | 1655 | HQuery url; /* URL for various branch links */ |
| 1649 | 1656 | int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */ |
| @@ -1653,10 +1660,11 @@ | ||
| 1653 | 1660 | int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */ |
| 1654 | 1661 | int pd_rid; |
| 1655 | 1662 | double rBefore, rAfter, rCirca; /* Boundary times */ |
| 1656 | 1663 | const char *z; |
| 1657 | 1664 | char *zOlderButton = 0; /* URL for Older button at the bottom */ |
| 1665 | + char *zNewerButton = 0; /* URL for Newer button at the top */ | |
| 1658 | 1666 | int selectedRid = -9999999; /* Show a highlight on this RID */ |
| 1659 | 1667 | int disableY = 0; /* Disable type selector on submenu */ |
| 1660 | 1668 | |
| 1661 | 1669 | /* Set number of rows to display */ |
| 1662 | 1670 | z = P("n"); |
| @@ -1853,11 +1861,13 @@ | ||
| 1853 | 1861 | blob_append(&sql, ")", -1); |
| 1854 | 1862 | path_reset(); |
| 1855 | 1863 | addFileGlobExclusion(zChng, &sql); |
| 1856 | 1864 | tmFlags |= TIMELINE_DISJOINT; |
| 1857 | 1865 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1858 | - style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); | |
| 1866 | + if( !bBasic ){ | |
| 1867 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); | |
| 1868 | + } | |
| 1859 | 1869 | blob_appendf(&desc, "%d check-ins going from ", |
| 1860 | 1870 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1861 | 1871 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1862 | 1872 | blob_append(&desc, " to ", -1); |
| 1863 | 1873 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| @@ -1903,12 +1913,14 @@ | ||
| 1903 | 1913 | if( p_rid ){ |
| 1904 | 1914 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1905 | 1915 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1906 | 1916 | } |
| 1907 | 1917 | } |
| 1908 | - style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); | |
| 1909 | - style_submenu_entry("n","Max:",4,0); | |
| 1918 | + if( !bBasic ){ | |
| 1919 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); | |
| 1920 | + style_submenu_entry("n","Max:",4,0); | |
| 1921 | + } | |
| 1910 | 1922 | timeline_y_submenu(1); |
| 1911 | 1923 | }else if( f_rid && g.perm.Read ){ |
| 1912 | 1924 | /* If f= is present, ignore all other parameters other than n= */ |
| 1913 | 1925 | char *zUuid; |
| 1914 | 1926 | db_multi_exec( |
| @@ -1923,12 +1935,14 @@ | ||
| 1923 | 1935 | if( useDividers ) selectedRid = f_rid; |
| 1924 | 1936 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1925 | 1937 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1926 | 1938 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 1927 | 1939 | tmFlags |= TIMELINE_DISJOINT; |
| 1928 | - style_submenu_checkbox("unhide", "Unhide", 0, 0); | |
| 1929 | - style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); | |
| 1940 | + if( !bBasic ){ | |
| 1941 | + style_submenu_checkbox("unhide", "Unhide", 0, 0); | |
| 1942 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); | |
| 1943 | + } | |
| 1930 | 1944 | }else{ |
| 1931 | 1945 | /* Otherwise, a timeline based on a span of time */ |
| 1932 | 1946 | int n; |
| 1933 | 1947 | const char *zEType = "timeline item"; |
| 1934 | 1948 | char *zDate; |
| @@ -2187,11 +2201,11 @@ | ||
| 2187 | 2201 | if( db_int(0, |
| 2188 | 2202 | "SELECT EXISTS (SELECT 1 FROM event CROSS JOIN blob" |
| 2189 | 2203 | " WHERE blob.rid=event.objid AND mtime<=%.17g%s)", |
| 2190 | 2204 | rDate-ONE_SECOND, blob_sql_text(&cond)) |
| 2191 | 2205 | ){ |
| 2192 | - timeline_submenu(&url, "Older", "b", zDate, "a"); | |
| 2206 | + /* timeline_submenu(&url, "Older", "b", zDate, "a"); */ | |
| 2193 | 2207 | zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "a", 0)); |
| 2194 | 2208 | } |
| 2195 | 2209 | free(zDate); |
| 2196 | 2210 | } |
| 2197 | 2211 | zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/"); |
| @@ -2203,25 +2217,33 @@ | ||
| 2203 | 2217 | if( db_int(0, |
| 2204 | 2218 | "SELECT EXISTS (SELECT 1 FROM event CROSS JOIN blob" |
| 2205 | 2219 | " WHERE blob.rid=event.objid AND mtime>=%.17g%s)", |
| 2206 | 2220 | rDate+ONE_SECOND, blob_sql_text(&cond)) |
| 2207 | 2221 | ){ |
| 2208 | - timeline_submenu(&url, "Newer", "a", zDate, "b"); | |
| 2222 | + /* timeline_submenu(&url, "Newer", "a", zDate, "b"); */ | |
| 2223 | + zNewerButton = fossil_strdup(url_render(&url, "a", zDate, "b", 0)); | |
| 2209 | 2224 | } |
| 2210 | 2225 | free(zDate); |
| 2211 | 2226 | } |
| 2212 | - if( zType[0]=='a' || zType[0]=='c' ){ | |
| 2213 | - style_submenu_checkbox("unhide", "Unhide", 0, 0); | |
| 2227 | + if( !bBasic ){ | |
| 2228 | + if( zType[0]=='a' || zType[0]=='c' ){ | |
| 2229 | + style_submenu_checkbox("unhide", "Unhide", 0, 0); | |
| 2230 | + } | |
| 2231 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); | |
| 2232 | + style_submenu_entry("n","Max:",4,0); | |
| 2214 | 2233 | } |
| 2215 | - style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); | |
| 2216 | - style_submenu_entry("n","Max:",4,0); | |
| 2217 | 2234 | timeline_y_submenu(disableY); |
| 2218 | - style_submenu_entry("t", "Tag Filter:", -8, 0); | |
| 2219 | - style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0); | |
| 2235 | + if( !bBasic ){ | |
| 2236 | + style_submenu_entry("t", "Tag Filter:", -8, 0); | |
| 2237 | + style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0); | |
| 2238 | + } | |
| 2220 | 2239 | } |
| 2221 | 2240 | blob_zero(&cond); |
| 2222 | 2241 | } |
| 2242 | + if( bBasic ){ | |
| 2243 | + timeline_submenu(&url, "Advanced", "basic", "0", 0); | |
| 2244 | + } | |
| 2223 | 2245 | if( PB("showsql") ){ |
| 2224 | 2246 | @ <pre>%h(blob_sql_text(&sql))</pre> |
| 2225 | 2247 | } |
| 2226 | 2248 | if( search_restrict(SRCH_CKIN)!=0 ){ |
| 2227 | 2249 | style_submenu_element("Search", "%R/search?y=c"); |
| @@ -2238,15 +2260,19 @@ | ||
| 2238 | 2260 | |
| 2239 | 2261 | /* Report any errors. */ |
| 2240 | 2262 | if( zError ){ |
| 2241 | 2263 | @ <p class="generalError">%h(zError)</p> |
| 2242 | 2264 | } |
| 2265 | + if( bBasic ) tmFlags |= TIMELINE_BASIC; | |
| 2243 | 2266 | |
| 2267 | + if( zNewerButton ){ | |
| 2268 | + @ %z(xhref("class='button'","%z",zNewerButton))More ↑</a> | |
| 2269 | + } | |
| 2244 | 2270 | www_print_timeline(&q, tmFlags, zThisUser, zThisTag, selectedRid, 0); |
| 2245 | 2271 | db_finalize(&q); |
| 2246 | 2272 | if( zOlderButton ){ |
| 2247 | - @ %z(xhref("class='button'","%z",zOlderButton))Older</a> | |
| 2273 | + @ %z(xhref("class='button'","%z",zOlderButton))More ↓</a> | |
| 2248 | 2274 | } |
| 2249 | 2275 | style_footer(); |
| 2250 | 2276 | } |
| 2251 | 2277 | |
| 2252 | 2278 | /* |
| 2253 | 2279 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -103,10 +103,11 @@ | |
| 103 | #define TIMELINE_UCOLOR 0x0080 /* Background color by user */ |
| 104 | #define TIMELINE_FRENAMES 0x0100 /* Detail only file name changes */ |
| 105 | #define TIMELINE_UNHIDE 0x0200 /* Unhide check-ins with "hidden" tag */ |
| 106 | #define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */ |
| 107 | #define TIMELINE_BISECT 0x0800 /* Show supplimental bisect information */ |
| 108 | #endif |
| 109 | |
| 110 | /* |
| 111 | ** Hash a string and use the hash to determine a background color. |
| 112 | */ |
| @@ -264,11 +265,15 @@ | |
| 264 | } |
| 265 | zPrevDate[0] = 0; |
| 266 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 267 | dateFormat = db_get_int("timeline-date-format", 0); |
| 268 | bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0); |
| 269 | eCommentFormat = db_get_int("timeline-comment-format", 0); |
| 270 | bShowDetail = (eCommentFormat & 1)==0; /* Bit 0 suppresses the comment */ |
| 271 | bSeparateDetail = (eCommentFormat & 8)!=0; /* Bit 3 turns on the detail column */ |
| 272 | switch( (eCommentFormat>>1)&3 ){ |
| 273 | case 1: bHashAfterComment = 1; break; |
| 274 | case 2: bHashInDetail = 1; break; |
| @@ -1584,10 +1589,11 @@ | |
| 1584 | ** u=USER Only show items associated with USER |
| 1585 | ** y=TYPE 'ci', 'w', 't', 'e', or (default) 'all' |
| 1586 | ** ng No Graph. |
| 1587 | ** nd Do not highlight the focus check-in |
| 1588 | ** v Show details of files changed |
| 1589 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1590 | ** from=CHECKIN Path from... |
| 1591 | ** to=CHECKIN ... to this |
| 1592 | ** shortest ... show only the shortest path |
| 1593 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| @@ -1640,10 +1646,11 @@ | |
| 1640 | const char *zChng = P("chng"); /* List of GLOBs for files that changed */ |
| 1641 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1642 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1643 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1644 | int bisectOnly = PB("bisect"); /* Show the check-ins of the bisect */ |
| 1645 | int tmFlags = 0; /* Timeline flags */ |
| 1646 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| 1647 | const char *zThisUser = 0; /* Suppress links to this user */ |
| 1648 | HQuery url; /* URL for various branch links */ |
| 1649 | int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */ |
| @@ -1653,10 +1660,11 @@ | |
| 1653 | int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */ |
| 1654 | int pd_rid; |
| 1655 | double rBefore, rAfter, rCirca; /* Boundary times */ |
| 1656 | const char *z; |
| 1657 | char *zOlderButton = 0; /* URL for Older button at the bottom */ |
| 1658 | int selectedRid = -9999999; /* Show a highlight on this RID */ |
| 1659 | int disableY = 0; /* Disable type selector on submenu */ |
| 1660 | |
| 1661 | /* Set number of rows to display */ |
| 1662 | z = P("n"); |
| @@ -1853,11 +1861,13 @@ | |
| 1853 | blob_append(&sql, ")", -1); |
| 1854 | path_reset(); |
| 1855 | addFileGlobExclusion(zChng, &sql); |
| 1856 | tmFlags |= TIMELINE_DISJOINT; |
| 1857 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1858 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); |
| 1859 | blob_appendf(&desc, "%d check-ins going from ", |
| 1860 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1861 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1862 | blob_append(&desc, " to ", -1); |
| 1863 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| @@ -1903,12 +1913,14 @@ | |
| 1903 | if( p_rid ){ |
| 1904 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1905 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1906 | } |
| 1907 | } |
| 1908 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); |
| 1909 | style_submenu_entry("n","Max:",4,0); |
| 1910 | timeline_y_submenu(1); |
| 1911 | }else if( f_rid && g.perm.Read ){ |
| 1912 | /* If f= is present, ignore all other parameters other than n= */ |
| 1913 | char *zUuid; |
| 1914 | db_multi_exec( |
| @@ -1923,12 +1935,14 @@ | |
| 1923 | if( useDividers ) selectedRid = f_rid; |
| 1924 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1925 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1926 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 1927 | tmFlags |= TIMELINE_DISJOINT; |
| 1928 | style_submenu_checkbox("unhide", "Unhide", 0, 0); |
| 1929 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); |
| 1930 | }else{ |
| 1931 | /* Otherwise, a timeline based on a span of time */ |
| 1932 | int n; |
| 1933 | const char *zEType = "timeline item"; |
| 1934 | char *zDate; |
| @@ -2187,11 +2201,11 @@ | |
| 2187 | if( db_int(0, |
| 2188 | "SELECT EXISTS (SELECT 1 FROM event CROSS JOIN blob" |
| 2189 | " WHERE blob.rid=event.objid AND mtime<=%.17g%s)", |
| 2190 | rDate-ONE_SECOND, blob_sql_text(&cond)) |
| 2191 | ){ |
| 2192 | timeline_submenu(&url, "Older", "b", zDate, "a"); |
| 2193 | zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "a", 0)); |
| 2194 | } |
| 2195 | free(zDate); |
| 2196 | } |
| 2197 | zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/"); |
| @@ -2203,25 +2217,33 @@ | |
| 2203 | if( db_int(0, |
| 2204 | "SELECT EXISTS (SELECT 1 FROM event CROSS JOIN blob" |
| 2205 | " WHERE blob.rid=event.objid AND mtime>=%.17g%s)", |
| 2206 | rDate+ONE_SECOND, blob_sql_text(&cond)) |
| 2207 | ){ |
| 2208 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 2209 | } |
| 2210 | free(zDate); |
| 2211 | } |
| 2212 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 2213 | style_submenu_checkbox("unhide", "Unhide", 0, 0); |
| 2214 | } |
| 2215 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); |
| 2216 | style_submenu_entry("n","Max:",4,0); |
| 2217 | timeline_y_submenu(disableY); |
| 2218 | style_submenu_entry("t", "Tag Filter:", -8, 0); |
| 2219 | style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0); |
| 2220 | } |
| 2221 | blob_zero(&cond); |
| 2222 | } |
| 2223 | if( PB("showsql") ){ |
| 2224 | @ <pre>%h(blob_sql_text(&sql))</pre> |
| 2225 | } |
| 2226 | if( search_restrict(SRCH_CKIN)!=0 ){ |
| 2227 | style_submenu_element("Search", "%R/search?y=c"); |
| @@ -2238,15 +2260,19 @@ | |
| 2238 | |
| 2239 | /* Report any errors. */ |
| 2240 | if( zError ){ |
| 2241 | @ <p class="generalError">%h(zError)</p> |
| 2242 | } |
| 2243 | |
| 2244 | www_print_timeline(&q, tmFlags, zThisUser, zThisTag, selectedRid, 0); |
| 2245 | db_finalize(&q); |
| 2246 | if( zOlderButton ){ |
| 2247 | @ %z(xhref("class='button'","%z",zOlderButton))Older</a> |
| 2248 | } |
| 2249 | style_footer(); |
| 2250 | } |
| 2251 | |
| 2252 | /* |
| 2253 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -103,10 +103,11 @@ | |
| 103 | #define TIMELINE_UCOLOR 0x0080 /* Background color by user */ |
| 104 | #define TIMELINE_FRENAMES 0x0100 /* Detail only file name changes */ |
| 105 | #define TIMELINE_UNHIDE 0x0200 /* Unhide check-ins with "hidden" tag */ |
| 106 | #define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */ |
| 107 | #define TIMELINE_BISECT 0x0800 /* Show supplimental bisect information */ |
| 108 | #define TIMELINE_BASIC 0x1000 /* Minimize clutter and distraction */ |
| 109 | #endif |
| 110 | |
| 111 | /* |
| 112 | ** Hash a string and use the hash to determine a background color. |
| 113 | */ |
| @@ -264,11 +265,15 @@ | |
| 265 | } |
| 266 | zPrevDate[0] = 0; |
| 267 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 268 | dateFormat = db_get_int("timeline-date-format", 0); |
| 269 | bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0); |
| 270 | if( tmFlags & TIMELINE_BASIC ){ |
| 271 | eCommentFormat = 5; /* Comment only */ |
| 272 | }else{ |
| 273 | eCommentFormat = db_get_int("timeline-comment-format", 0); |
| 274 | } |
| 275 | bShowDetail = (eCommentFormat & 1)==0; /* Bit 0 suppresses the comment */ |
| 276 | bSeparateDetail = (eCommentFormat & 8)!=0; /* Bit 3 turns on the detail column */ |
| 277 | switch( (eCommentFormat>>1)&3 ){ |
| 278 | case 1: bHashAfterComment = 1; break; |
| 279 | case 2: bHashInDetail = 1; break; |
| @@ -1584,10 +1589,11 @@ | |
| 1589 | ** u=USER Only show items associated with USER |
| 1590 | ** y=TYPE 'ci', 'w', 't', 'e', or (default) 'all' |
| 1591 | ** ng No Graph. |
| 1592 | ** nd Do not highlight the focus check-in |
| 1593 | ** v Show details of files changed |
| 1594 | ** basic Minimum clutter and distraction |
| 1595 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1596 | ** from=CHECKIN Path from... |
| 1597 | ** to=CHECKIN ... to this |
| 1598 | ** shortest ... show only the shortest path |
| 1599 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| @@ -1640,10 +1646,11 @@ | |
| 1646 | const char *zChng = P("chng"); /* List of GLOBs for files that changed */ |
| 1647 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1648 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1649 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1650 | int bisectOnly = PB("bisect"); /* Show the check-ins of the bisect */ |
| 1651 | int bBasic = PB("basic"); /* Minimize clutter and distraction */ |
| 1652 | int tmFlags = 0; /* Timeline flags */ |
| 1653 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| 1654 | const char *zThisUser = 0; /* Suppress links to this user */ |
| 1655 | HQuery url; /* URL for various branch links */ |
| 1656 | int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */ |
| @@ -1653,10 +1660,11 @@ | |
| 1660 | int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */ |
| 1661 | int pd_rid; |
| 1662 | double rBefore, rAfter, rCirca; /* Boundary times */ |
| 1663 | const char *z; |
| 1664 | char *zOlderButton = 0; /* URL for Older button at the bottom */ |
| 1665 | char *zNewerButton = 0; /* URL for Newer button at the top */ |
| 1666 | int selectedRid = -9999999; /* Show a highlight on this RID */ |
| 1667 | int disableY = 0; /* Disable type selector on submenu */ |
| 1668 | |
| 1669 | /* Set number of rows to display */ |
| 1670 | z = P("n"); |
| @@ -1853,11 +1861,13 @@ | |
| 1861 | blob_append(&sql, ")", -1); |
| 1862 | path_reset(); |
| 1863 | addFileGlobExclusion(zChng, &sql); |
| 1864 | tmFlags |= TIMELINE_DISJOINT; |
| 1865 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1866 | if( !bBasic ){ |
| 1867 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); |
| 1868 | } |
| 1869 | blob_appendf(&desc, "%d check-ins going from ", |
| 1870 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1871 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1872 | blob_append(&desc, " to ", -1); |
| 1873 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| @@ -1903,12 +1913,14 @@ | |
| 1913 | if( p_rid ){ |
| 1914 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1915 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1916 | } |
| 1917 | } |
| 1918 | if( !bBasic ){ |
| 1919 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); |
| 1920 | style_submenu_entry("n","Max:",4,0); |
| 1921 | } |
| 1922 | timeline_y_submenu(1); |
| 1923 | }else if( f_rid && g.perm.Read ){ |
| 1924 | /* If f= is present, ignore all other parameters other than n= */ |
| 1925 | char *zUuid; |
| 1926 | db_multi_exec( |
| @@ -1923,12 +1935,14 @@ | |
| 1935 | if( useDividers ) selectedRid = f_rid; |
| 1936 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1937 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1938 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 1939 | tmFlags |= TIMELINE_DISJOINT; |
| 1940 | if( !bBasic ){ |
| 1941 | style_submenu_checkbox("unhide", "Unhide", 0, 0); |
| 1942 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); |
| 1943 | } |
| 1944 | }else{ |
| 1945 | /* Otherwise, a timeline based on a span of time */ |
| 1946 | int n; |
| 1947 | const char *zEType = "timeline item"; |
| 1948 | char *zDate; |
| @@ -2187,11 +2201,11 @@ | |
| 2201 | if( db_int(0, |
| 2202 | "SELECT EXISTS (SELECT 1 FROM event CROSS JOIN blob" |
| 2203 | " WHERE blob.rid=event.objid AND mtime<=%.17g%s)", |
| 2204 | rDate-ONE_SECOND, blob_sql_text(&cond)) |
| 2205 | ){ |
| 2206 | /* timeline_submenu(&url, "Older", "b", zDate, "a"); */ |
| 2207 | zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "a", 0)); |
| 2208 | } |
| 2209 | free(zDate); |
| 2210 | } |
| 2211 | zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/"); |
| @@ -2203,25 +2217,33 @@ | |
| 2217 | if( db_int(0, |
| 2218 | "SELECT EXISTS (SELECT 1 FROM event CROSS JOIN blob" |
| 2219 | " WHERE blob.rid=event.objid AND mtime>=%.17g%s)", |
| 2220 | rDate+ONE_SECOND, blob_sql_text(&cond)) |
| 2221 | ){ |
| 2222 | /* timeline_submenu(&url, "Newer", "a", zDate, "b"); */ |
| 2223 | zNewerButton = fossil_strdup(url_render(&url, "a", zDate, "b", 0)); |
| 2224 | } |
| 2225 | free(zDate); |
| 2226 | } |
| 2227 | if( !bBasic ){ |
| 2228 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 2229 | style_submenu_checkbox("unhide", "Unhide", 0, 0); |
| 2230 | } |
| 2231 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c', 0); |
| 2232 | style_submenu_entry("n","Max:",4,0); |
| 2233 | } |
| 2234 | timeline_y_submenu(disableY); |
| 2235 | if( !bBasic ){ |
| 2236 | style_submenu_entry("t", "Tag Filter:", -8, 0); |
| 2237 | style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0); |
| 2238 | } |
| 2239 | } |
| 2240 | blob_zero(&cond); |
| 2241 | } |
| 2242 | if( bBasic ){ |
| 2243 | timeline_submenu(&url, "Advanced", "basic", "0", 0); |
| 2244 | } |
| 2245 | if( PB("showsql") ){ |
| 2246 | @ <pre>%h(blob_sql_text(&sql))</pre> |
| 2247 | } |
| 2248 | if( search_restrict(SRCH_CKIN)!=0 ){ |
| 2249 | style_submenu_element("Search", "%R/search?y=c"); |
| @@ -2238,15 +2260,19 @@ | |
| 2260 | |
| 2261 | /* Report any errors. */ |
| 2262 | if( zError ){ |
| 2263 | @ <p class="generalError">%h(zError)</p> |
| 2264 | } |
| 2265 | if( bBasic ) tmFlags |= TIMELINE_BASIC; |
| 2266 | |
| 2267 | if( zNewerButton ){ |
| 2268 | @ %z(xhref("class='button'","%z",zNewerButton))More ↑</a> |
| 2269 | } |
| 2270 | www_print_timeline(&q, tmFlags, zThisUser, zThisTag, selectedRid, 0); |
| 2271 | db_finalize(&q); |
| 2272 | if( zOlderButton ){ |
| 2273 | @ %z(xhref("class='button'","%z",zOlderButton))More ↓</a> |
| 2274 | } |
| 2275 | style_footer(); |
| 2276 | } |
| 2277 | |
| 2278 | /* |
| 2279 |