| | @@ -591,10 +591,42 @@ |
| 591 | 591 | "DROP TABLE private_ckin;", TAG_PRIVATE |
| 592 | 592 | ); |
| 593 | 593 | fix_private_blob_dependencies(0); |
| 594 | 594 | } |
| 595 | 595 | |
| 596 | +/* |
| 597 | +** COMMAND: repack |
| 598 | +** |
| 599 | +** Usage: %fossil repack ?REPOSITORY? |
| 600 | +** |
| 601 | +** Perform extra delta-compression to try to minimize the size of the |
| 602 | +** repository. This command is simply a short-hand for: |
| 603 | +** |
| 604 | +** fossil rebuild --compress-only |
| 605 | +** |
| 606 | +** The name for this command is stolen from the "git repack" command that |
| 607 | +** does approximately the same thing in Git. |
| 608 | +*/ |
| 609 | +void repack_command(void){ |
| 610 | + char *azNewArgv[5]; |
| 611 | + char **azOldArgv = g.argv; |
| 612 | + verify_all_options(); |
| 613 | + if( g.argc!=2 && g.argc!=3 ){ |
| 614 | + usage("?REPOSITORY-FILENAME?"); |
| 615 | + } |
| 616 | + azNewArgv[0] = g.argv[0]; |
| 617 | + azNewArgv[1] = "rebuild"; |
| 618 | + azNewArgv[2] = "--compress-only"; |
| 619 | + azNewArgv[3] = g.argv[2]; |
| 620 | + azNewArgv[4] = 0; |
| 621 | + g.argc++; |
| 622 | + g.argv = azNewArgv; |
| 623 | + rebuild_database(); |
| 624 | + g.argc--; |
| 625 | + g.argv = azOldArgv; |
| 626 | +} |
| 627 | + |
| 596 | 628 | |
| 597 | 629 | /* |
| 598 | 630 | ** COMMAND: rebuild |
| 599 | 631 | ** |
| 600 | 632 | ** Usage: %fossil rebuild ?REPOSITORY? ?OPTIONS? |
| | @@ -707,14 +739,18 @@ |
| 707 | 739 | i64 nByte = 0; |
| 708 | 740 | int nDelta = 0; |
| 709 | 741 | fossil_print("Extra delta compression... "); fflush(stdout); |
| 710 | 742 | nByte = extra_deltification(&nDelta); |
| 711 | 743 | if( nDelta>0 ){ |
| 712 | | - fossil_print("%d new deltas save %,lld bytes", nDelta, nByte); |
| 744 | + if( nDelta==1 ){ |
| 745 | + fossil_print("1 new delta saves %,lld bytes", nByte); |
| 746 | + }else{ |
| 747 | + fossil_print("%d new deltas save %,lld bytes", nDelta, nByte); |
| 748 | + } |
| 713 | 749 | runVacuum = 1; |
| 714 | 750 | }else{ |
| 715 | | - fossil_print("no additional compression found"); |
| 751 | + fossil_print("none found"); |
| 716 | 752 | } |
| 717 | 753 | fflush(stdout); |
| 718 | 754 | } |
| 719 | 755 | if( omitVerify ) verify_cancel(); |
| 720 | 756 | db_end_transaction(0); |
| 721 | 757 | |