Fossil SCM
Enhance the "whatis" command to report on attachments and to include raw tags so that cluster artifacts are identified. Add the "test-whatis-all" command to run "whatis" on every artifact in the repository.
Commit
5cdc39dc2d532b4d5b308bb0a1ff191f2c5b098d
Parent
933904fe703a116…
2 files changed
+1
+107
-19
+1
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -36,10 +36,11 @@ | ||
| 36 | 36 | int doIndent = 0; |
| 37 | 37 | char *zBuf; |
| 38 | 38 | char zBuffer[400]; |
| 39 | 39 | int lineCnt = 0; |
| 40 | 40 | |
| 41 | + if( zText==0 ) zText = "(NULL)"; | |
| 41 | 42 | if( tlen<=0 ){ |
| 42 | 43 | tlen = strlen(zText); |
| 43 | 44 | } |
| 44 | 45 | if( tlen >= (sizeof(zBuffer)) ){ |
| 45 | 46 | zBuf = fossil_malloc(tlen+1); |
| 46 | 47 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -36,10 +36,11 @@ | |
| 36 | int doIndent = 0; |
| 37 | char *zBuf; |
| 38 | char zBuffer[400]; |
| 39 | int lineCnt = 0; |
| 40 | |
| 41 | if( tlen<=0 ){ |
| 42 | tlen = strlen(zText); |
| 43 | } |
| 44 | if( tlen >= (sizeof(zBuffer)) ){ |
| 45 | zBuf = fossil_malloc(tlen+1); |
| 46 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -36,10 +36,11 @@ | |
| 36 | int doIndent = 0; |
| 37 | char *zBuf; |
| 38 | char zBuffer[400]; |
| 39 | int lineCnt = 0; |
| 40 | |
| 41 | if( zText==0 ) zText = "(NULL)"; |
| 42 | if( tlen<=0 ){ |
| 43 | tlen = strlen(zText); |
| 44 | } |
| 45 | if( tlen >= (sizeof(zBuffer)) ){ |
| 46 | zBuf = fossil_malloc(tlen+1); |
| 47 |
+107
-19
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -439,36 +439,69 @@ | ||
| 439 | 439 | /* |
| 440 | 440 | ** Generate a description of artifact "rid" |
| 441 | 441 | */ |
| 442 | 442 | static void whatis_rid(int rid, int verboseFlag){ |
| 443 | 443 | Stmt q; |
| 444 | + int cnt; | |
| 445 | + | |
| 446 | + /* Basic information about the object. */ | |
| 444 | 447 | db_prepare(&q, |
| 445 | - "SELECT uuid, size, datetime(mtime%s), ipaddr," | |
| 446 | - " (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref" | |
| 447 | - " WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid" | |
| 448 | - " AND tagxref.rid=blob.rid AND tagxref.tagtype>0)" | |
| 448 | + "SELECT uuid, size, datetime(mtime%s), ipaddr" | |
| 449 | 449 | " FROM blob, rcvfrom" |
| 450 | 450 | " WHERE rid=%d" |
| 451 | 451 | " AND rcvfrom.rcvid=blob.rcvid", |
| 452 | 452 | timeline_utc(), rid); |
| 453 | 453 | if( db_step(&q)==SQLITE_ROW ){ |
| 454 | 454 | const char *zTagList = db_column_text(&q, 4); |
| 455 | 455 | if( verboseFlag ){ |
| 456 | - fossil_print("artifact: %s (%d)\n", db_column_text(&q,0), rid); | |
| 457 | - fossil_print("size: %d bytes\n", db_column_int(&q,1)); | |
| 458 | - fossil_print("received: %s from %s\n", | |
| 456 | + fossil_print("artifact: %s (%d)\n", db_column_text(&q,0), rid); | |
| 457 | + fossil_print("size: %d bytes\n", db_column_int(&q,1)); | |
| 458 | + fossil_print("received: %s from %s\n", | |
| 459 | 459 | db_column_text(&q, 2), |
| 460 | 460 | db_column_text(&q, 3)); |
| 461 | 461 | }else{ |
| 462 | - fossil_print("artifact: %s\n", db_column_text(&q,0)); | |
| 463 | - fossil_print("size: %d bytes\n", db_column_int(&q,1)); | |
| 464 | - } | |
| 465 | - if( zTagList && zTagList[0] ){ | |
| 466 | - fossil_print("tags: %s\n", zTagList); | |
| 462 | + fossil_print("artifact: %s\n", db_column_text(&q,0)); | |
| 463 | + fossil_print("size: %d bytes\n", db_column_int(&q,1)); | |
| 467 | 464 | } |
| 468 | 465 | } |
| 469 | 466 | db_finalize(&q); |
| 467 | + | |
| 468 | + /* Report any symbolic tags on this artifact */ | |
| 469 | + db_prepare(&q, | |
| 470 | + "SELECT substr(tagname,5)" | |
| 471 | + " FROM tag JOIN tagxref ON tag.tagid=tagxref.tagid" | |
| 472 | + " WHERE tagxref.rid=%d" | |
| 473 | + " AND tagname GLOB 'sym-*'" | |
| 474 | + " ORDER BY 1", | |
| 475 | + rid | |
| 476 | + ); | |
| 477 | + cnt = 0; | |
| 478 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 479 | + const char *zPrefix = cnt++ ? ", " : "tags: "; | |
| 480 | + fossil_print("%s%s", zPrefix, db_column_text(&q,0)); | |
| 481 | + } | |
| 482 | + if( cnt ) fossil_print("\n"); | |
| 483 | + db_finalize(&q); | |
| 484 | + | |
| 485 | + /* Report any HIDDEN, PRIVATE, CLUSTER, or CLOSED tags on this artifact */ | |
| 486 | + db_prepare(&q, | |
| 487 | + "SELECT tagname" | |
| 488 | + " FROM tag JOIN tagxref ON tag.tagid=tagxref.tagid" | |
| 489 | + " WHERE tagxref.rid=%d" | |
| 490 | + " AND tag.tagid IN (5,6,7,9)" | |
| 491 | + " ORDER BY 1", | |
| 492 | + rid, rid | |
| 493 | + ); | |
| 494 | + cnt = 0; | |
| 495 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 496 | + const char *zPrefix = cnt++ ? ", " : "raw-tags: "; | |
| 497 | + fossil_print("%s%s", zPrefix, db_column_text(&q,0)); | |
| 498 | + } | |
| 499 | + if( cnt ) fossil_print("\n"); | |
| 500 | + db_finalize(&q); | |
| 501 | + | |
| 502 | + /* Check for entries on the timeline that reference this object */ | |
| 470 | 503 | db_prepare(&q, |
| 471 | 504 | "SELECT type, datetime(mtime%s)," |
| 472 | 505 | " coalesce(euser,user), coalesce(ecomment,comment)" |
| 473 | 506 | " FROM event WHERE objid=%d", timeline_utc(), rid); |
| 474 | 507 | if( db_step(&q)==SQLITE_ROW ){ |
| @@ -479,16 +512,18 @@ | ||
| 479 | 512 | case 'e': zType = "Event"; break; |
| 480 | 513 | case 't': zType = "Ticket-change"; break; |
| 481 | 514 | case 'g': zType = "Tag-change"; break; |
| 482 | 515 | default: zType = "Unknown"; break; |
| 483 | 516 | } |
| 484 | - fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), | |
| 517 | + fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), | |
| 485 | 518 | db_column_text(&q, 1)); |
| 486 | - fossil_print("comment: "); | |
| 487 | - comment_print(db_column_text(&q,3), 10, 78); | |
| 519 | + fossil_print("comment: "); | |
| 520 | + comment_print(db_column_text(&q,3), 12, 78); | |
| 488 | 521 | } |
| 489 | 522 | db_finalize(&q); |
| 523 | + | |
| 524 | + /* Check to see if this object is used as a file in a check-in */ | |
| 490 | 525 | db_prepare(&q, |
| 491 | 526 | "SELECT filename.name, blob.uuid, datetime(event.mtime%s)," |
| 492 | 527 | " coalesce(euser,user), coalesce(ecomment,comment)" |
| 493 | 528 | " FROM mlink, filename, blob, event" |
| 494 | 529 | " WHERE mlink.fid=%d" |
| @@ -496,17 +531,52 @@ | ||
| 496 | 531 | " AND event.objid=mlink.mid" |
| 497 | 532 | " AND blob.rid=mlink.mid" |
| 498 | 533 | " ORDER BY event.mtime DESC /*sort*/", |
| 499 | 534 | timeline_utc(), rid); |
| 500 | 535 | while( db_step(&q)==SQLITE_ROW ){ |
| 501 | - fossil_print("file: %s\n", db_column_text(&q,0)); | |
| 502 | - fossil_print(" part of [%.10s] by %s on %s\n", | |
| 536 | + fossil_print("file: %s\n", db_column_text(&q,0)); | |
| 537 | + fossil_print(" part of [%.10s] by %s on %s\n", | |
| 503 | 538 | db_column_text(&q, 1), |
| 504 | 539 | db_column_text(&q, 3), |
| 505 | 540 | db_column_text(&q, 2)); |
| 506 | - fossil_print(" "); | |
| 507 | - comment_print(db_column_text(&q,4), 10, 78); | |
| 541 | + fossil_print(" "); | |
| 542 | + comment_print(db_column_text(&q,4), 12, 78); | |
| 543 | + } | |
| 544 | + db_finalize(&q); | |
| 545 | + | |
| 546 | + /* Check to see if this object is used as an attachment */ | |
| 547 | + db_prepare(&q, | |
| 548 | + "SELECT attachment.filename," | |
| 549 | + " attachment.comment," | |
| 550 | + " attachment.user," | |
| 551 | + " datetime(attachment.mtime%s)," | |
| 552 | + " attachment.target," | |
| 553 | + " CASE WHEN EXISTS(SELECT 1 FROM tag WHERE tagname=('tkt-'||target))" | |
| 554 | + " THEN 'ticket'" | |
| 555 | + " WHEN EXISTS(SELECT 1 FROM tag WHERE tagname=('wiki-'||target))" | |
| 556 | + " THEN 'wiki' END," | |
| 557 | + " attachment.attachid," | |
| 558 | + " (SELECT uuid FROM blob WHERE rid=attachid)" | |
| 559 | + " FROM attachment JOIN blob ON attachment.src=blob.uuid" | |
| 560 | + " WHERE blob.rid=%d", | |
| 561 | + timeline_utc(), rid | |
| 562 | + ); | |
| 563 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 564 | + fossil_print("attachment: %s\n", db_column_text(&q,0)); | |
| 565 | + fossil_print(" attached to %s %s\n", | |
| 566 | + db_column_text(&q,5), db_column_text(&q,4)); | |
| 567 | + if( verboseFlag ){ | |
| 568 | + fossil_print(" via %s (%d)\n", | |
| 569 | + db_column_text(&q,7), db_column_int(&q,6)); | |
| 570 | + }else{ | |
| 571 | + fossil_print(" via %s\n", | |
| 572 | + db_column_text(&q,7)); | |
| 573 | + } | |
| 574 | + fossil_print(" by user %s on %s\n", | |
| 575 | + db_column_text(&q,2), db_column_text(&q,3)); | |
| 576 | + fossil_print(" "); | |
| 577 | + comment_print(db_column_text(&q,1), 12, 78); | |
| 508 | 578 | } |
| 509 | 579 | db_finalize(&q); |
| 510 | 580 | } |
| 511 | 581 | |
| 512 | 582 | /* |
| @@ -543,5 +613,23 @@ | ||
| 543 | 613 | fossil_print("Unknown artifact: %s\n", zName); |
| 544 | 614 | }else{ |
| 545 | 615 | whatis_rid(rid, verboseFlag); |
| 546 | 616 | } |
| 547 | 617 | } |
| 618 | + | |
| 619 | +/* | |
| 620 | +** COMMAND: test-whatis-all | |
| 621 | +** Usage: %fossil test-whatis-all | |
| 622 | +** | |
| 623 | +** Show "whatis" information about every artifact in the repository | |
| 624 | +*/ | |
| 625 | +void test_whatis_all_cmd(void){ | |
| 626 | + Stmt q; | |
| 627 | + int cnt = 0; | |
| 628 | + db_find_and_open_repository(0,0); | |
| 629 | + db_prepare(&q, "SELECT rid FROM blob ORDER BY rid"); | |
| 630 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 631 | + if( cnt++ ) fossil_print("%.79c\n", '-'); | |
| 632 | + whatis_rid(db_column_int(&q,0), 1); | |
| 633 | + } | |
| 634 | + db_finalize(&q); | |
| 635 | +} | |
| 548 | 636 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -439,36 +439,69 @@ | |
| 439 | /* |
| 440 | ** Generate a description of artifact "rid" |
| 441 | */ |
| 442 | static void whatis_rid(int rid, int verboseFlag){ |
| 443 | Stmt q; |
| 444 | db_prepare(&q, |
| 445 | "SELECT uuid, size, datetime(mtime%s), ipaddr," |
| 446 | " (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref" |
| 447 | " WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid" |
| 448 | " AND tagxref.rid=blob.rid AND tagxref.tagtype>0)" |
| 449 | " FROM blob, rcvfrom" |
| 450 | " WHERE rid=%d" |
| 451 | " AND rcvfrom.rcvid=blob.rcvid", |
| 452 | timeline_utc(), rid); |
| 453 | if( db_step(&q)==SQLITE_ROW ){ |
| 454 | const char *zTagList = db_column_text(&q, 4); |
| 455 | if( verboseFlag ){ |
| 456 | fossil_print("artifact: %s (%d)\n", db_column_text(&q,0), rid); |
| 457 | fossil_print("size: %d bytes\n", db_column_int(&q,1)); |
| 458 | fossil_print("received: %s from %s\n", |
| 459 | db_column_text(&q, 2), |
| 460 | db_column_text(&q, 3)); |
| 461 | }else{ |
| 462 | fossil_print("artifact: %s\n", db_column_text(&q,0)); |
| 463 | fossil_print("size: %d bytes\n", db_column_int(&q,1)); |
| 464 | } |
| 465 | if( zTagList && zTagList[0] ){ |
| 466 | fossil_print("tags: %s\n", zTagList); |
| 467 | } |
| 468 | } |
| 469 | db_finalize(&q); |
| 470 | db_prepare(&q, |
| 471 | "SELECT type, datetime(mtime%s)," |
| 472 | " coalesce(euser,user), coalesce(ecomment,comment)" |
| 473 | " FROM event WHERE objid=%d", timeline_utc(), rid); |
| 474 | if( db_step(&q)==SQLITE_ROW ){ |
| @@ -479,16 +512,18 @@ | |
| 479 | case 'e': zType = "Event"; break; |
| 480 | case 't': zType = "Ticket-change"; break; |
| 481 | case 'g': zType = "Tag-change"; break; |
| 482 | default: zType = "Unknown"; break; |
| 483 | } |
| 484 | fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), |
| 485 | db_column_text(&q, 1)); |
| 486 | fossil_print("comment: "); |
| 487 | comment_print(db_column_text(&q,3), 10, 78); |
| 488 | } |
| 489 | db_finalize(&q); |
| 490 | db_prepare(&q, |
| 491 | "SELECT filename.name, blob.uuid, datetime(event.mtime%s)," |
| 492 | " coalesce(euser,user), coalesce(ecomment,comment)" |
| 493 | " FROM mlink, filename, blob, event" |
| 494 | " WHERE mlink.fid=%d" |
| @@ -496,17 +531,52 @@ | |
| 496 | " AND event.objid=mlink.mid" |
| 497 | " AND blob.rid=mlink.mid" |
| 498 | " ORDER BY event.mtime DESC /*sort*/", |
| 499 | timeline_utc(), rid); |
| 500 | while( db_step(&q)==SQLITE_ROW ){ |
| 501 | fossil_print("file: %s\n", db_column_text(&q,0)); |
| 502 | fossil_print(" part of [%.10s] by %s on %s\n", |
| 503 | db_column_text(&q, 1), |
| 504 | db_column_text(&q, 3), |
| 505 | db_column_text(&q, 2)); |
| 506 | fossil_print(" "); |
| 507 | comment_print(db_column_text(&q,4), 10, 78); |
| 508 | } |
| 509 | db_finalize(&q); |
| 510 | } |
| 511 | |
| 512 | /* |
| @@ -543,5 +613,23 @@ | |
| 543 | fossil_print("Unknown artifact: %s\n", zName); |
| 544 | }else{ |
| 545 | whatis_rid(rid, verboseFlag); |
| 546 | } |
| 547 | } |
| 548 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -439,36 +439,69 @@ | |
| 439 | /* |
| 440 | ** Generate a description of artifact "rid" |
| 441 | */ |
| 442 | static void whatis_rid(int rid, int verboseFlag){ |
| 443 | Stmt q; |
| 444 | int cnt; |
| 445 | |
| 446 | /* Basic information about the object. */ |
| 447 | db_prepare(&q, |
| 448 | "SELECT uuid, size, datetime(mtime%s), ipaddr" |
| 449 | " FROM blob, rcvfrom" |
| 450 | " WHERE rid=%d" |
| 451 | " AND rcvfrom.rcvid=blob.rcvid", |
| 452 | timeline_utc(), rid); |
| 453 | if( db_step(&q)==SQLITE_ROW ){ |
| 454 | const char *zTagList = db_column_text(&q, 4); |
| 455 | if( verboseFlag ){ |
| 456 | fossil_print("artifact: %s (%d)\n", db_column_text(&q,0), rid); |
| 457 | fossil_print("size: %d bytes\n", db_column_int(&q,1)); |
| 458 | fossil_print("received: %s from %s\n", |
| 459 | db_column_text(&q, 2), |
| 460 | db_column_text(&q, 3)); |
| 461 | }else{ |
| 462 | fossil_print("artifact: %s\n", db_column_text(&q,0)); |
| 463 | fossil_print("size: %d bytes\n", db_column_int(&q,1)); |
| 464 | } |
| 465 | } |
| 466 | db_finalize(&q); |
| 467 | |
| 468 | /* Report any symbolic tags on this artifact */ |
| 469 | db_prepare(&q, |
| 470 | "SELECT substr(tagname,5)" |
| 471 | " FROM tag JOIN tagxref ON tag.tagid=tagxref.tagid" |
| 472 | " WHERE tagxref.rid=%d" |
| 473 | " AND tagname GLOB 'sym-*'" |
| 474 | " ORDER BY 1", |
| 475 | rid |
| 476 | ); |
| 477 | cnt = 0; |
| 478 | while( db_step(&q)==SQLITE_ROW ){ |
| 479 | const char *zPrefix = cnt++ ? ", " : "tags: "; |
| 480 | fossil_print("%s%s", zPrefix, db_column_text(&q,0)); |
| 481 | } |
| 482 | if( cnt ) fossil_print("\n"); |
| 483 | db_finalize(&q); |
| 484 | |
| 485 | /* Report any HIDDEN, PRIVATE, CLUSTER, or CLOSED tags on this artifact */ |
| 486 | db_prepare(&q, |
| 487 | "SELECT tagname" |
| 488 | " FROM tag JOIN tagxref ON tag.tagid=tagxref.tagid" |
| 489 | " WHERE tagxref.rid=%d" |
| 490 | " AND tag.tagid IN (5,6,7,9)" |
| 491 | " ORDER BY 1", |
| 492 | rid, rid |
| 493 | ); |
| 494 | cnt = 0; |
| 495 | while( db_step(&q)==SQLITE_ROW ){ |
| 496 | const char *zPrefix = cnt++ ? ", " : "raw-tags: "; |
| 497 | fossil_print("%s%s", zPrefix, db_column_text(&q,0)); |
| 498 | } |
| 499 | if( cnt ) fossil_print("\n"); |
| 500 | db_finalize(&q); |
| 501 | |
| 502 | /* Check for entries on the timeline that reference this object */ |
| 503 | db_prepare(&q, |
| 504 | "SELECT type, datetime(mtime%s)," |
| 505 | " coalesce(euser,user), coalesce(ecomment,comment)" |
| 506 | " FROM event WHERE objid=%d", timeline_utc(), rid); |
| 507 | if( db_step(&q)==SQLITE_ROW ){ |
| @@ -479,16 +512,18 @@ | |
| 512 | case 'e': zType = "Event"; break; |
| 513 | case 't': zType = "Ticket-change"; break; |
| 514 | case 'g': zType = "Tag-change"; break; |
| 515 | default: zType = "Unknown"; break; |
| 516 | } |
| 517 | fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), |
| 518 | db_column_text(&q, 1)); |
| 519 | fossil_print("comment: "); |
| 520 | comment_print(db_column_text(&q,3), 12, 78); |
| 521 | } |
| 522 | db_finalize(&q); |
| 523 | |
| 524 | /* Check to see if this object is used as a file in a check-in */ |
| 525 | db_prepare(&q, |
| 526 | "SELECT filename.name, blob.uuid, datetime(event.mtime%s)," |
| 527 | " coalesce(euser,user), coalesce(ecomment,comment)" |
| 528 | " FROM mlink, filename, blob, event" |
| 529 | " WHERE mlink.fid=%d" |
| @@ -496,17 +531,52 @@ | |
| 531 | " AND event.objid=mlink.mid" |
| 532 | " AND blob.rid=mlink.mid" |
| 533 | " ORDER BY event.mtime DESC /*sort*/", |
| 534 | timeline_utc(), rid); |
| 535 | while( db_step(&q)==SQLITE_ROW ){ |
| 536 | fossil_print("file: %s\n", db_column_text(&q,0)); |
| 537 | fossil_print(" part of [%.10s] by %s on %s\n", |
| 538 | db_column_text(&q, 1), |
| 539 | db_column_text(&q, 3), |
| 540 | db_column_text(&q, 2)); |
| 541 | fossil_print(" "); |
| 542 | comment_print(db_column_text(&q,4), 12, 78); |
| 543 | } |
| 544 | db_finalize(&q); |
| 545 | |
| 546 | /* Check to see if this object is used as an attachment */ |
| 547 | db_prepare(&q, |
| 548 | "SELECT attachment.filename," |
| 549 | " attachment.comment," |
| 550 | " attachment.user," |
| 551 | " datetime(attachment.mtime%s)," |
| 552 | " attachment.target," |
| 553 | " CASE WHEN EXISTS(SELECT 1 FROM tag WHERE tagname=('tkt-'||target))" |
| 554 | " THEN 'ticket'" |
| 555 | " WHEN EXISTS(SELECT 1 FROM tag WHERE tagname=('wiki-'||target))" |
| 556 | " THEN 'wiki' END," |
| 557 | " attachment.attachid," |
| 558 | " (SELECT uuid FROM blob WHERE rid=attachid)" |
| 559 | " FROM attachment JOIN blob ON attachment.src=blob.uuid" |
| 560 | " WHERE blob.rid=%d", |
| 561 | timeline_utc(), rid |
| 562 | ); |
| 563 | while( db_step(&q)==SQLITE_ROW ){ |
| 564 | fossil_print("attachment: %s\n", db_column_text(&q,0)); |
| 565 | fossil_print(" attached to %s %s\n", |
| 566 | db_column_text(&q,5), db_column_text(&q,4)); |
| 567 | if( verboseFlag ){ |
| 568 | fossil_print(" via %s (%d)\n", |
| 569 | db_column_text(&q,7), db_column_int(&q,6)); |
| 570 | }else{ |
| 571 | fossil_print(" via %s\n", |
| 572 | db_column_text(&q,7)); |
| 573 | } |
| 574 | fossil_print(" by user %s on %s\n", |
| 575 | db_column_text(&q,2), db_column_text(&q,3)); |
| 576 | fossil_print(" "); |
| 577 | comment_print(db_column_text(&q,1), 12, 78); |
| 578 | } |
| 579 | db_finalize(&q); |
| 580 | } |
| 581 | |
| 582 | /* |
| @@ -543,5 +613,23 @@ | |
| 613 | fossil_print("Unknown artifact: %s\n", zName); |
| 614 | }else{ |
| 615 | whatis_rid(rid, verboseFlag); |
| 616 | } |
| 617 | } |
| 618 | |
| 619 | /* |
| 620 | ** COMMAND: test-whatis-all |
| 621 | ** Usage: %fossil test-whatis-all |
| 622 | ** |
| 623 | ** Show "whatis" information about every artifact in the repository |
| 624 | */ |
| 625 | void test_whatis_all_cmd(void){ |
| 626 | Stmt q; |
| 627 | int cnt = 0; |
| 628 | db_find_and_open_repository(0,0); |
| 629 | db_prepare(&q, "SELECT rid FROM blob ORDER BY rid"); |
| 630 | while( db_step(&q)==SQLITE_ROW ){ |
| 631 | if( cnt++ ) fossil_print("%.79c\n", '-'); |
| 632 | whatis_rid(db_column_int(&q,0), 1); |
| 633 | } |
| 634 | db_finalize(&q); |
| 635 | } |
| 636 |