Fossil SCM
Add the --detail option to the test-timewarp-list command.
Commit
e7b6434112be8a00ef00f2a5ca7f1d483a5df79f
Parent
1d83ecc5d5b05e3…
1 file changed
+18
-6
+18
-6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1326,27 +1326,39 @@ | ||
| 1326 | 1326 | |
| 1327 | 1327 | |
| 1328 | 1328 | /* |
| 1329 | 1329 | ** COMMAND: test-timewarp-list |
| 1330 | 1330 | ** |
| 1331 | -** Usage: %fossil test-timewarp-list | |
| 1331 | +** Usage: %fossil test-timewarp-list ?--detail? | |
| 1332 | 1332 | ** |
| 1333 | 1333 | ** Display all instances of child checkins that appear earlier in time |
| 1334 | -** than their parent. | |
| 1334 | +** than their parent. If the --detail option is provided, both the | |
| 1335 | +** parent and child checking and their times are shown. | |
| 1335 | 1336 | */ |
| 1336 | 1337 | void test_timewarp_cmd(void){ |
| 1337 | 1338 | Stmt q; |
| 1339 | + int showDetail; | |
| 1338 | 1340 | |
| 1339 | 1341 | db_find_and_open_repository(0, 0); |
| 1342 | + showDetail = find_option("detail", 0, 0)!=0; | |
| 1340 | 1343 | db_prepare(&q, |
| 1341 | - "SELECT blob.uuid " | |
| 1342 | - " FROM plink p, plink c, blob" | |
| 1344 | + "SELECT (SELECT uuid FROM blob WHERE rid=p.cid)," | |
| 1345 | + " (SELECT uuid FROM blob WHERE rid=c.cid)," | |
| 1346 | + " datetime(p.mtime), datetime(c.mtime)" | |
| 1347 | + " FROM plink p, plink c" | |
| 1343 | 1348 | " WHERE p.cid=c.pid AND p.mtime>c.mtime" |
| 1344 | - " AND blob.rid=c.cid" | |
| 1345 | 1349 | ); |
| 1346 | 1350 | while( db_step(&q)==SQLITE_ROW ){ |
| 1347 | - printf("%s\n", db_column_text(&q, 0)); | |
| 1351 | + if( !showDetail ){ | |
| 1352 | + printf("%s\n", db_column_text(&q, 1)); | |
| 1353 | + }else{ | |
| 1354 | + printf("%.14s -> %.14s %s -> %s\n", | |
| 1355 | + db_column_text(&q, 0), | |
| 1356 | + db_column_text(&q, 1), | |
| 1357 | + db_column_text(&q, 2), | |
| 1358 | + db_column_text(&q, 3)); | |
| 1359 | + } | |
| 1348 | 1360 | } |
| 1349 | 1361 | db_finalize(&q); |
| 1350 | 1362 | } |
| 1351 | 1363 | |
| 1352 | 1364 | /* |
| 1353 | 1365 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1326,27 +1326,39 @@ | |
| 1326 | |
| 1327 | |
| 1328 | /* |
| 1329 | ** COMMAND: test-timewarp-list |
| 1330 | ** |
| 1331 | ** Usage: %fossil test-timewarp-list |
| 1332 | ** |
| 1333 | ** Display all instances of child checkins that appear earlier in time |
| 1334 | ** than their parent. |
| 1335 | */ |
| 1336 | void test_timewarp_cmd(void){ |
| 1337 | Stmt q; |
| 1338 | |
| 1339 | db_find_and_open_repository(0, 0); |
| 1340 | db_prepare(&q, |
| 1341 | "SELECT blob.uuid " |
| 1342 | " FROM plink p, plink c, blob" |
| 1343 | " WHERE p.cid=c.pid AND p.mtime>c.mtime" |
| 1344 | " AND blob.rid=c.cid" |
| 1345 | ); |
| 1346 | while( db_step(&q)==SQLITE_ROW ){ |
| 1347 | printf("%s\n", db_column_text(&q, 0)); |
| 1348 | } |
| 1349 | db_finalize(&q); |
| 1350 | } |
| 1351 | |
| 1352 | /* |
| 1353 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1326,27 +1326,39 @@ | |
| 1326 | |
| 1327 | |
| 1328 | /* |
| 1329 | ** COMMAND: test-timewarp-list |
| 1330 | ** |
| 1331 | ** Usage: %fossil test-timewarp-list ?--detail? |
| 1332 | ** |
| 1333 | ** Display all instances of child checkins that appear earlier in time |
| 1334 | ** than their parent. If the --detail option is provided, both the |
| 1335 | ** parent and child checking and their times are shown. |
| 1336 | */ |
| 1337 | void test_timewarp_cmd(void){ |
| 1338 | Stmt q; |
| 1339 | int showDetail; |
| 1340 | |
| 1341 | db_find_and_open_repository(0, 0); |
| 1342 | showDetail = find_option("detail", 0, 0)!=0; |
| 1343 | db_prepare(&q, |
| 1344 | "SELECT (SELECT uuid FROM blob WHERE rid=p.cid)," |
| 1345 | " (SELECT uuid FROM blob WHERE rid=c.cid)," |
| 1346 | " datetime(p.mtime), datetime(c.mtime)" |
| 1347 | " FROM plink p, plink c" |
| 1348 | " WHERE p.cid=c.pid AND p.mtime>c.mtime" |
| 1349 | ); |
| 1350 | while( db_step(&q)==SQLITE_ROW ){ |
| 1351 | if( !showDetail ){ |
| 1352 | printf("%s\n", db_column_text(&q, 1)); |
| 1353 | }else{ |
| 1354 | printf("%.14s -> %.14s %s -> %s\n", |
| 1355 | db_column_text(&q, 0), |
| 1356 | db_column_text(&q, 1), |
| 1357 | db_column_text(&q, 2), |
| 1358 | db_column_text(&q, 3)); |
| 1359 | } |
| 1360 | } |
| 1361 | db_finalize(&q); |
| 1362 | } |
| 1363 | |
| 1364 | /* |
| 1365 |