4

I'm trying to checkout a project that was deleted from my SVN in revision 401. The project is now defunct and had been completely replaced with a rewrite of the code, but I'd like to do a checkout so that I can refer back to small pieces of the old code while working on the rewrite.

As far as I can tell, this should be as simple as checking out the old path and the last good revision (400). But when I try this I get an error, because it's trying to use the latest revision:

C:\Users\couling\workspace>svn checkout --revision=400 https://svn.domain.com/repos/trunk/OldProject
Error validating server certificate for 'https://svn.domain.com:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
Certificate information:
 - Hostname: svn.domain.com
 - Valid: from Tue, 11 Dec 2012 15:03:33 GMT until Wed, 11 Dec 2013 15:03:33 GMT
 - Issuer: Personal Certificate, Foomy Whatsit, Blah, Blah, GB
 - Fingerprint: 01:02:03:04:05:06:07:08:09:10:11:12:13:14:15:16:17:18:19:20
(R)eject, accept (t)emporarily or accept (p)ermanently? t
svn: '/repos/!svn/bc/1418/trunk/OldProject' path not found

C:\Users\couling\workspace>

I can easily browse to the folder at revision 400 through a web browser so in the worst case I can still view the code, but I'd prefer to have a copy of all the source files to hand for my IDE.

For reference I'm using this version of the client:

C:\Users\couling\workspace>svn --version
svn, version 1.6.16 (r1073529)
   compiled Mar  8 2011, 11:47:41

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.apache.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

How do I check out a folder that has now been deleted?

Edit

For the removal of doubt.... The checkout command above uses the syntax --revision=400 as this happened to be the last way I wrote the command before posting. This is valid syntax given that the svn command uses a library compatible with the GNU getopt_long. The version I use does and the following are all synonymous -r 400 -r400 --revision 400 --revision=400. The different variants are all reduced to a single result by the getopt library.

As it happens the reason that was the last command I used before posting was that I went through all variants to confirm it was not related to this issue. They all had the same result.

Philip Couling
  • 13,581
  • 5
  • 53
  • 85
  • possible duplicate of [What's the difference between -r and url@rev in SVN?](http://stackoverflow.com/questions/15504743/whats-the-difference-between-r-and-urlrev-in-svn) – n611x007 Apr 21 '15 at 13:54

2 Answers2

9

svn co --depth=infinity https://svn.domain.com/repos/trunk/OldProject@400

See "SVNBook | Peg and Operative Revisions".

bahrep
  • 29,961
  • 12
  • 103
  • 150
  • Yes that's what I need. If I read this correctly; -r400 tells svn to look at the given location and trace it back to rev 400 - allowing for renames. The @400 specifies a location in rev 400 which is what I need. Thanks very much! – Philip Couling Apr 08 '13 at 12:04
  • is there any specific reason why `--revision 400` doesn't work here instead of `@400`? or am I indicating that I misunderstood something? edit: oh. http://stackoverflow.com/a/15508611/611007 – n611x007 Apr 21 '15 at 13:52
-1
  1. When you use Operative Revision, you have to write it with space: -r 400
  2. You can use PEG-revision un URL instead of OR: https://svn.domain.com/repos/trunk/OldProject@400
  3. In order to perform operation without user-intervention (for cert) you can add to command

... --non-interactive --trust-server-cert

Samples

because OP insists insists on being right instead of RTFM and try

Precondition: http://mayorat.ursinecorner.ru:8088/svn/Hello/branches/Greetings doesn't exist in current HEAD, but was in r16

svn co -r 16 http://mayorat.ursinecorner.ru:8088/svn/Hello/branches/Greetings
svn: E160013: '/svn/Hello/!svn/rvr/37/branches/Greetings' path not found

svn co http://mayorat.ursinecorner.ru:8088/svn/Hello/branches/Greetings@16
A    Greetings\Hello.txt
 U   Greetings
Checked out revision 16.

svn co -r=16 http://mayorat.ursinecorner.ru:8088/svn/Hello/branches/
svn: E205000: Syntax error in revision argument '=16'
  • According to last comment I had to get HEAD of /branches, but

>dir /b

Greetings

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • 1
    sadly no. I've used every variant of with and without space/= and long and short option. This works fine when I'm checking out something that exists (so I can check out the parent directory just fine). The problem appears to be that it checks something at the head revision first. – Philip Couling Apr 08 '13 at 10:51
  • 1
    @couling - just read "SVNBook | Peg and Operative Revisions". Format of operative revision doesn't correlate with your trouble: it's **just format of command options**, and "=value" form doesn't exist, thus - ignored – Lazy Badger Apr 08 '13 at 11:22
  • 1
    @Lazey_Badger I will read it. However: Invalid SVN revisions are **NEVER** ignored. They result in a "Syntax Error". (try this `-r =400` to see the message). svn is based on the standard Unix "getopt" arguments. The syntax I've used is correct, I use it all the time. The fault here is ONLY because I'm trying to checkout a deleted directory; it works just fine if I check out the parent directory with **the same syntax**. – Philip Couling Apr 08 '13 at 11:43