Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Subversion skips files which contain the @ symbol?

when I try to execute command like this (from a command-line or Perl script - it doesn't matter):

svn revert "build\[email protected]" 

SVN skips this file and outputs:

Skipped 'build\myfile' 

I tried doing:

svn revert "build\*.meta" 

But it gives the same result.

I can revert these files from the GUI. And I can revert these files by doing (but it reverts more than I want):

svn revert --recursive "build" 

Is there a workaround for this?

like image 561
Paulius Liekis Avatar asked Dec 31 '09 12:12

Paulius Liekis


People also ask

What does red exclamation mark mean in TortoiseSVN?

That means the Subversion status is normal. As soon as you start editing a file, the status changes to modified and the icon overlay then changes to a red exclamation mark. That way you can easily see which files were changed since you last updated your working copy and need to be committed.

What does S mean in SVN status?

Status S means "switched", according to svn h st .


2 Answers

The @ sign in filenames in Subversion actually has a special meaning - a pegged revision number. To quote the Subversion book:

The perceptive reader is probably wondering at this point whether the peg revision syntax causes problems for working copy paths or URLs that actually have at signs in them. After all, how does svn know whether news@11 is the name of a directory in my tree or just a syntax for “revision 11 of news”? Thankfully, while svn will always assume the latter, there is a trivial workaround. You need only append an at sign to the end of the path, such as news@11@. svn cares only about the last at sign in the argument, and it is not considered illegal to omit a literal peg revision specifier after that at sign. This workaround even applies to paths that end in an at sign—you would use filename@@ to talk about a file named filename@.

So, you should append an @ sign to filenames in scripts, like this:

svn revert "build\[email protected]@" 
like image 172
Avi Avatar answered Sep 21 '22 00:09

Avi


Just to add to the above correct answer, if you have lots of files with the "@" symbol in their name that you want to process in a batch (i.e. use * wildcard), you can do something like this in OS X Terminal (or any Linux box really):

find . -name "*@*" | xargs -I % svn add %@ 

The above command will use the find utility to list out each file with @ in its filename and then pipe the path to the file to SVN using XARGS. XARGS will replace each occurrence of % with the path and append the special "@" at the end of the filename so that SVN will accept it.

Hope this helps - I had to whack my head for a bit to add the gazzilion @2x.png files that were needed for my app to be upgraded for iOS4.0

like image 24
bhavinb Avatar answered Sep 19 '22 00:09

bhavinb