Fossil

Check-in [ed13b28b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed the names for the case-sensitive file operations.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ed13b28b13e139d0438d5ff54ddc4029373ecafb
User & Date: aku 2008-01-30 03:10:57
Context
2008-01-30
03:23
Moved the code loading changesets from state to its proper class. check-in: 49dd66f6 user: aku tags: trunk
03:10
Fixed the names for the case-sensitive file operations. check-in: ed13b28b user: aku tags: trunk
2008-01-29
04:05
Moved the new case-sensitive file checking code into the misc package with descriptive command names, to recapture clarity of code at the calling places. check-in: edc46651 user: aku tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tools/cvs2fossil/lib/c2f_pcollar.tcl.

   113    113   		if {![IsRCSArchive $path]} continue
   114    114   
   115    115   		set usr [UserPath $rcs isattic]
   116    116   		if {[IsSuperceded $base $rcs $usr $isattic]} continue
   117    117   
   118    118   		# XXX Checkme: not sure if this will still fail in the case where a directory does conflict with a file XXX
   119    119   		if {
   120         -		    [fileexists_ci $base/$usr] &&
   121         -		    [fileisdir_ci  $base/$usr]
          120  +		    [fileexists_cs $base/$usr] &&
          121  +		    [fileisdir_cs  $base/$usr]
   122    122   		} {
   123    123   		    trouble fatal "Directory name conflicts with filename."
   124    124   		    trouble fatal "Please remove or rename one of the following:"
   125    125   		    trouble fatal "    $base/$usr"
   126    126   		    trouble fatal "    $base/$rcs"
   127    127   		    continue
   128    128   		}
................................................................................
   218    218   	return $f
   219    219       }
   220    220   
   221    221       proc IsSuperceded {base rcs usr isattic} {
   222    222   	::variable myignore
   223    223   
   224    224   	if {!$isattic}                     {return 0}
   225         -	if {![fileexists_ci $base/$usr,v]} {return 0}
          225  +	if {![fileexists_cs $base/$usr,v]} {return 0}
   226    226   
   227    227   	# We have a regular archive and an Attic archive refering to
   228    228   	# the same user visible file. Ignore the file in the Attic.
   229    229   	#
   230    230   	# By default this is a problem causing an abort after the pass
   231    231   	# has completed. The user can however force us to ignore it.
   232    232   	# In that case the warning is still printed, but will not

Changes to tools/cvs2fossil/lib/misc.tcl.

    96     96   
    97     97       if {$tcl_platform(platform) eq "windows"} {
    98     98   	# We use glob to get the list of files (with proper case in
    99     99   	# the names) to perform our own, case-sensitive matching. WE
   100    100   	# use 8.5 features where possible, for clarity.
   101    101   
   102    102   	if {[package vsatisfies [package present Tcl] 8.5]} {
   103         -	    proc fileexists_ci {path} {
          103  +	    proc fileexists_cs {path} {
   104    104   		set dir  [::file dirname $path]
   105    105   		set file [::file tail    $path]
   106    106   		return [expr {$file in [glob -nocomplain -tail -directory $dir *]}]
   107    107   	    }
   108    108   
   109         -	    proc fileisdir_ci {path} {
          109  +	    proc fileisdir_cs {path} {
   110    110   		set dir  [::file dirname $path]
   111    111   		set file [::file tail    $path]
   112    112   		return [expr {$file in [glob -nocomplain -types d -tail -directory $dir *]}]
   113    113   	    }
   114    114   	} else {
   115         -	    proc fileexists_ci {path} {
          115  +	    proc fileexists_cs {path} {
   116    116   		set dir  [::file dirname $path]
   117    117   		set file [::file tail    $path]
   118    118   		return [expr {[lsearch [glob -nocomplain -tail -directory $dir *] $file] >= 0}]
   119    119   	    }
   120    120   
   121         -	    proc fileisdir_ci {path} {
          121  +	    proc fileisdir_cs {path} {
   122    122   		set dir  [::file dirname $path]
   123    123   		set file [::file tail    $path]
   124    124   		return [expr {[lsearch [glob -nocomplain -types d -tail -directory $dir *] $file] >= 0}]
   125    125   	    }
   126    126   	}
   127    127       } else {
   128         -	proc fileexists_ci {path} { return [file exists      $path] }
   129         -	proc fileisdir_ci  {path} { return [file isdirectory $path] }
          128  +	proc fileexists_cs {path} { return [file exists      $path] }
          129  +	proc fileisdir_cs  {path} { return [file isdirectory $path] }
   130    130       }
   131    131   
   132    132       # # ## ### ##### ######## #############
   133    133   }
   134    134   
   135    135   namespace eval ::vc::tools::misc {
   136    136       namespace export sp nsp max min max2 min2 ldelete
   137         -    namespace export striptrailingslash fileexists_ci fileisdir_ci
          137  +    namespace export striptrailingslash fileexists_cs fileisdir_cs
   138    138   }
   139    139   
   140    140   # -----------------------------------------------------------------------------
   141    141   # Ready
   142    142   
   143    143   package provide vc::tools::misc 1.0
   144    144   return