4

A while ago I deleted a file from Subversion repository and now I want to take a look at its contents. I determined that the file was deleted in revision 68, so I tried the following:

svn cat -r 67 path/to/file

from the project root directory, svn tells me that svn: E155010: The node '/absolute/path/to/file' was not found. Then I tried:

 svn list -r 67 path/to

and Subversion clearly shows the file in the directory. So what am I missing?

I tried the answer from examining history of deleted file and it isn't working for me.

Community
  • 1
  • 1
markvgti
  • 4,321
  • 7
  • 40
  • 62
  • 1
    Does it work serverside `svn cat http://server/svn/project/file -r 67`? – S.Spieker May 15 '15 at 10:55
  • Output was: svn: warning: W160013: '/svn/OmanERP/!svn/rvr/88/OmanERP/NHibernate/SessionHelper.cs' path not found svn: E200009: Could not cat all targets because some targets don't exist svn: E200009: Illegal target for the requested operation I don't have any privileges on the server, if that matters. – markvgti May 15 '15 at 12:23
  • Have you tried `svn cat http://server/svn/project/file@67`? – Ivan Jovović May 15 '15 at 13:22
  • @IvanJovovic, make that an answer, I'm pretty sure that's the straightforward solution. – Ben May 15 '15 at 17:07
  • @IvanJovovic Thanks, that worked. Could you make that an answer so that I can mark that as the accepted answer. Thanks. – markvgti May 18 '15 at 07:46

1 Answers1

6

Try using peg instead operative revision:

svn cat http://server/svn/project/file@67

Short answer why it works in case of deleted files you can find in SO thread you have already mentioned:

When you want to look at old files you really should know the difference between:

svn cat http://server/svn/project/file -r 1234

and

svn cat http://server/svn/project/file@1234

The first version looks at the path that is now available as http://server/svn/project/file and retrieves that file as it was in revision 1234. (So this syntax does not work after a file delete).

The second syntax gets the file that was available as http://server/svn/project/file in revision 1234. So this syntax DOES work on deleted files.

Longer answer is in the SVN book: Peg and Operative Revisions.

Community
  • 1
  • 1
Ivan Jovović
  • 5,238
  • 3
  • 29
  • 57