Fossil SCM
Improved /timewarp webpage. Formerly known as /test_timewarp.
Commit
583e2f8f2c641905bacfb24fa02fb06c013cf82a
Parent
292659684c25831…
2 files changed
+1
-1
+22
-4
+1
-1
| --- src/sitemap.c | ||
| +++ src/sitemap.c | ||
| @@ -138,11 +138,11 @@ | ||
| 138 | 138 | @ <ul> |
| 139 | 139 | if( g.perm.Admin || db_get_boolean("test_env_enable",0) ){ |
| 140 | 140 | @ <li>%z(href("%R/test_env"))CGI Environment Test</a></li> |
| 141 | 141 | } |
| 142 | 142 | 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> | |
| 144 | 144 | } |
| 145 | 145 | if( g.perm.Read ){ |
| 146 | 146 | @ <li>%z(href("%R/test-rename-list"))List of file renames</a></li> |
| 147 | 147 | } |
| 148 | 148 | @ <li>%z(href("%R/hash-color-test"))Page to experiment with the automatic |
| 149 | 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/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 @@ | ||
| 2208 | 2208 | } |
| 2209 | 2209 | db_finalize(&q); |
| 2210 | 2210 | } |
| 2211 | 2211 | |
| 2212 | 2212 | /* |
| 2213 | -** WEBPAGE: test_timewarps | |
| 2213 | +** WEBPAGE: timewarps | |
| 2214 | 2214 | ** |
| 2215 | 2215 | ** Show all check-ins that are "timewarps". A timewarp is a |
| 2216 | 2216 | ** check-in that occurs before its parent, according to the |
| 2217 | 2217 | ** timestamp information on the check-in. This can only actually |
| 2218 | 2218 | ** happen, of course, if a users system clock is set incorrectly. |
| 2219 | 2219 | */ |
| 2220 | 2220 | void test_timewarp_page(void){ |
| 2221 | 2221 | Stmt q; |
| 2222 | + int cnt = 0; | |
| 2222 | 2223 | |
| 2223 | 2224 | login_check_credentials(); |
| 2224 | 2225 | if( !g.perm.Read || !g.perm.Hyperlink ){ |
| 2225 | 2226 | login_needed(g.anon.Read && g.anon.Hyperlink); |
| 2226 | 2227 | return; |
| 2227 | 2228 | } |
| 2228 | 2229 | style_header("Instances of timewarp"); |
| 2229 | - @ <ul> | |
| 2230 | 2230 | 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)" | |
| 2232 | 2236 | " FROM plink p, plink c, blob" |
| 2233 | 2237 | " WHERE p.cid=c.pid AND p.mtime>c.mtime" |
| 2234 | 2238 | " AND blob.rid=c.cid" |
| 2239 | + " ORDER BY 2 DESC" | |
| 2235 | 2240 | ); |
| 2236 | 2241 | while( db_step(&q)==SQLITE_ROW ){ |
| 2237 | 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++; | |
| 2238 | 2248 | @ <li> |
| 2239 | - @ <a href="%R/timeline?dp=%!S(zUuid)&unhide">%S(zUuid)</a> | |
| 2249 | + @ <a href="%R/timeline?c=%!S(zUuid)&unhide">%s(zDate) %S(zUuid)</a> | |
| 2250 | + if( db_column_int(&q,2)==0 ){ | |
| 2251 | + @ <i>(Resolved by editing the date)</i> | |
| 2252 | + } | |
| 2240 | 2253 | } |
| 2241 | 2254 | db_finalize(&q); |
| 2255 | + if( cnt==0 ){ | |
| 2256 | + @ <p>No timewarps in this repository</p> | |
| 2257 | + }else{ | |
| 2258 | + @ </ul> | |
| 2259 | + } | |
| 2242 | 2260 | style_footer(); |
| 2243 | 2261 | } |
| 2244 | 2262 |
| --- 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)&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)&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 |