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

What's the proper way to change a filename's case on win32?

From: Roel Harbers <roel_at_roelharbers.nl>
Date: 2004-08-04 11:03:04 CEST

What is the proper way to *change* a filename's case when an incorrectly
"cased" filename has been commited on a Win32 system (or any
case-insensitive filesystem?) (Case may still be important because of
naming conventions, coding style or whatever)

example: renaming test.txt to TEST.TXT

I tried to rename it in my wc, but that doesn't work:
C:\WC>svn rename test.txt TEST.TXT
svn: Cannot move path 'test.txt' into itself

So, I tried to rename it in the repo, using the url:
C:\WC>svn rename svn://server/repo/test.txt svn://server/repo/TEST.TXT
Committed revision 134

But now win32 clients can't do an update:
C:\WC>svn update
svn: Failed to add file 'TEST.TXT': object of the same name already exists

deleting the file from the wc (using del) does not help:
C:\WC>del test.txt
C:\WC>svn update
Restored 'test.txt'
svn: Failed to add file 'TEST.TXT': object of the same name already exists

(it restores the old one first)

doing an svn delete on the file doesn't help either:
C:\WC>svn delete test.txt
D test.txt
C:\WC>svn update
A TEST.TXT
D test.txt
Updated to revision 134.

The update seems to go fine, but I now have neither test.txt nor
TEST.TXT in my wc because it has performed the delete of test.txt again.
(which deleted TEST.TXT ofcourse)

Now I try to revert, to undo the delete of test.txt, and restore to it's
HEAD state (which should have TEST.TXT in it):
C:\WC>svn revert -R .
svn: Error 'restoring text' for 'TEST.TXT'
svn: Can't copy '.svn/text-base/TEST.TXT.svn-base' to 'TEST.TXT.tmp':
The system cannot find the file specified.

and I now have have TEST.TXT.tmp (0 bytes) in my wc.

Trying an update now gives the same "can't copy" error. svn status shows
TEST.TXT as missing (and TEST.TXT.tmp as unversioned of course.)

A completely new checkout on all clients seems to be needed to fix it.

A workaround, although awkward, would be to renamed it first to a
completely different name, let all clients update, and then rename it
back to the correct case name. (doing this without the intermediate
update doesn't work either)

Now, I understand the problem of having two files in the repo with
filenames differing only in case. But here, at NO point in time have
there been two such files in the same repo revision.

Is there a way to cleanly change the filename without requiring such
extra "synchronization" between all clients?

regards,

Roel Harbers

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Aug 4 11:03:39 2004

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.