Fossil SCM

Enhancements to localtime processing and to the label resolution on the a=, b=, and c= query parameters to the timeline page.

drh 2012-09-05 20:45 trunk
Commit 41c3c1900bd022d552744038232f0ab836a0f889
+10 -12
--- src/checkin.c
+++ src/checkin.c
@@ -656,13 +656,11 @@
656656
int *pnFBcard /* Number of generated B- and F-cards */
657657
){
658658
char *zDate; /* Date of the check-in */
659659
char *zParentUuid; /* UUID of parent check-in */
660660
Blob filename; /* A single filename */
661
-#if !defined(_WIN32)
662661
int nBasename; /* Size of base filename */
663
-#endif
664662
Stmt q; /* Query of files changed */
665663
Stmt q2; /* Query of merge parents */
666664
Blob mcksum; /* Manifest checksum */
667665
ManifestFile *pFile; /* File from the baseline */
668666
int nFBcard = 0; /* Number of B-cards and F-cards */
@@ -692,13 +690,11 @@
692690
" AND vfile.vid=%d"
693691
" ORDER BY if_selected(vfile.id, pathname, origname)",
694692
vid);
695693
blob_zero(&filename);
696694
blob_appendf(&filename, "%s", g.zLocalRoot);
697
-#if !defined(_WIN32)
698695
nBasename = blob_size(&filename);
699
-#endif
700696
while( db_step(&q)==SQLITE_ROW ){
701697
const char *zName = db_column_text(&q, 0);
702698
const char *zUuid = db_column_text(&q, 1);
703699
const char *zOrig = db_column_text(&q, 2);
704700
int frid = db_column_int(&q, 3);
@@ -705,24 +701,26 @@
705701
int isExe = db_column_int(&q, 4);
706702
int isLink = db_column_int(&q, 5);
707703
int isSelected = db_column_int(&q, 6);
708704
const char *zPerm;
709705
int cmp;
710
-#if !defined(_WIN32)
711
- int mPerm;
706
+
707
+ blob_resize(&filename, nBasename);
708
+ blob_append(&filename, zName, -1);
712709
710
+#if !defined(_WIN32)
713711
/* For unix, extract the "executable" and "symlink" permissions
714712
** directly from the filesystem. On windows, permissions are
715713
** unchanged from the original.
716714
*/
717
-
718
- blob_resize(&filename, nBasename);
719
- blob_append(&filename, zName, -1);
715
+ {
716
+ int mPerm;
720717
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
+ }
724722
#endif
725723
if( isExe ){
726724
zPerm = " x";
727725
}else if( isLink ){
728726
zPerm = " l"; /* note: symlinks don't have executable bit on unix */
729727
--- 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 @@
479479
char *zEUser, *zEComment;
480480
const char *zUser;
481481
const char *zComment;
482482
const char *zDate;
483483
const char *zOrigDate;
484
-#if 0
485
- const char *zBranch;
486
-#endif
487484
style_header(zTitle);
488485
login_anonymous_available();
489486
free(zTitle);
490487
zEUser = db_text(0,
491488
"SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
492489
TAG_USER, rid);
493490
zEComment = db_text(0,
494491
"SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
495492
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
501493
zUser = db_column_text(&q, 2);
502494
zComment = db_column_text(&q, 3);
503495
zDate = db_column_text(&q,1);
504496
zOrigDate = db_column_text(&q, 4);
505497
@ <div class="section">Overview</div>
@@ -577,19 +569,10 @@
577569
@ %z(href("%s",zUrl))Tarball</a>
578570
@ | %z(href("%R/zip/%s-%S.zip?uuid=%s",zProjName,zUuid,zUuid))
579571
@ ZIP archive</a>
580572
fossil_free(zUrl);
581573
}
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
591574
@ </td></tr>
592575
@ <tr><th>Other&nbsp;Links:</th>
593576
@ <td>
594577
@ %z(href("%R/dir?ci=%S",zUuid))files</a>
595578
@ | %z(href("%R/artifact/%S",zUuid))manifest</a>
596579
--- 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&nbsp;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&nbsp;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 @@
479479
if( g.fSqlTrace ) g.fSqlStats = 1;
480480
g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
481481
g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
482482
g.zLogin = find_option("user", "U", 1);
483483
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;
484486
if( zChdir && chdir(zChdir) ){
485487
fossil_fatal("unable to change directories to %s", zChdir);
486488
}
487489
if( find_option("help",0,0)!=0 ){
488490
/* --help anywhere on the command line is translated into
489491
--- 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 @@
2929
** Return TRUE if the string begins with something that looks roughly
3030
** like an ISO date/time string. The SQLite date/time functions will
3131
** have the final say-so about whether or not the date/time string is
3232
** well-formed.
3333
*/
34
-static int is_date(const char *z){
34
+int fossil_isdate(const char *z){
3535
if( !fossil_isdigit(z[0]) ) return 0;
3636
if( !fossil_isdigit(z[1]) ) return 0;
3737
if( !fossil_isdigit(z[2]) ) return 0;
3838
if( !fossil_isdigit(z[3]) ) return 0;
3939
if( z[4]!='-') return 0;
@@ -112,11 +112,11 @@
112112
" WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'"
113113
" ORDER BY mtime DESC LIMIT 1",
114114
&zTag[5], zType);
115115
return rid;
116116
}
117
- if( is_date(zTag) ){
117
+ if( fossil_isdate(zTag) ){
118118
rid = db_int(0,
119119
"SELECT objid FROM event"
120120
" WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'"
121121
" ORDER BY mtime DESC LIMIT 1",
122122
zTag, zType);
@@ -181,11 +181,11 @@
181181
}
182182
183183
/* symbolic-name ":" date-time */
184184
nTag = strlen(zTag);
185185
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]) ){
187187
char *zDate = mprintf("%s", &zTag[i+1]);
188188
char *zTagBase = mprintf("%.*s", i, zTag);
189189
int nDate = strlen(zDate);
190190
if( sqlite3_strnicmp(&zDate[nDate-3],"utc",3)==0 ){
191191
zDate[nDate-3] = 'z';
192192
--- 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 @@
11291129
11301130
/*
11311131
** WEBPAGE: setup_timeline
11321132
*/
11331133
void setup_timeline(void){
1134
+ double tmDiff;
1135
+ char zTmDiff[20];
11341136
login_check_credentials();
11351137
if( !g.perm.Setup ){
11361138
login_needed();
11371139
}
11381140
@@ -1149,11 +1151,26 @@
11491151
11501152
@ <hr />
11511153
onoff_attribute("Use Universal Coordinated Time (UTC)",
11521154
"timeline-utc", "utc", 1);
11531155
@ <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
+ }
11551172
11561173
@ <hr />
11571174
onoff_attribute("Show version differences by default",
11581175
"show-version-diffs", "vdiff", 0);
11591176
@ <p>On the version-information pages linked from the timeline can either
11601177
--- 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
--- src/timeline.c
+++ src/timeline.c
@@ -818,10 +818,14 @@
818818
*/
819819
double symbolic_name_to_mtime(const char *z){
820820
double mtime;
821821
int rid;
822822
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
+ }
823827
rid = symbolic_name_to_rid(z, "ci");
824828
if( rid==0 ) return -1.0;
825829
mtime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid);
826830
return mtime;
827831
}
828832
--- 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

Keyboard Shortcuts

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