Fossil SCM
Enhancements to localtime processing and to the label resolution on the a=, b=, and c= query parameters to the timeline page.
Commit
41c3c1900bd022d552744038232f0ab836a0f889
Parent
1854d99041f6768…
6 files changed
+10
-12
-17
+2
+3
-3
+18
-1
+4
+10
-12
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -656,13 +656,11 @@ | ||
| 656 | 656 | int *pnFBcard /* Number of generated B- and F-cards */ |
| 657 | 657 | ){ |
| 658 | 658 | char *zDate; /* Date of the check-in */ |
| 659 | 659 | char *zParentUuid; /* UUID of parent check-in */ |
| 660 | 660 | Blob filename; /* A single filename */ |
| 661 | -#if !defined(_WIN32) | |
| 662 | 661 | int nBasename; /* Size of base filename */ |
| 663 | -#endif | |
| 664 | 662 | Stmt q; /* Query of files changed */ |
| 665 | 663 | Stmt q2; /* Query of merge parents */ |
| 666 | 664 | Blob mcksum; /* Manifest checksum */ |
| 667 | 665 | ManifestFile *pFile; /* File from the baseline */ |
| 668 | 666 | int nFBcard = 0; /* Number of B-cards and F-cards */ |
| @@ -692,13 +690,11 @@ | ||
| 692 | 690 | " AND vfile.vid=%d" |
| 693 | 691 | " ORDER BY if_selected(vfile.id, pathname, origname)", |
| 694 | 692 | vid); |
| 695 | 693 | blob_zero(&filename); |
| 696 | 694 | blob_appendf(&filename, "%s", g.zLocalRoot); |
| 697 | -#if !defined(_WIN32) | |
| 698 | 695 | nBasename = blob_size(&filename); |
| 699 | -#endif | |
| 700 | 696 | while( db_step(&q)==SQLITE_ROW ){ |
| 701 | 697 | const char *zName = db_column_text(&q, 0); |
| 702 | 698 | const char *zUuid = db_column_text(&q, 1); |
| 703 | 699 | const char *zOrig = db_column_text(&q, 2); |
| 704 | 700 | int frid = db_column_int(&q, 3); |
| @@ -705,24 +701,26 @@ | ||
| 705 | 701 | int isExe = db_column_int(&q, 4); |
| 706 | 702 | int isLink = db_column_int(&q, 5); |
| 707 | 703 | int isSelected = db_column_int(&q, 6); |
| 708 | 704 | const char *zPerm; |
| 709 | 705 | int cmp; |
| 710 | -#if !defined(_WIN32) | |
| 711 | - int mPerm; | |
| 706 | + | |
| 707 | + blob_resize(&filename, nBasename); | |
| 708 | + blob_append(&filename, zName, -1); | |
| 712 | 709 | |
| 710 | +#if !defined(_WIN32) | |
| 713 | 711 | /* For unix, extract the "executable" and "symlink" permissions |
| 714 | 712 | ** directly from the filesystem. On windows, permissions are |
| 715 | 713 | ** unchanged from the original. |
| 716 | 714 | */ |
| 717 | - | |
| 718 | - blob_resize(&filename, nBasename); | |
| 719 | - blob_append(&filename, zName, -1); | |
| 715 | + { | |
| 716 | + int mPerm; | |
| 720 | 717 | |
| 721 | - mPerm = file_wd_perm(blob_str(&filename)); | |
| 722 | - isExe = ( mPerm==PERM_EXE ); | |
| 723 | - isLink = ( mPerm==PERM_LNK ); | |
| 718 | + mPerm = file_wd_perm(blob_str(&filename)); | |
| 719 | + isExe = ( mPerm==PERM_EXE ); | |
| 720 | + isLink = ( mPerm==PERM_LNK ); | |
| 721 | + } | |
| 724 | 722 | #endif |
| 725 | 723 | if( isExe ){ |
| 726 | 724 | zPerm = " x"; |
| 727 | 725 | }else if( isLink ){ |
| 728 | 726 | zPerm = " l"; /* note: symlinks don't have executable bit on unix */ |
| 729 | 727 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -656,13 +656,11 @@ | |
| 656 | int *pnFBcard /* Number of generated B- and F-cards */ |
| 657 | ){ |
| 658 | char *zDate; /* Date of the check-in */ |
| 659 | char *zParentUuid; /* UUID of parent check-in */ |
| 660 | Blob filename; /* A single filename */ |
| 661 | #if !defined(_WIN32) |
| 662 | int nBasename; /* Size of base filename */ |
| 663 | #endif |
| 664 | Stmt q; /* Query of files changed */ |
| 665 | Stmt q2; /* Query of merge parents */ |
| 666 | Blob mcksum; /* Manifest checksum */ |
| 667 | ManifestFile *pFile; /* File from the baseline */ |
| 668 | int nFBcard = 0; /* Number of B-cards and F-cards */ |
| @@ -692,13 +690,11 @@ | |
| 692 | " AND vfile.vid=%d" |
| 693 | " ORDER BY if_selected(vfile.id, pathname, origname)", |
| 694 | vid); |
| 695 | blob_zero(&filename); |
| 696 | blob_appendf(&filename, "%s", g.zLocalRoot); |
| 697 | #if !defined(_WIN32) |
| 698 | nBasename = blob_size(&filename); |
| 699 | #endif |
| 700 | while( db_step(&q)==SQLITE_ROW ){ |
| 701 | const char *zName = db_column_text(&q, 0); |
| 702 | const char *zUuid = db_column_text(&q, 1); |
| 703 | const char *zOrig = db_column_text(&q, 2); |
| 704 | int frid = db_column_int(&q, 3); |
| @@ -705,24 +701,26 @@ | |
| 705 | int isExe = db_column_int(&q, 4); |
| 706 | int isLink = db_column_int(&q, 5); |
| 707 | int isSelected = db_column_int(&q, 6); |
| 708 | const char *zPerm; |
| 709 | int cmp; |
| 710 | #if !defined(_WIN32) |
| 711 | int mPerm; |
| 712 | |
| 713 | /* For unix, extract the "executable" and "symlink" permissions |
| 714 | ** directly from the filesystem. On windows, permissions are |
| 715 | ** unchanged from the original. |
| 716 | */ |
| 717 | |
| 718 | blob_resize(&filename, nBasename); |
| 719 | blob_append(&filename, zName, -1); |
| 720 | |
| 721 | mPerm = file_wd_perm(blob_str(&filename)); |
| 722 | isExe = ( mPerm==PERM_EXE ); |
| 723 | isLink = ( mPerm==PERM_LNK ); |
| 724 | #endif |
| 725 | if( isExe ){ |
| 726 | zPerm = " x"; |
| 727 | }else if( isLink ){ |
| 728 | zPerm = " l"; /* note: symlinks don't have executable bit on unix */ |
| 729 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -656,13 +656,11 @@ | |
| 656 | int *pnFBcard /* Number of generated B- and F-cards */ |
| 657 | ){ |
| 658 | char *zDate; /* Date of the check-in */ |
| 659 | char *zParentUuid; /* UUID of parent check-in */ |
| 660 | Blob filename; /* A single filename */ |
| 661 | int nBasename; /* Size of base filename */ |
| 662 | Stmt q; /* Query of files changed */ |
| 663 | Stmt q2; /* Query of merge parents */ |
| 664 | Blob mcksum; /* Manifest checksum */ |
| 665 | ManifestFile *pFile; /* File from the baseline */ |
| 666 | int nFBcard = 0; /* Number of B-cards and F-cards */ |
| @@ -692,13 +690,11 @@ | |
| 690 | " AND vfile.vid=%d" |
| 691 | " ORDER BY if_selected(vfile.id, pathname, origname)", |
| 692 | vid); |
| 693 | blob_zero(&filename); |
| 694 | blob_appendf(&filename, "%s", g.zLocalRoot); |
| 695 | nBasename = blob_size(&filename); |
| 696 | while( db_step(&q)==SQLITE_ROW ){ |
| 697 | const char *zName = db_column_text(&q, 0); |
| 698 | const char *zUuid = db_column_text(&q, 1); |
| 699 | const char *zOrig = db_column_text(&q, 2); |
| 700 | int frid = db_column_int(&q, 3); |
| @@ -705,24 +701,26 @@ | |
| 701 | int isExe = db_column_int(&q, 4); |
| 702 | int isLink = db_column_int(&q, 5); |
| 703 | int isSelected = db_column_int(&q, 6); |
| 704 | const char *zPerm; |
| 705 | int cmp; |
| 706 | |
| 707 | blob_resize(&filename, nBasename); |
| 708 | blob_append(&filename, zName, -1); |
| 709 | |
| 710 | #if !defined(_WIN32) |
| 711 | /* For unix, extract the "executable" and "symlink" permissions |
| 712 | ** directly from the filesystem. On windows, permissions are |
| 713 | ** unchanged from the original. |
| 714 | */ |
| 715 | { |
| 716 | int mPerm; |
| 717 | |
| 718 | mPerm = file_wd_perm(blob_str(&filename)); |
| 719 | isExe = ( mPerm==PERM_EXE ); |
| 720 | isLink = ( mPerm==PERM_LNK ); |
| 721 | } |
| 722 | #endif |
| 723 | if( isExe ){ |
| 724 | zPerm = " x"; |
| 725 | }else if( isLink ){ |
| 726 | zPerm = " l"; /* note: symlinks don't have executable bit on unix */ |
| 727 |
-17
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -479,27 +479,19 @@ | ||
| 479 | 479 | char *zEUser, *zEComment; |
| 480 | 480 | const char *zUser; |
| 481 | 481 | const char *zComment; |
| 482 | 482 | const char *zDate; |
| 483 | 483 | const char *zOrigDate; |
| 484 | -#if 0 | |
| 485 | - const char *zBranch; | |
| 486 | -#endif | |
| 487 | 484 | style_header(zTitle); |
| 488 | 485 | login_anonymous_available(); |
| 489 | 486 | free(zTitle); |
| 490 | 487 | zEUser = db_text(0, |
| 491 | 488 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 492 | 489 | TAG_USER, rid); |
| 493 | 490 | zEComment = db_text(0, |
| 494 | 491 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 495 | 492 | TAG_COMMENT, rid); |
| 496 | -#if 0 | |
| 497 | - zBranch = db_text("trunk", | |
| 498 | - "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", | |
| 499 | - TAG_BRANCH, rid); | |
| 500 | -#endif | |
| 501 | 493 | zUser = db_column_text(&q, 2); |
| 502 | 494 | zComment = db_column_text(&q, 3); |
| 503 | 495 | zDate = db_column_text(&q,1); |
| 504 | 496 | zOrigDate = db_column_text(&q, 4); |
| 505 | 497 | @ <div class="section">Overview</div> |
| @@ -577,19 +569,10 @@ | ||
| 577 | 569 | @ %z(href("%s",zUrl))Tarball</a> |
| 578 | 570 | @ | %z(href("%R/zip/%s-%S.zip?uuid=%s",zProjName,zUuid,zUuid)) |
| 579 | 571 | @ ZIP archive</a> |
| 580 | 572 | fossil_free(zUrl); |
| 581 | 573 | } |
| 582 | -#if 0 | |
| 583 | - if( isLeaf && fossil_strcmp(zBranch,"trunk")!=0 ){ | |
| 584 | - @ </td></tr> | |
| 585 | - @ <tr><th>Diffs:</th><td> | |
| 586 | - @ %z(href("%R/vdiff?branch=%t",zBranch))Changes in %h(zBranch)</a> | |
| 587 | - @ | %z(href("%R/vdiff?from=trunk&to=%t",zBranch))Changes | |
| 588 | - @ from trunk</a> | |
| 589 | - } | |
| 590 | -#endif | |
| 591 | 574 | @ </td></tr> |
| 592 | 575 | @ <tr><th>Other Links:</th> |
| 593 | 576 | @ <td> |
| 594 | 577 | @ %z(href("%R/dir?ci=%S",zUuid))files</a> |
| 595 | 578 | @ | %z(href("%R/artifact/%S",zUuid))manifest</a> |
| 596 | 579 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -479,27 +479,19 @@ | |
| 479 | char *zEUser, *zEComment; |
| 480 | const char *zUser; |
| 481 | const char *zComment; |
| 482 | const char *zDate; |
| 483 | const char *zOrigDate; |
| 484 | #if 0 |
| 485 | const char *zBranch; |
| 486 | #endif |
| 487 | style_header(zTitle); |
| 488 | login_anonymous_available(); |
| 489 | free(zTitle); |
| 490 | zEUser = db_text(0, |
| 491 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 492 | TAG_USER, rid); |
| 493 | zEComment = db_text(0, |
| 494 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 495 | TAG_COMMENT, rid); |
| 496 | #if 0 |
| 497 | zBranch = db_text("trunk", |
| 498 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 499 | TAG_BRANCH, rid); |
| 500 | #endif |
| 501 | zUser = db_column_text(&q, 2); |
| 502 | zComment = db_column_text(&q, 3); |
| 503 | zDate = db_column_text(&q,1); |
| 504 | zOrigDate = db_column_text(&q, 4); |
| 505 | @ <div class="section">Overview</div> |
| @@ -577,19 +569,10 @@ | |
| 577 | @ %z(href("%s",zUrl))Tarball</a> |
| 578 | @ | %z(href("%R/zip/%s-%S.zip?uuid=%s",zProjName,zUuid,zUuid)) |
| 579 | @ ZIP archive</a> |
| 580 | fossil_free(zUrl); |
| 581 | } |
| 582 | #if 0 |
| 583 | if( isLeaf && fossil_strcmp(zBranch,"trunk")!=0 ){ |
| 584 | @ </td></tr> |
| 585 | @ <tr><th>Diffs:</th><td> |
| 586 | @ %z(href("%R/vdiff?branch=%t",zBranch))Changes in %h(zBranch)</a> |
| 587 | @ | %z(href("%R/vdiff?from=trunk&to=%t",zBranch))Changes |
| 588 | @ from trunk</a> |
| 589 | } |
| 590 | #endif |
| 591 | @ </td></tr> |
| 592 | @ <tr><th>Other Links:</th> |
| 593 | @ <td> |
| 594 | @ %z(href("%R/dir?ci=%S",zUuid))files</a> |
| 595 | @ | %z(href("%R/artifact/%S",zUuid))manifest</a> |
| 596 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -479,27 +479,19 @@ | |
| 479 | char *zEUser, *zEComment; |
| 480 | const char *zUser; |
| 481 | const char *zComment; |
| 482 | const char *zDate; |
| 483 | const char *zOrigDate; |
| 484 | style_header(zTitle); |
| 485 | login_anonymous_available(); |
| 486 | free(zTitle); |
| 487 | zEUser = db_text(0, |
| 488 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 489 | TAG_USER, rid); |
| 490 | zEComment = db_text(0, |
| 491 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 492 | TAG_COMMENT, rid); |
| 493 | zUser = db_column_text(&q, 2); |
| 494 | zComment = db_column_text(&q, 3); |
| 495 | zDate = db_column_text(&q,1); |
| 496 | zOrigDate = db_column_text(&q, 4); |
| 497 | @ <div class="section">Overview</div> |
| @@ -577,19 +569,10 @@ | |
| 569 | @ %z(href("%s",zUrl))Tarball</a> |
| 570 | @ | %z(href("%R/zip/%s-%S.zip?uuid=%s",zProjName,zUuid,zUuid)) |
| 571 | @ ZIP archive</a> |
| 572 | fossil_free(zUrl); |
| 573 | } |
| 574 | @ </td></tr> |
| 575 | @ <tr><th>Other Links:</th> |
| 576 | @ <td> |
| 577 | @ %z(href("%R/dir?ci=%S",zUuid))files</a> |
| 578 | @ | %z(href("%R/artifact/%S",zUuid))manifest</a> |
| 579 |
+2
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -479,10 +479,12 @@ | ||
| 479 | 479 | if( g.fSqlTrace ) g.fSqlStats = 1; |
| 480 | 480 | g.fSqlPrint = find_option("sqlprint", 0, 0)!=0; |
| 481 | 481 | g.fHttpTrace = find_option("httptrace", 0, 0)!=0; |
| 482 | 482 | g.zLogin = find_option("user", "U", 1); |
| 483 | 483 | g.zSSLIdentity = find_option("ssl-identity", 0, 1); |
| 484 | + if( find_option("utc",0,0) ) g.fTimeFormat = 1; | |
| 485 | + if( find_option("localtime",0,0) ) g.fTimeFormat = 2; | |
| 484 | 486 | if( zChdir && chdir(zChdir) ){ |
| 485 | 487 | fossil_fatal("unable to change directories to %s", zChdir); |
| 486 | 488 | } |
| 487 | 489 | if( find_option("help",0,0)!=0 ){ |
| 488 | 490 | /* --help anywhere on the command line is translated into |
| 489 | 491 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -479,10 +479,12 @@ | |
| 479 | if( g.fSqlTrace ) g.fSqlStats = 1; |
| 480 | g.fSqlPrint = find_option("sqlprint", 0, 0)!=0; |
| 481 | g.fHttpTrace = find_option("httptrace", 0, 0)!=0; |
| 482 | g.zLogin = find_option("user", "U", 1); |
| 483 | g.zSSLIdentity = find_option("ssl-identity", 0, 1); |
| 484 | if( zChdir && chdir(zChdir) ){ |
| 485 | fossil_fatal("unable to change directories to %s", zChdir); |
| 486 | } |
| 487 | if( find_option("help",0,0)!=0 ){ |
| 488 | /* --help anywhere on the command line is translated into |
| 489 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -479,10 +479,12 @@ | |
| 479 | if( g.fSqlTrace ) g.fSqlStats = 1; |
| 480 | g.fSqlPrint = find_option("sqlprint", 0, 0)!=0; |
| 481 | g.fHttpTrace = find_option("httptrace", 0, 0)!=0; |
| 482 | g.zLogin = find_option("user", "U", 1); |
| 483 | g.zSSLIdentity = find_option("ssl-identity", 0, 1); |
| 484 | if( find_option("utc",0,0) ) g.fTimeFormat = 1; |
| 485 | if( find_option("localtime",0,0) ) g.fTimeFormat = 2; |
| 486 | if( zChdir && chdir(zChdir) ){ |
| 487 | fossil_fatal("unable to change directories to %s", zChdir); |
| 488 | } |
| 489 | if( find_option("help",0,0)!=0 ){ |
| 490 | /* --help anywhere on the command line is translated into |
| 491 |
+3
-3
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -29,11 +29,11 @@ | ||
| 29 | 29 | ** Return TRUE if the string begins with something that looks roughly |
| 30 | 30 | ** like an ISO date/time string. The SQLite date/time functions will |
| 31 | 31 | ** have the final say-so about whether or not the date/time string is |
| 32 | 32 | ** well-formed. |
| 33 | 33 | */ |
| 34 | -static int is_date(const char *z){ | |
| 34 | +int fossil_isdate(const char *z){ | |
| 35 | 35 | if( !fossil_isdigit(z[0]) ) return 0; |
| 36 | 36 | if( !fossil_isdigit(z[1]) ) return 0; |
| 37 | 37 | if( !fossil_isdigit(z[2]) ) return 0; |
| 38 | 38 | if( !fossil_isdigit(z[3]) ) return 0; |
| 39 | 39 | if( z[4]!='-') return 0; |
| @@ -112,11 +112,11 @@ | ||
| 112 | 112 | " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" |
| 113 | 113 | " ORDER BY mtime DESC LIMIT 1", |
| 114 | 114 | &zTag[5], zType); |
| 115 | 115 | return rid; |
| 116 | 116 | } |
| 117 | - if( is_date(zTag) ){ | |
| 117 | + if( fossil_isdate(zTag) ){ | |
| 118 | 118 | rid = db_int(0, |
| 119 | 119 | "SELECT objid FROM event" |
| 120 | 120 | " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" |
| 121 | 121 | " ORDER BY mtime DESC LIMIT 1", |
| 122 | 122 | zTag, zType); |
| @@ -181,11 +181,11 @@ | ||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /* symbolic-name ":" date-time */ |
| 184 | 184 | nTag = strlen(zTag); |
| 185 | 185 | for(i=0; i<nTag-10 && zTag[i]!=':'; i++){} |
| 186 | - if( zTag[i]==':' && is_date(&zTag[i+1]) ){ | |
| 186 | + if( zTag[i]==':' && fossil_isdate(&zTag[i+1]) ){ | |
| 187 | 187 | char *zDate = mprintf("%s", &zTag[i+1]); |
| 188 | 188 | char *zTagBase = mprintf("%.*s", i, zTag); |
| 189 | 189 | int nDate = strlen(zDate); |
| 190 | 190 | if( sqlite3_strnicmp(&zDate[nDate-3],"utc",3)==0 ){ |
| 191 | 191 | zDate[nDate-3] = 'z'; |
| 192 | 192 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -29,11 +29,11 @@ | |
| 29 | ** Return TRUE if the string begins with something that looks roughly |
| 30 | ** like an ISO date/time string. The SQLite date/time functions will |
| 31 | ** have the final say-so about whether or not the date/time string is |
| 32 | ** well-formed. |
| 33 | */ |
| 34 | static int is_date(const char *z){ |
| 35 | if( !fossil_isdigit(z[0]) ) return 0; |
| 36 | if( !fossil_isdigit(z[1]) ) return 0; |
| 37 | if( !fossil_isdigit(z[2]) ) return 0; |
| 38 | if( !fossil_isdigit(z[3]) ) return 0; |
| 39 | if( z[4]!='-') return 0; |
| @@ -112,11 +112,11 @@ | |
| 112 | " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" |
| 113 | " ORDER BY mtime DESC LIMIT 1", |
| 114 | &zTag[5], zType); |
| 115 | return rid; |
| 116 | } |
| 117 | if( is_date(zTag) ){ |
| 118 | rid = db_int(0, |
| 119 | "SELECT objid FROM event" |
| 120 | " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" |
| 121 | " ORDER BY mtime DESC LIMIT 1", |
| 122 | zTag, zType); |
| @@ -181,11 +181,11 @@ | |
| 181 | } |
| 182 | |
| 183 | /* symbolic-name ":" date-time */ |
| 184 | nTag = strlen(zTag); |
| 185 | for(i=0; i<nTag-10 && zTag[i]!=':'; i++){} |
| 186 | if( zTag[i]==':' && is_date(&zTag[i+1]) ){ |
| 187 | char *zDate = mprintf("%s", &zTag[i+1]); |
| 188 | char *zTagBase = mprintf("%.*s", i, zTag); |
| 189 | int nDate = strlen(zDate); |
| 190 | if( sqlite3_strnicmp(&zDate[nDate-3],"utc",3)==0 ){ |
| 191 | zDate[nDate-3] = 'z'; |
| 192 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -29,11 +29,11 @@ | |
| 29 | ** Return TRUE if the string begins with something that looks roughly |
| 30 | ** like an ISO date/time string. The SQLite date/time functions will |
| 31 | ** have the final say-so about whether or not the date/time string is |
| 32 | ** well-formed. |
| 33 | */ |
| 34 | int fossil_isdate(const char *z){ |
| 35 | if( !fossil_isdigit(z[0]) ) return 0; |
| 36 | if( !fossil_isdigit(z[1]) ) return 0; |
| 37 | if( !fossil_isdigit(z[2]) ) return 0; |
| 38 | if( !fossil_isdigit(z[3]) ) return 0; |
| 39 | if( z[4]!='-') return 0; |
| @@ -112,11 +112,11 @@ | |
| 112 | " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" |
| 113 | " ORDER BY mtime DESC LIMIT 1", |
| 114 | &zTag[5], zType); |
| 115 | return rid; |
| 116 | } |
| 117 | if( fossil_isdate(zTag) ){ |
| 118 | rid = db_int(0, |
| 119 | "SELECT objid FROM event" |
| 120 | " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'" |
| 121 | " ORDER BY mtime DESC LIMIT 1", |
| 122 | zTag, zType); |
| @@ -181,11 +181,11 @@ | |
| 181 | } |
| 182 | |
| 183 | /* symbolic-name ":" date-time */ |
| 184 | nTag = strlen(zTag); |
| 185 | for(i=0; i<nTag-10 && zTag[i]!=':'; i++){} |
| 186 | if( zTag[i]==':' && fossil_isdate(&zTag[i+1]) ){ |
| 187 | char *zDate = mprintf("%s", &zTag[i+1]); |
| 188 | char *zTagBase = mprintf("%.*s", i, zTag); |
| 189 | int nDate = strlen(zDate); |
| 190 | if( sqlite3_strnicmp(&zDate[nDate-3],"utc",3)==0 ){ |
| 191 | zDate[nDate-3] = 'z'; |
| 192 |
+18
-1
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1129,10 +1129,12 @@ | ||
| 1129 | 1129 | |
| 1130 | 1130 | /* |
| 1131 | 1131 | ** WEBPAGE: setup_timeline |
| 1132 | 1132 | */ |
| 1133 | 1133 | void setup_timeline(void){ |
| 1134 | + double tmDiff; | |
| 1135 | + char zTmDiff[20]; | |
| 1134 | 1136 | login_check_credentials(); |
| 1135 | 1137 | if( !g.perm.Setup ){ |
| 1136 | 1138 | login_needed(); |
| 1137 | 1139 | } |
| 1138 | 1140 | |
| @@ -1149,11 +1151,26 @@ | ||
| 1149 | 1151 | |
| 1150 | 1152 | @ <hr /> |
| 1151 | 1153 | onoff_attribute("Use Universal Coordinated Time (UTC)", |
| 1152 | 1154 | "timeline-utc", "utc", 1); |
| 1153 | 1155 | @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or |
| 1154 | - @ Zulu) instead of in local time.</p> | |
| 1156 | + @ Zulu) instead of in local time. On this server, local time is currently | |
| 1157 | + g.fTimeFormat = 2; | |
| 1158 | + tmDiff = db_double(0.0, "SELECT julianday('now')"); | |
| 1159 | + tmDiff = db_double(0.0, | |
| 1160 | + "SELECT (julianday(%.17g,'localtime')-julianday(%.17g))*24.0", | |
| 1161 | + tmDiff, tmDiff); | |
| 1162 | + sqlite3_snprintf(sizeof(zTmDiff), zTmDiff, "%.1f", tmDiff); | |
| 1163 | + if( strcmp(zTmDiff, "0.0")==0 ){ | |
| 1164 | + @ the same as UTC and so this setting will make no difference in | |
| 1165 | + @ the display.</p> | |
| 1166 | + }else if( tmDiff<0.0 ){ | |
| 1167 | + sqlite3_snprintf(sizeof(zTmDiff), zTmDiff, "%.1f", -tmDiff); | |
| 1168 | + @ %s(zTmDiff) hours behind UTC.</p> | |
| 1169 | + }else{ | |
| 1170 | + @ %s(zTmDiff) hours ahead of UTC.</p> | |
| 1171 | + } | |
| 1155 | 1172 | |
| 1156 | 1173 | @ <hr /> |
| 1157 | 1174 | onoff_attribute("Show version differences by default", |
| 1158 | 1175 | "show-version-diffs", "vdiff", 0); |
| 1159 | 1176 | @ <p>On the version-information pages linked from the timeline can either |
| 1160 | 1177 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1129,10 +1129,12 @@ | |
| 1129 | |
| 1130 | /* |
| 1131 | ** WEBPAGE: setup_timeline |
| 1132 | */ |
| 1133 | void setup_timeline(void){ |
| 1134 | login_check_credentials(); |
| 1135 | if( !g.perm.Setup ){ |
| 1136 | login_needed(); |
| 1137 | } |
| 1138 | |
| @@ -1149,11 +1151,26 @@ | |
| 1149 | |
| 1150 | @ <hr /> |
| 1151 | onoff_attribute("Use Universal Coordinated Time (UTC)", |
| 1152 | "timeline-utc", "utc", 1); |
| 1153 | @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or |
| 1154 | @ Zulu) instead of in local time.</p> |
| 1155 | |
| 1156 | @ <hr /> |
| 1157 | onoff_attribute("Show version differences by default", |
| 1158 | "show-version-diffs", "vdiff", 0); |
| 1159 | @ <p>On the version-information pages linked from the timeline can either |
| 1160 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1129,10 +1129,12 @@ | |
| 1129 | |
| 1130 | /* |
| 1131 | ** WEBPAGE: setup_timeline |
| 1132 | */ |
| 1133 | void setup_timeline(void){ |
| 1134 | double tmDiff; |
| 1135 | char zTmDiff[20]; |
| 1136 | login_check_credentials(); |
| 1137 | if( !g.perm.Setup ){ |
| 1138 | login_needed(); |
| 1139 | } |
| 1140 | |
| @@ -1149,11 +1151,26 @@ | |
| 1151 | |
| 1152 | @ <hr /> |
| 1153 | onoff_attribute("Use Universal Coordinated Time (UTC)", |
| 1154 | "timeline-utc", "utc", 1); |
| 1155 | @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or |
| 1156 | @ Zulu) instead of in local time. On this server, local time is currently |
| 1157 | g.fTimeFormat = 2; |
| 1158 | tmDiff = db_double(0.0, "SELECT julianday('now')"); |
| 1159 | tmDiff = db_double(0.0, |
| 1160 | "SELECT (julianday(%.17g,'localtime')-julianday(%.17g))*24.0", |
| 1161 | tmDiff, tmDiff); |
| 1162 | sqlite3_snprintf(sizeof(zTmDiff), zTmDiff, "%.1f", tmDiff); |
| 1163 | if( strcmp(zTmDiff, "0.0")==0 ){ |
| 1164 | @ the same as UTC and so this setting will make no difference in |
| 1165 | @ the display.</p> |
| 1166 | }else if( tmDiff<0.0 ){ |
| 1167 | sqlite3_snprintf(sizeof(zTmDiff), zTmDiff, "%.1f", -tmDiff); |
| 1168 | @ %s(zTmDiff) hours behind UTC.</p> |
| 1169 | }else{ |
| 1170 | @ %s(zTmDiff) hours ahead of UTC.</p> |
| 1171 | } |
| 1172 | |
| 1173 | @ <hr /> |
| 1174 | onoff_attribute("Show version differences by default", |
| 1175 | "show-version-diffs", "vdiff", 0); |
| 1176 | @ <p>On the version-information pages linked from the timeline can either |
| 1177 |
+4
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -818,10 +818,14 @@ | ||
| 818 | 818 | */ |
| 819 | 819 | double symbolic_name_to_mtime(const char *z){ |
| 820 | 820 | double mtime; |
| 821 | 821 | int rid; |
| 822 | 822 | if( z==0 ) return -1.0; |
| 823 | + if( fossil_isdate(z) ){ | |
| 824 | + mtime = db_double(0.0, "SELECT julianday(%Q,'utc')", z); | |
| 825 | + if( mtime>0.0 ) return mtime; | |
| 826 | + } | |
| 823 | 827 | rid = symbolic_name_to_rid(z, "ci"); |
| 824 | 828 | if( rid==0 ) return -1.0; |
| 825 | 829 | mtime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); |
| 826 | 830 | return mtime; |
| 827 | 831 | } |
| 828 | 832 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -818,10 +818,14 @@ | |
| 818 | */ |
| 819 | double symbolic_name_to_mtime(const char *z){ |
| 820 | double mtime; |
| 821 | int rid; |
| 822 | if( z==0 ) return -1.0; |
| 823 | rid = symbolic_name_to_rid(z, "ci"); |
| 824 | if( rid==0 ) return -1.0; |
| 825 | mtime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); |
| 826 | return mtime; |
| 827 | } |
| 828 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -818,10 +818,14 @@ | |
| 818 | */ |
| 819 | double symbolic_name_to_mtime(const char *z){ |
| 820 | double mtime; |
| 821 | int rid; |
| 822 | if( z==0 ) return -1.0; |
| 823 | if( fossil_isdate(z) ){ |
| 824 | mtime = db_double(0.0, "SELECT julianday(%Q,'utc')", z); |
| 825 | if( mtime>0.0 ) return mtime; |
| 826 | } |
| 827 | rid = symbolic_name_to_rid(z, "ci"); |
| 828 | if( rid==0 ) return -1.0; |
| 829 | mtime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); |
| 830 | return mtime; |
| 831 | } |
| 832 |