Fossil SCM

Add the --detail option to the test-timewarp-list command.

drh 2011-02-11 20:53 trunk
Commit e7b6434112be8a00ef00f2a5ca7f1d483a5df79f
1 file changed +18 -6
+18 -6
--- src/timeline.c
+++ src/timeline.c
@@ -1326,27 +1326,39 @@
13261326
13271327
13281328
/*
13291329
** COMMAND: test-timewarp-list
13301330
**
1331
-** Usage: %fossil test-timewarp-list
1331
+** Usage: %fossil test-timewarp-list ?--detail?
13321332
**
13331333
** 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.
13351336
*/
13361337
void test_timewarp_cmd(void){
13371338
Stmt q;
1339
+ int showDetail;
13381340
13391341
db_find_and_open_repository(0, 0);
1342
+ showDetail = find_option("detail", 0, 0)!=0;
13401343
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"
13431348
" WHERE p.cid=c.pid AND p.mtime>c.mtime"
1344
- " AND blob.rid=c.cid"
13451349
);
13461350
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
+ }
13481360
}
13491361
db_finalize(&q);
13501362
}
13511363
13521364
/*
13531365
--- 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

Keyboard Shortcuts

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