| | @@ -23,10 +23,11 @@ |
| 23 | 23 | package require vc::tools::trouble ; # Error reporting. |
| 24 | 24 | package require vc::tools::log ; # User feedback. |
| 25 | 25 | package require vc::fossil::import::cvs::pass ; # Pass management |
| 26 | 26 | package require vc::fossil::import::cvs::pass::collar ; # Pass I. |
| 27 | 27 | package require vc::fossil::import::cvs::repository ; # Repository management |
| 28 | +package require vc::fossil::import::cvs::state ; # State storage |
| 28 | 29 | |
| 29 | 30 | # # ## ### ##### ######## ############# ##################### |
| 30 | 31 | ## |
| 31 | 32 | |
| 32 | 33 | snit::type ::vc::fossil::import::cvs::option { |
| | @@ -38,50 +39,45 @@ |
| 38 | 39 | # -p, --pass, --passes |
| 39 | 40 | # --ignore-conflicting-attics |
| 40 | 41 | # --project |
| 41 | 42 | # -v, --verbose |
| 42 | 43 | # -q, --quiet |
| 44 | + # --state (conversion status, ala config.cache) |
| 43 | 45 | |
| 44 | | - # --cache (conversion status, ala config.cache) |
| 45 | 46 | # -o, --output |
| 46 | 47 | # --dry-run |
| 47 | 48 | # --trunk-only |
| 48 | 49 | # --force-branch RE |
| 49 | 50 | # --force-tag RE |
| 50 | 51 | # --symbol-transform RE:XX |
| 51 | 52 | # --exclude |
| 52 | | - # -p, --passes |
| 53 | 53 | |
| 54 | 54 | # # ## ### ##### ######## ############# |
| 55 | 55 | ## Public API, Methods |
| 56 | 56 | |
| 57 | 57 | typemethod process {arguments} { |
| 58 | 58 | # Syntax of arguments: ?option ?value?...? /path/to/cvs/repository |
| 59 | 59 | |
| 60 | 60 | while {[IsOption arguments -> option]} { |
| 61 | 61 | switch -exact -- $option { |
| 62 | | - -h - |
| 63 | | - --help { PrintHelp ; exit 0 } |
| 64 | | - --help-passes { pass help ; exit 0 } |
| 65 | | - --version { PrintVersion ; exit 0 } |
| 66 | | - |
| 62 | + -h - |
| 63 | + --help { PrintHelp ; exit 0 } |
| 64 | + --help-passes { pass help ; exit 0 } |
| 65 | + --version { PrintVersion ; exit 0 } |
| 67 | 66 | -p - |
| 68 | 67 | --pass - |
| 69 | 68 | --passes { pass select [Value arguments] } |
| 70 | | - |
| 71 | 69 | --ignore-conflicting-attics { collar ignore_conflicting_attics } |
| 72 | | - |
| 73 | | - --project { repository add [Value arguments] } |
| 74 | | - -v - |
| 75 | | - --verbose { log verbose } |
| 76 | | - -q - |
| 77 | | - --quiet { log quiet } |
| 78 | | - |
| 79 | | - --cache { |
| 80 | | - # [Value arguments] |
| 81 | | - } |
| 82 | | - default { Usage $badoption$option\n$gethelp } |
| 70 | + --project { repository add [Value arguments] } |
| 71 | + -v - |
| 72 | + --verbose { log verbose } |
| 73 | + -q - |
| 74 | + --quiet { log quiet } |
| 75 | + --state { state use [Value arguments] } |
| 76 | + default { |
| 77 | + Usage $badoption$option\n$gethelp |
| 78 | + } |
| 83 | 79 | } |
| 84 | 80 | } |
| 85 | 81 | |
| 86 | 82 | if {[llength $arguments] > 1} Usage |
| 87 | 83 | if {[llength $arguments] < 1} { Usage $nocvs } |
| | @@ -101,10 +97,12 @@ |
| 101 | 97 | trouble info " Information options" |
| 102 | 98 | trouble info "" |
| 103 | 99 | trouble info " -h, --help Print this message and exit with success" |
| 104 | 100 | trouble info " --help-passes Print list of passes and exit with success" |
| 105 | 101 | trouble info " --version Print version number of $argv0" |
| 102 | + trouble info " -v, --verbose Increase application's verbosity" |
| 103 | + trouble info " -q, --quiet Decrease application's verbosity" |
| 106 | 104 | trouble info "" |
| 107 | 105 | trouble info " Conversion control options" |
| 108 | 106 | trouble info "" |
| 109 | 107 | trouble info " -p, --pass PASS Run only the specified conversion pass" |
| 110 | 108 | trouble info " -p, --passes ?START?:?END? Run only the passes START through END," |
| | @@ -114,10 +112,13 @@ |
| 114 | 112 | trouble info "" |
| 115 | 113 | trouble info " --ignore-conflicting-attics" |
| 116 | 114 | trouble info " Prevent abort when conflicting archives" |
| 117 | 115 | trouble info " were found in both regular and Attic." |
| 118 | 116 | trouble info "" |
| 117 | + trouble info " --state PATH Save state to the specified file, and" |
| 118 | + trouble info " load state of previous runs from it too." |
| 119 | + trouble info "" |
| 119 | 120 | |
| 120 | 121 | # --project, --cache |
| 121 | 122 | # ... |
| 122 | 123 | return |
| 123 | 124 | } |
| | @@ -166,10 +167,11 @@ |
| 166 | 167 | proc Validate {} { |
| 167 | 168 | # Prevent in-depth validation if the options were already bad. |
| 168 | 169 | trouble abort? |
| 169 | 170 | |
| 170 | 171 | repository validate |
| 172 | + state setup |
| 171 | 173 | |
| 172 | 174 | trouble abort? |
| 173 | 175 | return |
| 174 | 176 | } |
| 175 | 177 | |
| | @@ -189,13 +191,14 @@ |
| 189 | 191 | namespace import ::vc::tools::trouble |
| 190 | 192 | namespace import ::vc::tools::log |
| 191 | 193 | namespace import ::vc::fossil::import::cvs::pass |
| 192 | 194 | namespace import ::vc::fossil::import::cvs::pass::collar |
| 193 | 195 | namespace import ::vc::fossil::import::cvs::repository |
| 196 | + namespace import ::vc::fossil::import::cvs::state |
| 194 | 197 | } |
| 195 | 198 | } |
| 196 | 199 | |
| 197 | 200 | # # ## ### ##### ######## ############# ##################### |
| 198 | 201 | ## Ready |
| 199 | 202 | |
| 200 | 203 | package provide vc::fossil::import::cvs::option 1.0 |
| 201 | 204 | return |
| 202 | 205 | |