tags:

views:

222

answers:

6

Hi,

Is there any way I can determine from my local copy of an SVN project (something within .svn), which version of the SVN server is running?

Thanks, Barry

A: 

If there is a way, I can't find it. If you access the server by HTTP[S], you can probably obtain the version from the output of the HEAD command:

telnet server 80
HEAD / HTTP/1.0 (Press RETURN twice)

For HTTPS:

openssl s_client -connect server:https
HEAD / HTTP/1.0 (Press RETURN twice)
Gary Chambers
A: 
svn --version
Glenn
This shows the version of the client, not the server - they may be different.
ASk
+2  A: 

There's a python script hosted here that does exactly what you want.

Also, check out this question.

I always find this is a helpful SVN resource too.

Owen
+2  A: 

Just use a web browser and call the URL of the subversion repository. On the foot of the appearing page the version number is displayed.

Bob
+1  A: 

There is no way to determine the version of Subversion running a particular repository without access to that repository, for two reasons:

  1. First and foremost, the working copy is almost completely unaffected by the capabilities of the repository. It's controlled completely by the local Subversion client and there is high compatibility between versions.
  2. Besides, how would you know whether the server has been upgraded since you checked out?

If your repository is accessed via file://, you're using the same version of Subversion as both client and server. This is a no-brainer — svnadmin --version — but I assume this isn't the case, or you wouldn't be asking here. :-)

To find the version of a repository available via http:// or https://, any of the methods presented in other answers here will work. I'm partial to the "just visit it in the browser" method, if you don't need to check programmatically.

To find the version of an ssh+svn:// repository, SSH into that box as normal and run svnadmin --version.

I'm not aware of a method to determine the version of a repository only available via svn://.

Ben Blank
A: 

The Subversion server version is available in the HTTP RESPONSE header returned by the server. You can get it using this shell command:

wget -S --spider 'http://svn.server.net/svn/repository' 2>&1 | \ 
grep 'SVN' | sed 's/.*\(SVN[0-9\/\.]*\).*/\1/';
Christopher