WordPress Work

SVN and @ characters: peg revision is not allowed here

This has got me stuck a few times in the past few months so I thought I would write this down and get this committed to memory, once and for all!

When working with SVN and trying to add or remove a file that includes the @ to your working copy, you will run into a peg revision is not allowed here error:

svn rm modules/sharedaddy/images/[email protected]
svn: E200009: 'modules/sharedaddy/images/[email protected]': a peg revision is not allowed here

That is because SVN uses the @ symbol as a way to determine a specific revision, like so:

svn info [email protected]
Path: readme.txt
Name: readme.txt
Relative URL: ^/jetpack/trunk/readme.txt
Repository Root:
Repository UUID: b8457f37-d9ea-0310-8a92-e5e31aec5664
Revision: 2021803
Node Kind: file
Last Changed Author: jeherve
Last Changed Rev: 2021532
Last Changed Date: 2019-01-29 22:57:37 +0100 (Tue, 29 Jan 2019)

To work around that, all you need to do is add an @ symbol at the end of the filename, like so:

svn rm modules/sharedaddy/images/[email protected]@
D         modules/sharedaddy/images/[email protected]

Problem solved!