[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Case-insensitivity causes data loss under win32

From: John Peacock <jpeacock_at_rowman.com>
Date: 2003-10-07 16:37:24 CEST

Wadsworth, Eric (Contractor) wrote:
> What would be nice is a way to identify when a filename exists with a
> different case than svn knows about. Once the user sees an alert, action can
> be taken. It's only a problem when the user doesn't realize that there is a
> case problem.

As I pointed out, it would seem likely that this would be a significant
performance hit, since it would require each directory to be potentially scanned
twice: once to determine which files were there/missing and once to see if the
files which were missing are there in altered capitalization.

I haven't looked at the actual Subversion code; I'm guessing the current logic
is thus (in pseudo-code and ignoring walking the directory tree):

open directory
while filename = next file
   does this filename exist in textbase (i.e. svn knows it)
     YES - process file (update/merge/whatever depending on timestamp/etc.)
     NO - ignore file
end while
close directory

In order to warn on capitalization changes, the loop would look like this:

open directory
while filename = next file
   does this filename exist in textbase (i.e. svn knows it)
     YES - process file (update/merge/whatever depending on timestamp/etc.)
* NO - scan the directory for matching files with different caps
end while
close directory

That step at * above could potentially mean a complete scan of the directory
(and some people like to put 5000+ files in a single directory!).

Remember that the following files are "equivalent" according to Win32:

        Resource.h
        resource.h
        ReSoUrCe.H
        etc.

Now that I think of it perhaps, for missing files only, svn could attempt to use
the native Win32 call to attempt an open() of the missing file; if it succeeds,
it can only mean that the file has be recapitalized and a warning could be
thrown and the restore aborted.

Anyone with actual experience with the code care to comment?

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Oct 7 16:38:03 2003

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.