Overview
SHA1 Hash: | a10f654ac719780b97e647130c79c9654043978f |
---|---|
Date: | 2007-10-10 05:36:27 |
User: | aku |
Comment: | Added more checks to pass I looking for possible file/directory conflicts in the repository, and modified traverser to report on and ignore sub directories of Attic's. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified tools/cvs2fossil/lib/c2f_pcollar.tcl from [464bb34df8] to [97283400ae].
@@ -83,11 +83,12 @@ set rbase [repository base?] foreach project [repository projects] { set base [file join $rbase [$project base]] log write 1 collar "Scan $base" - set traverse [fileutil::traverse %AUTO% $base] + set traverse [fileutil::traverse %AUTO% $base \ + -prefilter [myproc FilterAtticSubdir $base]] set n 0 set r {} $traverse foreach path { set rcs [fileutil::stripPath $base $path] @@ -94,10 +95,21 @@ if {[IsCVSAdmin $rcs]} continue if {![IsRCSArchive $path]} continue set usr [UserPath $rcs isattic] if {[IsSuperceded $base $rcs $usr $isattic]} continue + + if { + [file exists $base/$usr] && + [file isdirectory $base/$usr] + } { + trouble fatal "Directory name conflicts with filename." + trouble fatal "Please remove or rename one of the following:" + trouble fatal " $base/$usr" + trouble fatal " $base/$rcs" + continue + } log write 4 collar "Found $rcs" $project add $rcs $usr incr n @@ -123,10 +135,24 @@ # # ## ### ##### ######## ############# ## Internal methods typevariable myignore 0 + + proc FilterAtticSubdir {base path} { + # This command is used by the traverser to prevent it from + # scanning into subdirectories of an Attic. We get away with + # checking the immediate parent directory of the current path + # as our rejection means that deeper path do not occur. + + if {[file tail [file dirname $path]] eq "Attic"} { + set ad [fileutil::stripPath $base $path] + log write 1 collar "Directory $ad found in Attic, ignoring." + return 0 + } + return 1 + } proc IsRCSArchive {path} { if {![string match *,v $path]} {return 0} if {[fileutil::test $path fr msg]} {return 1} trouble warn $msg