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

Re: Avoiding duplicate filenames in repository

From: Christopher Ness <chris_at_nesser.org>
Date: 2005-05-27 17:49:20 CEST

On Thu, 2005-05-26 at 14:14 -0700, Chris Weiss wrote:
> We ran into an interesting situation where two different Windows clients
> both added files with identical filenames but different capitalization
> (IE, file1.JPG and file1.jpg). Since *nix considers these two seperate
> filenames, we ended up with both files added to the repository. However,
> when trying to do a checkout or update, Windows would consider them the
> same filename and TortoiseSVN would report being unable to create the
> file. Since the filenames were legal, svnadmin recover/verify didn't see
> anything wrong. It wasn't until I browsed the repository with
> TortoiseSVN (we're using svnserve only as we can't put apache2 on our
> cohosted server) that I noticed there were two files and was able to
> delete one of them.
>
> Is there any way of preventing this in the future? Since that's the
> nature of *nix/Windows interaction, I realize it's not a bug to be
> fixed, but it sure would be nice to have TortoiseSVN check for potential
> conflicts in the repository before allowing an add like that.

To expand Greg's message a bit, perhaps you could try.

A pre-commit script that uses `grep -i` and `svnlook` to look for
similar file names should work. An excerpt from the grep man page:

       -i, --ignore-case
              Ignore case distinctions in both the PATTERN and the input
              files.

Write your error message to STDERR to be returned to the client and exit
with a non zero code to reject a commit.

Be sure not to reject /trunk/file.JPG when /tags/file.jpg exists (check
the full path!)

Cheers,
Chris

-- 
Wireless Group,
McMaster University
finger.localdomain
11:38:45 up 2 days, 1:23, 1 user, load average: 0.01, 0.01, 0.00
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri May 27 17:58:30 2005

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.