Fossil SCM

Expand the allowed date/time format for the "a=" and "b=" query parameters to the /finfo page, so that it is compatible with /timeline.

drh 2020-10-15 14:59 trunk
Commit 04ef2df613c2126e1eb2091ab061a2fe313d45e4b682eaa65c0326c8f9f513d4
1 file changed +15 -15
+15 -15
--- src/finfo.c
+++ src/finfo.c
@@ -277,25 +277,23 @@
277277
**
278278
** Show the change history for a single file.
279279
**
280280
** Additional query parameters:
281281
**
282
-** a=DATETIME Only show changes after DATETIME
283
-** b=DATETIME Only show changes before DATETIME
284
-** m=HASH Mark this particular file version
285
-** n=NUM Show the first NUM changes only
286
-** brbg Background color by branch name
287
-** ubg Background color by user name
288
-** ci=HASH Ancestors of a particular check-in
289
-** orig=HASH If both ci and orig are supplied, only show those
282
+** a=DATETIME Only show changes after DATETIME
283
+** b=DATETIME Only show changes before DATETIME
284
+** m=HASH Mark this particular file version
285
+** n=NUM Show the first NUM changes only
286
+** brbg Background color by branch name
287
+** ubg Background color by user name
288
+** ci=HASH Ancestors of a particular check-in
289
+** orig=HASH If both ci and orig are supplied, only show those
290290
** changes on a direct path from orig to ci.
291
-** showid Show RID values for debugging
291
+** showid Show RID values for debugging
292292
**
293
-** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
294
-** year-month-day form, it may be truncated, and it may also name a
295
-** timezone offset from UTC as "-HH:MM" (westward) or "+HH:MM"
296
-** (eastward). Either no timezone suffix or "Z" means UTC.
293
+** DATETIME may be in any of usual formats, including "now",
294
+** "YYYY-MM-DDTHH:MM:SS.SSS", "YYYYMMDDHHMM", and others.
297295
*/
298296
void finfo_page(void){
299297
Stmt q;
300298
const char *zFilename = PD("name","");
301299
char zPrevDate[20];
@@ -386,15 +384,17 @@
386384
" AND event.objid=mlink.mid"
387385
" AND mlink.fid=blob.rid",
388386
TAG_BRANCH, fnid
389387
);
390388
if( (zA = P("a"))!=0 ){
391
- blob_append_sql(&sql, " AND event.mtime>=julianday('%q')", zA);
389
+ blob_append_sql(&sql, " AND event.mtime>=%.16g",
390
+ symbolic_name_to_mtime(zA,0));
392391
url_add_parameter(&url, "a", zA);
393392
}
394393
if( (zB = P("b"))!=0 ){
395
- blob_append_sql(&sql, " AND event.mtime<=julianday('%q')", zB);
394
+ blob_append_sql(&sql, " AND event.mtime<=%.16g",
395
+ symbolic_name_to_mtime(zB,0));
396396
url_add_parameter(&url, "b", zB);
397397
}
398398
if( baseCheckin ){
399399
blob_append_sql(&sql,
400400
" AND mlink.mid IN (SELECT rid FROM ancestor)"
401401
--- src/finfo.c
+++ src/finfo.c
@@ -277,25 +277,23 @@
277 **
278 ** Show the change history for a single file.
279 **
280 ** Additional query parameters:
281 **
282 ** a=DATETIME Only show changes after DATETIME
283 ** b=DATETIME Only show changes before DATETIME
284 ** m=HASH Mark this particular file version
285 ** n=NUM Show the first NUM changes only
286 ** brbg Background color by branch name
287 ** ubg Background color by user name
288 ** ci=HASH Ancestors of a particular check-in
289 ** orig=HASH If both ci and orig are supplied, only show those
290 ** changes on a direct path from orig to ci.
291 ** showid Show RID values for debugging
292 **
293 ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
294 ** year-month-day form, it may be truncated, and it may also name a
295 ** timezone offset from UTC as "-HH:MM" (westward) or "+HH:MM"
296 ** (eastward). Either no timezone suffix or "Z" means UTC.
297 */
298 void finfo_page(void){
299 Stmt q;
300 const char *zFilename = PD("name","");
301 char zPrevDate[20];
@@ -386,15 +384,17 @@
386 " AND event.objid=mlink.mid"
387 " AND mlink.fid=blob.rid",
388 TAG_BRANCH, fnid
389 );
390 if( (zA = P("a"))!=0 ){
391 blob_append_sql(&sql, " AND event.mtime>=julianday('%q')", zA);
 
392 url_add_parameter(&url, "a", zA);
393 }
394 if( (zB = P("b"))!=0 ){
395 blob_append_sql(&sql, " AND event.mtime<=julianday('%q')", zB);
 
396 url_add_parameter(&url, "b", zB);
397 }
398 if( baseCheckin ){
399 blob_append_sql(&sql,
400 " AND mlink.mid IN (SELECT rid FROM ancestor)"
401
--- src/finfo.c
+++ src/finfo.c
@@ -277,25 +277,23 @@
277 **
278 ** Show the change history for a single file.
279 **
280 ** Additional query parameters:
281 **
282 ** a=DATETIME Only show changes after DATETIME
283 ** b=DATETIME Only show changes before DATETIME
284 ** m=HASH Mark this particular file version
285 ** n=NUM Show the first NUM changes only
286 ** brbg Background color by branch name
287 ** ubg Background color by user name
288 ** ci=HASH Ancestors of a particular check-in
289 ** orig=HASH If both ci and orig are supplied, only show those
290 ** changes on a direct path from orig to ci.
291 ** showid Show RID values for debugging
292 **
293 ** DATETIME may be in any of usual formats, including "now",
294 ** "YYYY-MM-DDTHH:MM:SS.SSS", "YYYYMMDDHHMM", and others.
 
 
295 */
296 void finfo_page(void){
297 Stmt q;
298 const char *zFilename = PD("name","");
299 char zPrevDate[20];
@@ -386,15 +384,17 @@
384 " AND event.objid=mlink.mid"
385 " AND mlink.fid=blob.rid",
386 TAG_BRANCH, fnid
387 );
388 if( (zA = P("a"))!=0 ){
389 blob_append_sql(&sql, " AND event.mtime>=%.16g",
390 symbolic_name_to_mtime(zA,0));
391 url_add_parameter(&url, "a", zA);
392 }
393 if( (zB = P("b"))!=0 ){
394 blob_append_sql(&sql, " AND event.mtime<=%.16g",
395 symbolic_name_to_mtime(zB,0));
396 url_add_parameter(&url, "b", zB);
397 }
398 if( baseCheckin ){
399 blob_append_sql(&sql,
400 " AND mlink.mid IN (SELECT rid FROM ancestor)"
401

Keyboard Shortcuts

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