Fossil SCM
Add the test-timewarp-list command and the test_timewarp web page.
Commit
a327bd29bcc567a7cebfba226d269498fdd4fab3
Parent
feaab7baf1c424e…
1 file changed
+50
+50
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1313,5 +1313,55 @@ | ||
| 1313 | 1313 | return gmtime(clock); |
| 1314 | 1314 | }else{ |
| 1315 | 1315 | return localtime(clock); |
| 1316 | 1316 | } |
| 1317 | 1317 | } |
| 1318 | + | |
| 1319 | + | |
| 1320 | +/* | |
| 1321 | +** COMMAND: test-timewarp-list | |
| 1322 | +** | |
| 1323 | +** Usage: %fossil test-timewarp-list | |
| 1324 | +** | |
| 1325 | +** Display all instances of child checkins that appear earlier in time | |
| 1326 | +** than their parent. | |
| 1327 | +*/ | |
| 1328 | +void test_timewarp_cmd(void){ | |
| 1329 | + Stmt q; | |
| 1330 | + | |
| 1331 | + db_find_and_open_repository(0, 0); | |
| 1332 | + db_prepare(&q, | |
| 1333 | + "SELECT blob.uuid " | |
| 1334 | + " FROM plink p, plink c, blob" | |
| 1335 | + " WHERE p.cid=c.pid AND p.mtime>c.mtime" | |
| 1336 | + " AND blob.rid=c.pid" | |
| 1337 | + ); | |
| 1338 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 1339 | + printf("%s\n", db_column_text(&q, 0)); | |
| 1340 | + } | |
| 1341 | + db_finalize(&q); | |
| 1342 | +} | |
| 1343 | + | |
| 1344 | +/* | |
| 1345 | +** WEBPAGE: test_timewarps | |
| 1346 | +*/ | |
| 1347 | +void test_timewarp_page(void){ | |
| 1348 | + Stmt q; | |
| 1349 | + | |
| 1350 | + login_check_credentials(); | |
| 1351 | + if( !g.okRead || !g.okHistory ){ login_needed(); return; } | |
| 1352 | + style_header("Instances of timewarp"); | |
| 1353 | + @ <ul> | |
| 1354 | + db_prepare(&q, | |
| 1355 | + "SELECT blob.uuid " | |
| 1356 | + " FROM plink p, plink c, blob" | |
| 1357 | + " WHERE p.cid=c.pid AND p.mtime>c.mtime" | |
| 1358 | + " AND blob.rid=c.pid" | |
| 1359 | + ); | |
| 1360 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 1361 | + const char *zUuid = db_column_text(&q, 0); | |
| 1362 | + @ <li> | |
| 1363 | + @ <a href="%s(g.zTop)/timeline?p=%S(zUuid)&d=%S(zUuid)">%S(zUuid)</a> | |
| 1364 | + } | |
| 1365 | + db_finalize(&q); | |
| 1366 | + style_footer(); | |
| 1367 | +} | |
| 1318 | 1368 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1313,5 +1313,55 @@ | |
| 1313 | return gmtime(clock); |
| 1314 | }else{ |
| 1315 | return localtime(clock); |
| 1316 | } |
| 1317 | } |
| 1318 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1313,5 +1313,55 @@ | |
| 1313 | return gmtime(clock); |
| 1314 | }else{ |
| 1315 | return localtime(clock); |
| 1316 | } |
| 1317 | } |
| 1318 | |
| 1319 | |
| 1320 | /* |
| 1321 | ** COMMAND: test-timewarp-list |
| 1322 | ** |
| 1323 | ** Usage: %fossil test-timewarp-list |
| 1324 | ** |
| 1325 | ** Display all instances of child checkins that appear earlier in time |
| 1326 | ** than their parent. |
| 1327 | */ |
| 1328 | void test_timewarp_cmd(void){ |
| 1329 | Stmt q; |
| 1330 | |
| 1331 | db_find_and_open_repository(0, 0); |
| 1332 | db_prepare(&q, |
| 1333 | "SELECT blob.uuid " |
| 1334 | " FROM plink p, plink c, blob" |
| 1335 | " WHERE p.cid=c.pid AND p.mtime>c.mtime" |
| 1336 | " AND blob.rid=c.pid" |
| 1337 | ); |
| 1338 | while( db_step(&q)==SQLITE_ROW ){ |
| 1339 | printf("%s\n", db_column_text(&q, 0)); |
| 1340 | } |
| 1341 | db_finalize(&q); |
| 1342 | } |
| 1343 | |
| 1344 | /* |
| 1345 | ** WEBPAGE: test_timewarps |
| 1346 | */ |
| 1347 | void test_timewarp_page(void){ |
| 1348 | Stmt q; |
| 1349 | |
| 1350 | login_check_credentials(); |
| 1351 | if( !g.okRead || !g.okHistory ){ login_needed(); return; } |
| 1352 | style_header("Instances of timewarp"); |
| 1353 | @ <ul> |
| 1354 | db_prepare(&q, |
| 1355 | "SELECT blob.uuid " |
| 1356 | " FROM plink p, plink c, blob" |
| 1357 | " WHERE p.cid=c.pid AND p.mtime>c.mtime" |
| 1358 | " AND blob.rid=c.pid" |
| 1359 | ); |
| 1360 | while( db_step(&q)==SQLITE_ROW ){ |
| 1361 | const char *zUuid = db_column_text(&q, 0); |
| 1362 | @ <li> |
| 1363 | @ <a href="%s(g.zTop)/timeline?p=%S(zUuid)&d=%S(zUuid)">%S(zUuid)</a> |
| 1364 | } |
| 1365 | db_finalize(&q); |
| 1366 | style_footer(); |
| 1367 | } |
| 1368 |