Fossil SCM

Improved /timewarp webpage. Formerly known as /test_timewarp.

drh 2015-09-28 21:26 trunk
Commit 583e2f8f2c641905bacfb24fa02fb06c013cf82a
2 files changed +1 -1 +22 -4
+1 -1
--- src/sitemap.c
+++ src/sitemap.c
@@ -138,11 +138,11 @@
138138
@ <ul>
139139
if( g.perm.Admin || db_get_boolean("test_env_enable",0) ){
140140
@ <li>%z(href("%R/test_env"))CGI Environment Test</a></li>
141141
}
142142
if( g.perm.Read && g.perm.Hyperlink ){
143
- @ <li>%z(href("%R/test_timewarps"))List of "Timewarp" Check-ins</a></li>
143
+ @ <li>%z(href("%R/timewarps"))List of "Timewarp" Check-ins</a></li>
144144
}
145145
if( g.perm.Read ){
146146
@ <li>%z(href("%R/test-rename-list"))List of file renames</a></li>
147147
}
148148
@ <li>%z(href("%R/hash-color-test"))Page to experiment with the automatic
149149
--- src/sitemap.c
+++ src/sitemap.c
@@ -138,11 +138,11 @@
138 @ <ul>
139 if( g.perm.Admin || db_get_boolean("test_env_enable",0) ){
140 @ <li>%z(href("%R/test_env"))CGI Environment Test</a></li>
141 }
142 if( g.perm.Read && g.perm.Hyperlink ){
143 @ <li>%z(href("%R/test_timewarps"))List of "Timewarp" Check-ins</a></li>
144 }
145 if( g.perm.Read ){
146 @ <li>%z(href("%R/test-rename-list"))List of file renames</a></li>
147 }
148 @ <li>%z(href("%R/hash-color-test"))Page to experiment with the automatic
149
--- src/sitemap.c
+++ src/sitemap.c
@@ -138,11 +138,11 @@
138 @ <ul>
139 if( g.perm.Admin || db_get_boolean("test_env_enable",0) ){
140 @ <li>%z(href("%R/test_env"))CGI Environment Test</a></li>
141 }
142 if( g.perm.Read && g.perm.Hyperlink ){
143 @ <li>%z(href("%R/timewarps"))List of "Timewarp" Check-ins</a></li>
144 }
145 if( g.perm.Read ){
146 @ <li>%z(href("%R/test-rename-list"))List of file renames</a></li>
147 }
148 @ <li>%z(href("%R/hash-color-test"))Page to experiment with the automatic
149
+22 -4
--- src/timeline.c
+++ src/timeline.c
@@ -2208,36 +2208,54 @@
22082208
}
22092209
db_finalize(&q);
22102210
}
22112211
22122212
/*
2213
-** WEBPAGE: test_timewarps
2213
+** WEBPAGE: timewarps
22142214
**
22152215
** Show all check-ins that are "timewarps". A timewarp is a
22162216
** check-in that occurs before its parent, according to the
22172217
** timestamp information on the check-in. This can only actually
22182218
** happen, of course, if a users system clock is set incorrectly.
22192219
*/
22202220
void test_timewarp_page(void){
22212221
Stmt q;
2222
+ int cnt = 0;
22222223
22232224
login_check_credentials();
22242225
if( !g.perm.Read || !g.perm.Hyperlink ){
22252226
login_needed(g.anon.Read && g.anon.Hyperlink);
22262227
return;
22272228
}
22282229
style_header("Instances of timewarp");
2229
- @ <ul>
22302230
db_prepare(&q,
2231
- "SELECT blob.uuid "
2231
+ "SELECT blob.uuid, "
2232
+ " (SELECT date(mtime) FROM event WHERE objid=c.cid),"
2233
+ " EXISTS(SELECT 1 FROM event a, event b"
2234
+ " WHERE a.objid=p.cid AND b.objid=c.cid"
2235
+ " AND a.mtime>b.mtime)"
22322236
" FROM plink p, plink c, blob"
22332237
" WHERE p.cid=c.pid AND p.mtime>c.mtime"
22342238
" AND blob.rid=c.cid"
2239
+ " ORDER BY 2 DESC"
22352240
);
22362241
while( db_step(&q)==SQLITE_ROW ){
22372242
const char *zUuid = db_column_text(&q, 0);
2243
+ const char *zDate = db_column_text(&q, 1);
2244
+ if( cnt==0 ){
2245
+ @ <ul>
2246
+ }
2247
+ cnt++;
22382248
@ <li>
2239
- @ <a href="%R/timeline?dp=%!S(zUuid)&amp;unhide">%S(zUuid)</a>
2249
+ @ <a href="%R/timeline?c=%!S(zUuid)&amp;unhide">%s(zDate) %S(zUuid)</a>
2250
+ if( db_column_int(&q,2)==0 ){
2251
+ @ <i>(Resolved by editing the date)</i>
2252
+ }
22402253
}
22412254
db_finalize(&q);
2255
+ if( cnt==0 ){
2256
+ @ <p>No timewarps in this repository</p>
2257
+ }else{
2258
+ @ </ul>
2259
+ }
22422260
style_footer();
22432261
}
22442262
--- src/timeline.c
+++ src/timeline.c
@@ -2208,36 +2208,54 @@
2208 }
2209 db_finalize(&q);
2210 }
2211
2212 /*
2213 ** WEBPAGE: test_timewarps
2214 **
2215 ** Show all check-ins that are "timewarps". A timewarp is a
2216 ** check-in that occurs before its parent, according to the
2217 ** timestamp information on the check-in. This can only actually
2218 ** happen, of course, if a users system clock is set incorrectly.
2219 */
2220 void test_timewarp_page(void){
2221 Stmt q;
 
2222
2223 login_check_credentials();
2224 if( !g.perm.Read || !g.perm.Hyperlink ){
2225 login_needed(g.anon.Read && g.anon.Hyperlink);
2226 return;
2227 }
2228 style_header("Instances of timewarp");
2229 @ <ul>
2230 db_prepare(&q,
2231 "SELECT blob.uuid "
 
 
 
 
2232 " FROM plink p, plink c, blob"
2233 " WHERE p.cid=c.pid AND p.mtime>c.mtime"
2234 " AND blob.rid=c.cid"
 
2235 );
2236 while( db_step(&q)==SQLITE_ROW ){
2237 const char *zUuid = db_column_text(&q, 0);
 
 
 
 
 
2238 @ <li>
2239 @ <a href="%R/timeline?dp=%!S(zUuid)&amp;unhide">%S(zUuid)</a>
 
 
 
2240 }
2241 db_finalize(&q);
 
 
 
 
 
2242 style_footer();
2243 }
2244
--- src/timeline.c
+++ src/timeline.c
@@ -2208,36 +2208,54 @@
2208 }
2209 db_finalize(&q);
2210 }
2211
2212 /*
2213 ** WEBPAGE: timewarps
2214 **
2215 ** Show all check-ins that are "timewarps". A timewarp is a
2216 ** check-in that occurs before its parent, according to the
2217 ** timestamp information on the check-in. This can only actually
2218 ** happen, of course, if a users system clock is set incorrectly.
2219 */
2220 void test_timewarp_page(void){
2221 Stmt q;
2222 int cnt = 0;
2223
2224 login_check_credentials();
2225 if( !g.perm.Read || !g.perm.Hyperlink ){
2226 login_needed(g.anon.Read && g.anon.Hyperlink);
2227 return;
2228 }
2229 style_header("Instances of timewarp");
 
2230 db_prepare(&q,
2231 "SELECT blob.uuid, "
2232 " (SELECT date(mtime) FROM event WHERE objid=c.cid),"
2233 " EXISTS(SELECT 1 FROM event a, event b"
2234 " WHERE a.objid=p.cid AND b.objid=c.cid"
2235 " AND a.mtime>b.mtime)"
2236 " FROM plink p, plink c, blob"
2237 " WHERE p.cid=c.pid AND p.mtime>c.mtime"
2238 " AND blob.rid=c.cid"
2239 " ORDER BY 2 DESC"
2240 );
2241 while( db_step(&q)==SQLITE_ROW ){
2242 const char *zUuid = db_column_text(&q, 0);
2243 const char *zDate = db_column_text(&q, 1);
2244 if( cnt==0 ){
2245 @ <ul>
2246 }
2247 cnt++;
2248 @ <li>
2249 @ <a href="%R/timeline?c=%!S(zUuid)&amp;unhide">%s(zDate) %S(zUuid)</a>
2250 if( db_column_int(&q,2)==0 ){
2251 @ <i>(Resolved by editing the date)</i>
2252 }
2253 }
2254 db_finalize(&q);
2255 if( cnt==0 ){
2256 @ <p>No timewarps in this repository</p>
2257 }else{
2258 @ </ul>
2259 }
2260 style_footer();
2261 }
2262

Keyboard Shortcuts

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