I am trying to copy a deleted file from a previous version from the svn repository to my working directory.
I know that the file is present in revision rxxx , because I do svn log -v
and can see the old revision number associated with the file.
I also do svn info
to find the repository name which in my case is of the form svn+ssh://repository
I then do svn copy -r xxx svn+ssh://repository name/filename ./filename
But it complains that svn: File not found
By default when you specify the URL of a file in a repository, SVN assumes you're referring to an object in HEAD. So your command actually means:
xxx
Of course, this fails at the first step since the file no longer exists in HEAD. You need to explicitly reference the object that used to be called filename
back in revision xxx
, using what's known as a "peg revision":
svn copy -r xxx svn+ssh://repository/filename@xxx ./filename
The SVN book has a more in-depth explanation of peg revisions, if you're feeling brave...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With