Fossil SCM
Add the days= query parameter to /timeline
Commit
cd11e359d3034df48171c3478e56e6dce57ef4eac04542a5d036a9be9aed2b1b
Parent
adbebbd1e815944…
1 file changed
+12
+12
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1373,10 +1373,11 @@ | ||
| 1373 | 1373 | ** namechng Show only check-ins that have filename changes |
| 1374 | 1374 | ** forks Show only forks and their children |
| 1375 | 1375 | ** ym=YYYY-MM Show only events for the given year/month |
| 1376 | 1376 | ** yw=YYYY-WW Show only events for the given week of the given year |
| 1377 | 1377 | ** ymd=YYYY-MM-DD Show only events on the given day |
| 1378 | +** days=N Show events over the previous N days | |
| 1378 | 1379 | ** datefmt=N Override the date format |
| 1379 | 1380 | ** bisect Show the check-ins that are in the current bisect |
| 1380 | 1381 | ** showid Show RIDs |
| 1381 | 1382 | ** showsql Show the SQL text |
| 1382 | 1383 | ** |
| @@ -1414,10 +1415,12 @@ | ||
| 1414 | 1415 | const char *zUses = P("uf"); /* Only show check-ins hold this file */ |
| 1415 | 1416 | const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */ |
| 1416 | 1417 | const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */ |
| 1417 | 1418 | char *zYearWeekStart = 0; /* YYYY-MM-DD for start of YYYY-WW */ |
| 1418 | 1419 | const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */ |
| 1420 | + const char *zNDays = P("days"); /* Show events over the previous N days */ | |
| 1421 | + int nDays; /* Numeric value for zNDays */ | |
| 1419 | 1422 | const char *zChng = P("chng"); /* List of GLOBs for files that changed */ |
| 1420 | 1423 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1421 | 1424 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1422 | 1425 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1423 | 1426 | int bisectOnly = PB("bisect"); /* Show the check-ins of the bisect */ |
| @@ -1786,10 +1789,16 @@ | ||
| 1786 | 1789 | zDay = db_text(0, "SELECT date('now')"); |
| 1787 | 1790 | } |
| 1788 | 1791 | blob_append_sql(&cond, " AND %Q=date(event.mtime) ", |
| 1789 | 1792 | zDay); |
| 1790 | 1793 | } |
| 1794 | + else if( zNDays ){ | |
| 1795 | + nDays = atoi(zNDays); | |
| 1796 | + if( nDays<1 ) nDays = 1; | |
| 1797 | + blob_append_sql(&cond, " AND event.mtime>=julianday('now','-%d days') ", | |
| 1798 | + nDays); | |
| 1799 | + } | |
| 1791 | 1800 | if( zTagSql ){ |
| 1792 | 1801 | blob_append_sql(&cond, |
| 1793 | 1802 | " AND (EXISTS(SELECT 1 FROM tagxref NATURAL JOIN tag" |
| 1794 | 1803 | " WHERE %s AND tagtype>0 AND rid=blob.rid)\n", zTagSql/*safe-for-%s*/); |
| 1795 | 1804 | |
| @@ -1939,10 +1948,13 @@ | ||
| 1939 | 1948 | }else if( zYearWeek ){ |
| 1940 | 1949 | blob_appendf(&desc, "%ss for week %h beginning on %h", |
| 1941 | 1950 | zEType, zYearWeek, zYearWeekStart); |
| 1942 | 1951 | }else if( zDay ){ |
| 1943 | 1952 | blob_appendf(&desc, "%ss occurring on %h", zEType, zDay); |
| 1953 | + }else if( zNDays ){ | |
| 1954 | + blob_appendf(&desc, "%ss with the past %d day%s", | |
| 1955 | + zEType, nDays, nDays>1 ? "s" : ""); | |
| 1944 | 1956 | }else if( zBefore==0 && zCirca==0 && n>=nEntry && nEntry>0 ){ |
| 1945 | 1957 | blob_appendf(&desc, "%d most recent %ss", n, zEType); |
| 1946 | 1958 | }else{ |
| 1947 | 1959 | blob_appendf(&desc, "%d %ss", n, zEType); |
| 1948 | 1960 | } |
| 1949 | 1961 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1373,10 +1373,11 @@ | |
| 1373 | ** namechng Show only check-ins that have filename changes |
| 1374 | ** forks Show only forks and their children |
| 1375 | ** ym=YYYY-MM Show only events for the given year/month |
| 1376 | ** yw=YYYY-WW Show only events for the given week of the given year |
| 1377 | ** ymd=YYYY-MM-DD Show only events on the given day |
| 1378 | ** datefmt=N Override the date format |
| 1379 | ** bisect Show the check-ins that are in the current bisect |
| 1380 | ** showid Show RIDs |
| 1381 | ** showsql Show the SQL text |
| 1382 | ** |
| @@ -1414,10 +1415,12 @@ | |
| 1414 | const char *zUses = P("uf"); /* Only show check-ins hold this file */ |
| 1415 | const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */ |
| 1416 | const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */ |
| 1417 | char *zYearWeekStart = 0; /* YYYY-MM-DD for start of YYYY-WW */ |
| 1418 | const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */ |
| 1419 | const char *zChng = P("chng"); /* List of GLOBs for files that changed */ |
| 1420 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1421 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1422 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1423 | int bisectOnly = PB("bisect"); /* Show the check-ins of the bisect */ |
| @@ -1786,10 +1789,16 @@ | |
| 1786 | zDay = db_text(0, "SELECT date('now')"); |
| 1787 | } |
| 1788 | blob_append_sql(&cond, " AND %Q=date(event.mtime) ", |
| 1789 | zDay); |
| 1790 | } |
| 1791 | if( zTagSql ){ |
| 1792 | blob_append_sql(&cond, |
| 1793 | " AND (EXISTS(SELECT 1 FROM tagxref NATURAL JOIN tag" |
| 1794 | " WHERE %s AND tagtype>0 AND rid=blob.rid)\n", zTagSql/*safe-for-%s*/); |
| 1795 | |
| @@ -1939,10 +1948,13 @@ | |
| 1939 | }else if( zYearWeek ){ |
| 1940 | blob_appendf(&desc, "%ss for week %h beginning on %h", |
| 1941 | zEType, zYearWeek, zYearWeekStart); |
| 1942 | }else if( zDay ){ |
| 1943 | blob_appendf(&desc, "%ss occurring on %h", zEType, zDay); |
| 1944 | }else if( zBefore==0 && zCirca==0 && n>=nEntry && nEntry>0 ){ |
| 1945 | blob_appendf(&desc, "%d most recent %ss", n, zEType); |
| 1946 | }else{ |
| 1947 | blob_appendf(&desc, "%d %ss", n, zEType); |
| 1948 | } |
| 1949 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1373,10 +1373,11 @@ | |
| 1373 | ** namechng Show only check-ins that have filename changes |
| 1374 | ** forks Show only forks and their children |
| 1375 | ** ym=YYYY-MM Show only events for the given year/month |
| 1376 | ** yw=YYYY-WW Show only events for the given week of the given year |
| 1377 | ** ymd=YYYY-MM-DD Show only events on the given day |
| 1378 | ** days=N Show events over the previous N days |
| 1379 | ** datefmt=N Override the date format |
| 1380 | ** bisect Show the check-ins that are in the current bisect |
| 1381 | ** showid Show RIDs |
| 1382 | ** showsql Show the SQL text |
| 1383 | ** |
| @@ -1414,10 +1415,12 @@ | |
| 1415 | const char *zUses = P("uf"); /* Only show check-ins hold this file */ |
| 1416 | const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */ |
| 1417 | const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */ |
| 1418 | char *zYearWeekStart = 0; /* YYYY-MM-DD for start of YYYY-WW */ |
| 1419 | const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */ |
| 1420 | const char *zNDays = P("days"); /* Show events over the previous N days */ |
| 1421 | int nDays; /* Numeric value for zNDays */ |
| 1422 | const char *zChng = P("chng"); /* List of GLOBs for files that changed */ |
| 1423 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1424 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1425 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1426 | int bisectOnly = PB("bisect"); /* Show the check-ins of the bisect */ |
| @@ -1786,10 +1789,16 @@ | |
| 1789 | zDay = db_text(0, "SELECT date('now')"); |
| 1790 | } |
| 1791 | blob_append_sql(&cond, " AND %Q=date(event.mtime) ", |
| 1792 | zDay); |
| 1793 | } |
| 1794 | else if( zNDays ){ |
| 1795 | nDays = atoi(zNDays); |
| 1796 | if( nDays<1 ) nDays = 1; |
| 1797 | blob_append_sql(&cond, " AND event.mtime>=julianday('now','-%d days') ", |
| 1798 | nDays); |
| 1799 | } |
| 1800 | if( zTagSql ){ |
| 1801 | blob_append_sql(&cond, |
| 1802 | " AND (EXISTS(SELECT 1 FROM tagxref NATURAL JOIN tag" |
| 1803 | " WHERE %s AND tagtype>0 AND rid=blob.rid)\n", zTagSql/*safe-for-%s*/); |
| 1804 | |
| @@ -1939,10 +1948,13 @@ | |
| 1948 | }else if( zYearWeek ){ |
| 1949 | blob_appendf(&desc, "%ss for week %h beginning on %h", |
| 1950 | zEType, zYearWeek, zYearWeekStart); |
| 1951 | }else if( zDay ){ |
| 1952 | blob_appendf(&desc, "%ss occurring on %h", zEType, zDay); |
| 1953 | }else if( zNDays ){ |
| 1954 | blob_appendf(&desc, "%ss with the past %d day%s", |
| 1955 | zEType, nDays, nDays>1 ? "s" : ""); |
| 1956 | }else if( zBefore==0 && zCirca==0 && n>=nEntry && nEntry>0 ){ |
| 1957 | blob_appendf(&desc, "%d most recent %ss", n, zEType); |
| 1958 | }else{ |
| 1959 | blob_appendf(&desc, "%d %ss", n, zEType); |
| 1960 | } |
| 1961 |