Fossil SCM

Add the ymd= query parameter to the /timeline page.

drh 2015-10-12 12:12 trunk
Commit 16ce7ef0c5e8aa9d3c57a887d5452303c0ec816d
1 file changed +9 -1
+9 -1
--- src/timeline.c
+++ src/timeline.c
@@ -1191,11 +1191,12 @@
11911191
** uf=FUUID Show only check-ins that use given file version
11921192
** brbg Background color from branch name
11931193
** ubg Background color from user
11941194
** namechng Show only check-ins that filename changes
11951195
** forks Show only forks and their children
1196
-** ym=YYYY-MM Shown only events for the given year/month.
1196
+** ym=YYYY-MM Show only events for the given year/month.
1197
+** ymd=YYYY-MM-DD Show only events on the given day
11971198
** datefmt=N Override the date format
11981199
**
11991200
** p= and d= can appear individually or together. If either p= or d=
12001201
** appear, then u=, y=, a=, and b= are ignored.
12011202
**
@@ -1222,10 +1223,11 @@
12221223
const char *zBrName = P("r"); /* Show events related to this tag */
12231224
const char *zSearch = P("s"); /* Search string */
12241225
const char *zUses = P("uf"); /* Only show check-ins hold this file */
12251226
const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */
12261227
const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */
1228
+ const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */
12271229
int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */
12281230
int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */
12291231
int forkOnly = PB("forks"); /* Show only forks and their children */
12301232
int tagid; /* Tag ID */
12311233
int tmFlags = 0; /* Timeline flags */
@@ -1492,10 +1494,14 @@
14921494
}
14931495
else if( zYearWeek ){
14941496
blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%W',event.mtime) ",
14951497
zYearWeek);
14961498
}
1499
+ else if( zDay ){
1500
+ blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%m-%%d',event.mtime) ",
1501
+ zDay);
1502
+ }
14971503
if( tagid ){
14981504
blob_append_sql(&sql,
14991505
" AND (EXISTS(SELECT 1 FROM tagxref"
15001506
" WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", tagid);
15011507
@@ -1641,10 +1647,12 @@
16411647
n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div' /*scan*/");
16421648
if( zYearMonth ){
16431649
blob_appendf(&desc, "%s events for %h", zEType, zYearMonth);
16441650
}else if( zYearWeek ){
16451651
blob_appendf(&desc, "%s events for year/week %h", zEType, zYearWeek);
1652
+ }else if( zDay ){
1653
+ blob_appendf(&desc, "%s events occurring on %h", zEType, zDay);
16461654
}else if( zBefore==0 && zCirca==0 && n>=nEntry && nEntry>0 ){
16471655
blob_appendf(&desc, "%d most recent %ss", n, zEType);
16481656
}else{
16491657
blob_appendf(&desc, "%d %ss", n, zEType);
16501658
}
16511659
--- src/timeline.c
+++ src/timeline.c
@@ -1191,11 +1191,12 @@
1191 ** uf=FUUID Show only check-ins that use given file version
1192 ** brbg Background color from branch name
1193 ** ubg Background color from user
1194 ** namechng Show only check-ins that filename changes
1195 ** forks Show only forks and their children
1196 ** ym=YYYY-MM Shown only events for the given year/month.
 
1197 ** datefmt=N Override the date format
1198 **
1199 ** p= and d= can appear individually or together. If either p= or d=
1200 ** appear, then u=, y=, a=, and b= are ignored.
1201 **
@@ -1222,10 +1223,11 @@
1222 const char *zBrName = P("r"); /* Show events related to this tag */
1223 const char *zSearch = P("s"); /* Search string */
1224 const char *zUses = P("uf"); /* Only show check-ins hold this file */
1225 const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */
1226 const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */
 
1227 int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */
1228 int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */
1229 int forkOnly = PB("forks"); /* Show only forks and their children */
1230 int tagid; /* Tag ID */
1231 int tmFlags = 0; /* Timeline flags */
@@ -1492,10 +1494,14 @@
1492 }
1493 else if( zYearWeek ){
1494 blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%W',event.mtime) ",
1495 zYearWeek);
1496 }
 
 
 
 
1497 if( tagid ){
1498 blob_append_sql(&sql,
1499 " AND (EXISTS(SELECT 1 FROM tagxref"
1500 " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", tagid);
1501
@@ -1641,10 +1647,12 @@
1641 n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div' /*scan*/");
1642 if( zYearMonth ){
1643 blob_appendf(&desc, "%s events for %h", zEType, zYearMonth);
1644 }else if( zYearWeek ){
1645 blob_appendf(&desc, "%s events for year/week %h", zEType, zYearWeek);
 
 
1646 }else if( zBefore==0 && zCirca==0 && n>=nEntry && nEntry>0 ){
1647 blob_appendf(&desc, "%d most recent %ss", n, zEType);
1648 }else{
1649 blob_appendf(&desc, "%d %ss", n, zEType);
1650 }
1651
--- src/timeline.c
+++ src/timeline.c
@@ -1191,11 +1191,12 @@
1191 ** uf=FUUID Show only check-ins that use given file version
1192 ** brbg Background color from branch name
1193 ** ubg Background color from user
1194 ** namechng Show only check-ins that filename changes
1195 ** forks Show only forks and their children
1196 ** ym=YYYY-MM Show only events for the given year/month.
1197 ** ymd=YYYY-MM-DD Show only events on the given day
1198 ** datefmt=N Override the date format
1199 **
1200 ** p= and d= can appear individually or together. If either p= or d=
1201 ** appear, then u=, y=, a=, and b= are ignored.
1202 **
@@ -1222,10 +1223,11 @@
1223 const char *zBrName = P("r"); /* Show events related to this tag */
1224 const char *zSearch = P("s"); /* Search string */
1225 const char *zUses = P("uf"); /* Only show check-ins hold this file */
1226 const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */
1227 const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */
1228 const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */
1229 int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */
1230 int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */
1231 int forkOnly = PB("forks"); /* Show only forks and their children */
1232 int tagid; /* Tag ID */
1233 int tmFlags = 0; /* Timeline flags */
@@ -1492,10 +1494,14 @@
1494 }
1495 else if( zYearWeek ){
1496 blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%W',event.mtime) ",
1497 zYearWeek);
1498 }
1499 else if( zDay ){
1500 blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%m-%%d',event.mtime) ",
1501 zDay);
1502 }
1503 if( tagid ){
1504 blob_append_sql(&sql,
1505 " AND (EXISTS(SELECT 1 FROM tagxref"
1506 " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", tagid);
1507
@@ -1641,10 +1647,12 @@
1647 n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div' /*scan*/");
1648 if( zYearMonth ){
1649 blob_appendf(&desc, "%s events for %h", zEType, zYearMonth);
1650 }else if( zYearWeek ){
1651 blob_appendf(&desc, "%s events for year/week %h", zEType, zYearWeek);
1652 }else if( zDay ){
1653 blob_appendf(&desc, "%s events occurring on %h", zEType, zDay);
1654 }else if( zBefore==0 && zCirca==0 && n>=nEntry && nEntry>0 ){
1655 blob_appendf(&desc, "%d most recent %ss", n, zEType);
1656 }else{
1657 blob_appendf(&desc, "%d %ss", n, zEType);
1658 }
1659

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button