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

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

From: Wadsworth, Eric (Contractor) <wadswore_at_fhu.disa.mil>
Date: 2004-08-04 16:37:22 CEST

Last time I did this, I had to use an intermediary step. First change it
from test.txt to _TEST.TXT, commit the change, then change it from _TEST.TXT
to TEST.TXT, and commit again. Make sense?

The reason this is a pain is because subversion cares about case (rightfully
so), but while Windows preserves case, it doesn't differentiate between the
same filename in different cases (like *NIX does).

Hope this helps.

****
**** --- Eric Wadsworth, 520-533-2749
****

> -----Original Message-----
> From: Roel Harbers [mailto:roel@roelharbers.nl]
> Sent: Wednesday, August 04, 2004 2:11 AM
> To: users@subversion.tigris.org
> Subject: Re: What's the proper way to change a filename's
> case on win32?
>
>
> in case it's important: svnserve v1.0.5 on Win2K, svn v1.0.4 on WinXP
>
> Roel Harbers wrote:
> > 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
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Aug 4 16:37:43 2004

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