Diff
Not logged in

Differences From:

File tools/import-cvs.tcl part of check-in [7b2619b7ef] - Unhacked the fossil backend. IOW reworked the API and made it nicer, more structured, better command and option names. Gave the internals more structure, and simplified the handling of -breakat (old -stopat breakpoint). Updated users, and updated the user visible switches as well. Added a -h switch for help. by aku on 2007-09-13 08:02:26. [view]

To:

File tools/import-cvs.tcl part of check-in [d8c18fc148] - Reworked the CVS handling code to have a simpler API, more like the reworked Fossil API. The API now has a form where adding the handling of branches should not require complex changes in the import controller any longer. Extended the system to allow the user to restrict the importing to a sub-directory of the chosen repository, via the new switch --project. This is required to pull a SF CVS repository apart into the various projects it may have. Example: Under Tcl we have 3 projects, namely Tcl itself, sampleextension, and Thread. by aku on 2007-09-17 00:56:40. [view]

@@ -43,8 +43,9 @@
 
 package require Tcl 8.4
 package require vc::tools::log          ; # User Feedback
 package require vc::fossil::import::cvs ; # Importer Control
+package require vc::cvs::ws             ; # CVS frontend
 
 namespace eval ::import {
     namespace import ::vc::fossil::import::cvs::*
 }
@@ -70,8 +71,9 @@
 	switch -exact -- $opt {
 	    --breakat     { next ; import::configure -breakat [this] }
 	    --nosign      {        import::configure -nosign       1 }
 	    --saveto      { next ; import::configure -saveto  [file normalize [this]] }
+	    --project     { next ; import::configure -project [this] }
 	    -v            { incr verbosity ; ::vc::tools::log::verbosity $verbosity }
 	    -h            -
 	    default       usage
 	}
@@ -81,14 +83,10 @@
     remainder
     if {[llength $argv] != 2} usage
     foreach {cvs fossil} $argv break
 
-    if {
-	![file exists      $cvs] ||
-	![file readable    $cvs] ||
-	![file isdirectory $cvs]
-    } {
-	usage "CVS directory missing, not readable, or not a directory."
+    if {![::vc::cvs::ws::check $cvs msg]} {
+	usage $msg
     } elseif {[file exists $fossil]} {
 	usage "Fossil destination repository exists already."
     }
 
@@ -125,8 +123,9 @@
     puts stderr "Usage: $argv0 ?-v? ?--nosign? ?--breakat id? ?--saveto path? cvs-repository fossil-repository"
     if {$text eq ""} {
 	puts stderr "       --nosign:  Do not sign the imported changesets."
 	puts stderr "       --breakat: Stop just before committing the identified changeset."
+	puts stderr "       --project: Path in the CVS repository to limit the import to."
 	puts stderr "       --saveto:  Save commit command to the specified file."
 	puts stderr "       -v:        Increase log verbosity. Can be used multiple times."
     } else {
 	puts stderr "       $text"