Check-in [9f3fd3ec4b]
Not logged in
Overview

SHA1 Hash:9f3fd3ec4b65c657d5c42422d2a110df9f6c0c11
Date: 2007-10-23 04:34:12
User: aku
Comment:Added a bit of path normalization, stripping of a trailing slash from the path to the cvs repository. Before such a slash could break a later coming fileutil::stripPath.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified tools/cvs2fossil/lib/c2f_option.tcl from [90466e503f] to [ebc8b51de9].

@@ -20,10 +20,11 @@
 
 package require Tcl 8.4                               ; # Required runtime.
 package require snit                                  ; # OO system.
 package require vc::tools::trouble                    ; # Error reporting.
 package require vc::tools::log                        ; # User feedback.
+package require vc::tools::misc                       ; # Misc. path reformatting.
 package require vc::fossil::import::cvs::pass         ; # Pass management
 package require vc::fossil::import::cvs::pass::collar ; # Pass I.
 package require vc::fossil::import::cvs::repository   ; # Repository management
 package require vc::fossil::import::cvs::state        ; # State storage
 
@@ -80,11 +81,11 @@
 	    }
 	}
 
 	if {[llength $arguments] > 1} Usage
 	if {[llength $arguments] < 1} { Usage $nocvs }
-	repository base [lindex $arguments 0]
+	repository base [striptrailingslash [lindex $arguments 0]]
 
 	Validate
 	return
     }
 
@@ -189,10 +190,11 @@
 namespace eval ::vc::fossil::import::cvs {
     namespace export option
     namespace eval option {
 	namespace import ::vc::tools::trouble
 	namespace import ::vc::tools::log
+	namespace import ::vc::tools::misc::striptrailingslash
 	namespace import ::vc::fossil::import::cvs::pass
 	namespace import ::vc::fossil::import::cvs::pass::collar
 	namespace import ::vc::fossil::import::cvs::repository
 	namespace import ::vc::fossil::import::cvs::state
     }

Modified tools/cvs2fossil/lib/misc.tcl from [090ed4e354] to [a87f1adea4].

@@ -58,17 +58,22 @@
 	return
     }
 
     # Delete item from list by name
 
+    proc striptrailingslash {path} {
+	# split and rejoin gets rid of a traling / character.
+	return [eval [linsert [file split $path] 0 file join]]
+    }
+
     # # ## ### ##### ######## #############
 }
 
 namespace eval ::vc::tools::misc {
-    namespace export sp nsp max ldelete
+    namespace export sp nsp max ldelete striptrailingslash
 }
 
 # -----------------------------------------------------------------------------
 # Ready
 
 package provide vc::tools::misc 1.0
 return