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 Unified Diffs Ignore Whitespace Patch

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

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
...
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
		if {![IsRCSArchive $path]} continue

		set usr [UserPath $rcs isattic]
		if {[IsSuperceded $base $rcs $usr $isattic]} continue

		# XXX Checkme: not sure if this will still fail in the case where a directory does conflict with a file XXX
		if {
		    [fileexists_ci $base/$usr] &&
		    [fileisdir_ci  $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
		}
................................................................................
	return $f
    }

    proc IsSuperceded {base rcs usr isattic} {
	::variable myignore

	if {!$isattic}                     {return 0}
	if {![fileexists_ci $base/$usr,v]} {return 0}

	# We have a regular archive and an Attic archive refering to
	# the same user visible file. Ignore the file in the Attic.
	#
	# By default this is a problem causing an abort after the pass
	# has completed. The user can however force us to ignore it.
	# In that case the warning is still printed, but will not







|
|







 







|







113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
...
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
		if {![IsRCSArchive $path]} continue

		set usr [UserPath $rcs isattic]
		if {[IsSuperceded $base $rcs $usr $isattic]} continue

		# XXX Checkme: not sure if this will still fail in the case where a directory does conflict with a file XXX
		if {
		    [fileexists_cs $base/$usr] &&
		    [fileisdir_cs  $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
		}
................................................................................
	return $f
    }

    proc IsSuperceded {base rcs usr isattic} {
	::variable myignore

	if {!$isattic}                     {return 0}
	if {![fileexists_cs $base/$usr,v]} {return 0}

	# We have a regular archive and an Attic archive refering to
	# the same user visible file. Ignore the file in the Attic.
	#
	# By default this is a problem causing an abort after the pass
	# has completed. The user can however force us to ignore it.
	# In that case the warning is still printed, but will not

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

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144

    if {$tcl_platform(platform) eq "windows"} {
	# We use glob to get the list of files (with proper case in
	# the names) to perform our own, case-sensitive matching. WE
	# use 8.5 features where possible, for clarity.

	if {[package vsatisfies [package present Tcl] 8.5]} {
	    proc fileexists_ci {path} {
		set dir  [::file dirname $path]
		set file [::file tail    $path]
		return [expr {$file in [glob -nocomplain -tail -directory $dir *]}]
	    }

	    proc fileisdir_ci {path} {
		set dir  [::file dirname $path]
		set file [::file tail    $path]
		return [expr {$file in [glob -nocomplain -types d -tail -directory $dir *]}]
	    }
	} else {
	    proc fileexists_ci {path} {
		set dir  [::file dirname $path]
		set file [::file tail    $path]
		return [expr {[lsearch [glob -nocomplain -tail -directory $dir *] $file] >= 0}]
	    }

	    proc fileisdir_ci {path} {
		set dir  [::file dirname $path]
		set file [::file tail    $path]
		return [expr {[lsearch [glob -nocomplain -types d -tail -directory $dir *] $file] >= 0}]
	    }
	}
    } else {
	proc fileexists_ci {path} { return [file exists      $path] }
	proc fileisdir_ci  {path} { return [file isdirectory $path] }
    }

    # # ## ### ##### ######## #############
}

namespace eval ::vc::tools::misc {
    namespace export sp nsp max min max2 min2 ldelete
    namespace export striptrailingslash fileexists_ci fileisdir_ci
}

# -----------------------------------------------------------------------------
# Ready

package provide vc::tools::misc 1.0
return







|





|





|





|






|
|







|







96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144

    if {$tcl_platform(platform) eq "windows"} {
	# We use glob to get the list of files (with proper case in
	# the names) to perform our own, case-sensitive matching. WE
	# use 8.5 features where possible, for clarity.

	if {[package vsatisfies [package present Tcl] 8.5]} {
	    proc fileexists_cs {path} {
		set dir  [::file dirname $path]
		set file [::file tail    $path]
		return [expr {$file in [glob -nocomplain -tail -directory $dir *]}]
	    }

	    proc fileisdir_cs {path} {
		set dir  [::file dirname $path]
		set file [::file tail    $path]
		return [expr {$file in [glob -nocomplain -types d -tail -directory $dir *]}]
	    }
	} else {
	    proc fileexists_cs {path} {
		set dir  [::file dirname $path]
		set file [::file tail    $path]
		return [expr {[lsearch [glob -nocomplain -tail -directory $dir *] $file] >= 0}]
	    }

	    proc fileisdir_cs {path} {
		set dir  [::file dirname $path]
		set file [::file tail    $path]
		return [expr {[lsearch [glob -nocomplain -types d -tail -directory $dir *] $file] >= 0}]
	    }
	}
    } else {
	proc fileexists_cs {path} { return [file exists      $path] }
	proc fileisdir_cs  {path} { return [file isdirectory $path] }
    }

    # # ## ### ##### ######## #############
}

namespace eval ::vc::tools::misc {
    namespace export sp nsp max min max2 min2 ldelete
    namespace export striptrailingslash fileexists_cs fileisdir_cs
}

# -----------------------------------------------------------------------------
# Ready

package provide vc::tools::misc 1.0
return