Fossil

Check-in [04ef2df613]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Expand the allowed date/time format for the "a=" and "b=" query parameters to the /finfo page, so that it is compatible with /timeline.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 04ef2df613c2126e1eb2091ab061a2fe313d45e4b682eaa65c0326c8f9f513d4
User & Date: drh 2020-10-15 14:59:12.757
Context
2020-10-17
12:34
On the /finfo page, change the check-in range query parameters from ci= and orig= into from= and to=. This gets the ci= query parameter out of the way so that it can be reused. ... (check-in: 299800b29d user: drh tags: trunk)
2020-10-15
14:59
Expand the allowed date/time format for the "a=" and "b=" query parameters to the /finfo page, so that it is compatible with /timeline. ... (check-in: 04ef2df613 user: drh tags: trunk)
11:23
Fix typo in pikchr.md ... (check-in: 9bdc9ca40b user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/finfo.c.
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292

293
294
295
296
297
298
299
300
301
302
303
** WEBPAGE: finfo
** URL: /finfo?name=FILENAME
**
** Show the change history for a single file.
**
** Additional query parameters:
**
**    a=DATETIME Only show changes after DATETIME
**    b=DATETIME Only show changes before DATETIME
**    m=HASH     Mark this particular file version
**    n=NUM      Show the first NUM changes only
**    brbg       Background color by branch name
**    ubg        Background color by user name
**    ci=HASH    Ancestors of a particular check-in
**    orig=HASH  If both ci and orig are supplied, only show those
**                 changes on a direct path from orig to ci.
**    showid     Show RID values for debugging
**

** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
** year-month-day form, it may be truncated, and it may also name a
** timezone offset from UTC as "-HH:MM" (westward) or "+HH:MM"
** (eastward). Either no timezone suffix or "Z" means UTC.
*/
void finfo_page(void){
  Stmt q;
  const char *zFilename = PD("name","");
  char zPrevDate[20];
  const char *zA;
  const char *zB;







|
|
|
|
|
|
|
|

|

>
|
<
<
<







275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294



295
296
297
298
299
300
301
** WEBPAGE: finfo
** URL: /finfo?name=FILENAME
**
** Show the change history for a single file.
**
** Additional query parameters:
**
**    a=DATETIME   Only show changes after DATETIME
**    b=DATETIME   Only show changes before DATETIME
**    m=HASH       Mark this particular file version
**    n=NUM        Show the first NUM changes only
**    brbg         Background color by branch name
**    ubg          Background color by user name
**    ci=HASH      Ancestors of a particular check-in
**    orig=HASH    If both ci and orig are supplied, only show those
**                 changes on a direct path from orig to ci.
**    showid       Show RID values for debugging
**
** DATETIME may be in any of usual formats, including "now",
** "YYYY-MM-DDTHH:MM:SS.SSS", "YYYYMMDDHHMM", and others.



*/
void finfo_page(void){
  Stmt q;
  const char *zFilename = PD("name","");
  char zPrevDate[20];
  const char *zA;
  const char *zB;
384
385
386
387
388
389
390
391

392
393
394
395

396
397
398
399
400
401
402
    "  FROM mlink, event, blob"
    " WHERE mlink.fnid=%d"
    "   AND event.objid=mlink.mid"
    "   AND mlink.fid=blob.rid",
    TAG_BRANCH, fnid
  );
  if( (zA = P("a"))!=0 ){
    blob_append_sql(&sql, " AND event.mtime>=julianday('%q')", zA);

    url_add_parameter(&url, "a", zA);
  }
  if( (zB = P("b"))!=0 ){
    blob_append_sql(&sql, " AND event.mtime<=julianday('%q')", zB);

    url_add_parameter(&url, "b", zB);
  }
  if( baseCheckin ){
    blob_append_sql(&sql,
      " AND mlink.mid IN (SELECT rid FROM ancestor)"
      " GROUP BY mlink.fid"
    );







|
>



|
>







382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
    "  FROM mlink, event, blob"
    " WHERE mlink.fnid=%d"
    "   AND event.objid=mlink.mid"
    "   AND mlink.fid=blob.rid",
    TAG_BRANCH, fnid
  );
  if( (zA = P("a"))!=0 ){
    blob_append_sql(&sql, " AND event.mtime>=%.16g",
         symbolic_name_to_mtime(zA,0));
    url_add_parameter(&url, "a", zA);
  }
  if( (zB = P("b"))!=0 ){
    blob_append_sql(&sql, " AND event.mtime<=%.16g",
         symbolic_name_to_mtime(zB,0));
    url_add_parameter(&url, "b", zB);
  }
  if( baseCheckin ){
    blob_append_sql(&sql,
      " AND mlink.mid IN (SELECT rid FROM ancestor)"
      " GROUP BY mlink.fid"
    );