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

Re: Renaming a file on windows with @20 in name

From: Ryan Schmidt <subversion-2011a_at_ryandesign.com>
Date: Wed, 9 Mar 2011 19:00:45 -0600

On Mar 9, 2011, at 18:11, Michael Diers wrote:
> On 2011-03-09 21:22, Stephen P Rufle wrote:
>> I am trying the following.
>> svn ren "48_at_20hrs.jpg" "48 hrs.jpg"
>>
>> I get the following message
>> svn: '48' is not under version control
>>
>> I would like to automate the task of renaming ~100 files. I was able to
>> use TortoiseSVN to do a single file manually, but am not sure how to get
>> this to work from the command line.
>>
>> Please help :)
>
> Stephen,
>
> what command line interpreter (shell) are you using?
>
> The files to be renamed must be referred to with a trailing "@",
> like so:
>
> svn ren "48_at_20hrs.jpg@" "48 hrs.jpg"

And just to explain why: This is because Subversion reserves a special use for the @ character: specifying a peg revision number. (Peg and operative revisions are explained in the book at http://svnbook.org ) Subversion takes "48" as the filename and "20hrs.jpg" as the peg revision, and isn't smart enough to realize that that's not a valid revision number and just tries to use it as one anyway; to avoid that, you add the extra "@" at the end, which will end up using the correct filename "48@20hrs.jpg" and a revision number "" (the empty string), which is fine.
Received on 2011-03-10 02:01:21 CET

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.