17

With the new iPhone 2x files i've stumbled uppon this problem...

Eiko
  • 25,601
  • 15
  • 56
  • 71
CiNN
  • 9,752
  • 6
  • 44
  • 57

1 Answers1

51

You need to add a "@" sign in the end to get SVN to process the file.

For example, if you had a file called foo@2x.png which you want to add to SVN, you would type:

svn add foo@2x.png@

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:

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 each filepath to SVN using XARGS.

For each filepath, XARGS will execute the provided command svn add %@, except that -I % tells XARGS to replace each occurrence of "%" in the provided command, with the filepath piped. XARGS effectively appends the special "@" at the end of the filename.

For example, after replacing the "%" character, XARGS will execute svn add path/to/your/file@2x.png@; SVN will accept this (presumably because SVN looks for the last occurrence of "@" and treats this as a revision specifier)

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

Nate Anderson
  • 18,334
  • 18
  • 100
  • 135
bhavinb
  • 3,278
  • 2
  • 28
  • 26
  • 2
    Of course, if you want to remove the files instead of adding them, you just need to replace svn add with svn delete in the example above and it should work. – bhavinb Aug 18 '10 at 11:29
  • Nice one. Seems strange though — how come adding an “@” at the end makes this work? Is it documented anywhere? – Paul D. Waite Apr 18 '12 at 08:29
  • Very strange, I added @ at the end of file name `ubuntu@ec2-54-245-12-20.us-west-2.compute.amazonaws.com@` and svn delete worked. – Siddharth Oct 19 '12 at 06:13
  • 2
    @PaulD.Waite I would assume it works because SVN treats the last @ in the string as the revision specifier, so adding one to the end makes it ignore the previous one. – Max Nanasy Mar 08 '13 at 21:23
  • The solution is described in SVNBook: http://svnbook.red-bean.com/en/1.8/svn.advanced.pegrevs.html – bahrep Jul 24 '13 at 10:24