简体   繁体   English

如何找到我的 Subversion 服务器版本号?

[英]How to find my Subversion server version number?

I want to know if my server is running Subversion 1.5.我想知道我的服务器是否正在运行 Subversion 1.5。

How can I find that out?我怎样才能找到它?

Also would be nice to know my SVN client version number.也很高兴知道我的 SVN 客户端版本号。 svn help hasn't been helpful. svn help没有帮助。

Note: I don't want my project's revision number, etc. This question is about the Subversion software itself.注意:我不想要我的项目的修订号等。这个问题是关于Subversion 软件本身的。

To find the version of the subversion REPOSITORY you can:要查找 subversion REPOSITORY 的版本,您可以:

  1. Look to the repository on the web and on the bottom of the page it will say something like:查看网络上的存储库,在页面底部,它会显示如下内容:
    "Powered by Subversion version 1.5.2 (r32768)." “由 Subversion 版本 1.5.2 (r32768) 提供支持。”
  2. From the command line: <insert curl, grep oneliner here>从命令行:<insert curl, grep oneliner here>

If not displayed, view source of the page如果没有显示,查看页面源码

<svn version="1.6.13 (r1002816)" href="http://subversion.tigris.org/"> 

Now for the subversion CLIENT:现在对于颠覆客户端:

svn --version

will suffice就足够了

Let's merge these responses:让我们合并这些响应:

For REPOSITORY / SERVER (the original question):对于存储库/服务器(原始问题):

If able to access the Subversion server:如果能够访问 Subversion 服务器:

  • From an earlier answer by Manuel , run the following on the SVN server:Manuel较早的回答中,在 SVN 服务器上运行以下命令:

     svnadmin --version

If HTTP/HTTPS access:如果 HTTP/HTTPS 访问:

  • See the "powered by Subversion" line when accessing the server via a browser.通过浏览器访问服务器时,请参阅“由 Subversion 提供支持”这一行。

  • Access the repository via browser and then look for the version string embedded in the HTML source.通过浏览器访问存储库,然后查找嵌入在 HTML 源代码中的版本字符串。 From earlier answers by elviejo and jaredjacobs .来自elviejojaredjacobs 的早期回答 Similarly, from ??, use your browser's developer tools (usually Ctrl + Shift + I ) to read the full response.同样,从 ?? 开始,使用浏览器的开发人员工具(通常是Ctrl + Shift + I )阅读完整响应。 This is also the easiest (non-automated) way to deal with certificates and authorization - your browser does it for you.这也是处理证书和授权的最简单(非自动化)方法 - 您的浏览器会为您完成。

  • Check the response tags (these are not shown in the HTML source), from an earlier answer by Christopher检查响应标签(这些未显示在 HTML 源代码中),来自Christopher 较早的回答

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

If svn:// or ssh+svn access如果 svn:// 或 ssh+svn 访问

If GoogleCode SVN servers如果 GoogleCode SVN 服务器

    Check out the current version in a FAQ: 
    http://code.google.com/p/support/wiki/SubversionFAQ#What_version_of_Subversion_do_you_use?

If another custom SVN servers如果另一个自定义 SVN 服务器

    TBD

Please edit to finish this answer请编辑以完成此答案

For CLIENT (not the original question):对于客户(不是原始问题):

svn --version

On the server: svnserve --version在服务器上: svnserve --version

in case of svnserve-based configuration (svn:// and svn+xxx://).如果是基于 svnserve 的配置(svn:// 和 svn+xxx://)。

(For completeness). (为了完整性)。

Here's the simplest way to get the SVN server version.这是获取SVN服务器版本的最简单方法。 HTTP works even if your SVN repository requires HTTPS .即使您的 SVN 存储库需要HTTPS, HTTP 也能工作。

$ curl -X OPTIONS http://my-svn-domain/
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>...</head>
<body>...
<address>Apache/2.2.11 (Debian) DAV/2 SVN/1.5.6 PHP/5.2.9-4 ...</address>
</body>
</html>

For an HTTP-based server there is a Python script to find the server version at: http://svn.apache.org/repos/asf/subversion/trunk/tools/client-side/server-version.py对于基于 HTTP 的服务器,有一个 Python 脚本可以在以下位置找到服务器版本: http : //svn.apache.org/repos/asf/subversion/trunk/tools/client-side/server-version.py

You can get the client version with您可以通过以下方式获取客户端版本

`svn --version`

If the Subversion server version is not printed in the HTML listing, it is available in the HTTP RESPONSE header returned by the server.如果 Subversion 服务器版本没有打印在 HTML 列表中,它在服务器返回的 HTTP RESPONSE 标头中可用。 You can get it using this shell command您可以使用此 shell 命令获取它

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

If the SVN server requires you provide a user name and password, then add the wget parameters --user and --password to the command like this如果 SVN 服务器要求你提供用户名和密码,那么在命令中添加wget参数--user--password像这样

wget -S --no-check-certificate \
  --user='username' --password='password' \
  --spider 'http://svn.server.net/svn/repository' 2>&1 \
  | sed -n '/SVN/s/.*\(SVN[0-9\/\.]*\).*/\1/p';

One more option: If you have Firefox (I am using 14.0.1) and a SVN web interface:还有一种选择:如果您有 Firefox(我使用的是 14.0.1)和一个 SVN Web 界面:

  • Open Tools->Web Developer->Web Console on a repo page在 repo 页面上打开Tools->Web Developer->Web Console
  • Refresh page刷新页面
  • Click on the GET line单击GET
  • Look in the Response Headers section at the Server: line查看Server:行的Response Headers部分

There should be an "SVN/1.7.4" string or similar there.那里应该有一个“SVN/1.7.4”字符串或类似的字符串。 Again, this will probably only work if you have "ServerTokens Full" as mentioned above.同样,这可能只有在您拥有上述“ServerTokens Full”时才有效。

There really isn't an easy way to find out what version of Subversion your server is running -- except to get onto the server and see for yourself.确实没有一种简单的方法可以找出您的服务器正在运行的 Subversion 版本——除了进入服务器并亲自查看。

However, this may not be as big a problem as you may think.然而,这可能不是你想象的那么大的问题。 Subversion clients is were much of the grunt work is handled, and most versions of the Subversion clients can work with almost any version of the server. Subversion 客户端处理了大部分繁重的工作,并且大多数版本的 Subversion 客户端可以与几乎任何版本的服务器一起工作。

The last release where the server version really made a difference to the client was the change from release 1.4 to release 1.5 when merge tracking was added.服务器版本真正对客户端产生影响的最后一个版本是在添加合并跟踪时从 1.4 版更改为 1.5 版。 Merge tracking had been greatly improved in version 1.6, but that doesn't really affect the interactions between the client and server.合并跟踪在 1.6 版中得到了很大改进,但这并没有真正影响客户端和服务器之间的交互。

Let's take the latest changes in Subversion 1.8:让我们看看 Subversion 1.8 的最新变化:

  • svn move is now a first class operation : Subversion finally understands the svn move is not a svn copy and svn delete . svn move现在是一流的操作:Subversion 终于明白svn move不是svn copysvn delete However, this is something that the client handles and doesn't really affect the server version.但是,这是客户端处理的事情,并不会真正影响服务器版本。
  • svn merge --reintegrate deprecated : Again, as long as the server is at version 1.5 or greater this isn't an issue. svn merge --reintegrate deprecated :同样,只要服务器是 1.5 或更高版本,这不是问题。
  • Property Inheritance : This is another 1.8 release update, but this will work with any Subversion server -- although Subversion servers running 1.8 will deliver better performance on inheritable properties.属性继承:这是另一个 1.8 版本更新,但这将适用于任何 Subversion 服务器——尽管运行 1.8 的 Subversion 服务器将在可继承属性上提供更好的性能。
  • Two new inheritable properties - svn:global-ignores and svn:auto-props : Alas!两个新的可继承属性 - svn:global-ignoressvn:auto-props :唉! What we really wanted.我们真正想要的。 A way to setup these two properties without depending upon the Subversion configuration file itself.一种设置这两个属性而不依赖于 Subversion 配置文件本身的方法。 However, this is a client-only issue, so it again doesn't matter what version of the server you're using.但是,这是一个仅限客户端的问题,因此再次与您使用的服务器版本无关。
  • gnu-agent memory caching : Another client-only feature. gnu-agent 内存缓存:另一个仅限客户端的功能。
  • fsfs performance enhancements and authz in-repository authentication. fsfs 性能增强和 authz 存储库内身份验证。 Nice features, but these work no matter what version of the client you're using.不错的功能,但无论您使用什么版本的客户端,这些功能都可以使用。

Of all the features, only one depends upon the version of the server being 1.5 or greater (and 1.4 has been obsolete for quite a while. The newer features of 1.8 will improve performance of your working copy, but the server being at revision 1.8 isn't necessary. You're much more affected by your client version than your server version.在所有功能中,只有一个取决于服务器的版本为 1.5 或更高版本(并且 1.4 已经过时了很长时间。1.8 的新功能将提高您的工作副本的性能,但修订版为 1.8 的服务器不是没有必要。与服务器版本相比,客户端版本对您的影响要大得多。

I know this isn't the answer you wanted (no official way to see the server version), but fortunately the server version doesn't really affect you that much.我知道这不是您想要的答案(没有查看服务器版本的官方方法),但幸运的是,服务器版本对您的影响并不大。

Try this:试试这个:

ssh your_user@your_server svnserve --version

svnserve, version 1.3.1 (r19032)
   compiled May  8 2006, 07:38:44

I hope it helps.我希望它有帮助。

For a svn+ssh configuration, use ssh to run svnserve --version on the host machine:对于 svn+ssh 配置,使用 ssh 在主机上运行 svnserve --version:

$ ssh user@host svnserve --version $ ssh user@host svnserve --version

It is necessary to run the svnserve command on the machine that is actually serving as the server.需要在实际充当服务器的机器上运行 svnserve 命令。

Browse the repository with Firefox and inspect the element with Firebug .使用 Firefox 浏览存储库并使用Firebug检查元素。 Under the NET tab, you can check the Header of the page.在 NET 选项卡下,您可以检查页面的 Header。 It will have something like:它会有类似的东西:

Server: Apache/2.2.14 (Win32) DAV/2 SVN/1.X.X

Just use a web browser to go to the SVN address.只需使用网络浏览器转到 SVN 地址即可。 Check the source code ( Ctrl + U ).检查源代码( Ctrl + U )。 Then you will find something like in the HTML code:然后你会在 HTML 代码中找到类似的东西:

<svn version="1.6. ..." ...

For Subversion 1.7 and above, the server doesn't provide a footer that indicates the server version.对于 Subversion 1.7 及更高版本,服务器不提供指示服务器版本的页脚。 But you can run the following command to gain the version from the response headers但是您可以运行以下命令从响应头中获取版本

$ curl -s -D - http://svn.server.net/svn/repository
HTTP/1.1 401 Authorization Required
Date: Wed, 09 Jan 2013 03:01:43 GMT
Server: Apache/2.2.9 (Unix) DAV/2 SVN/1.7.4

Note that this also works on Subversion servers where you don't have authorization to access.请注意,这也适用于您无权访问的 Subversion 服务器。

您可以使用HTTP连接到 Subversion 服务器并在 HTTP 标头中找到版本号。

A repository is not automatically updated unless the administrator runs 'svnadmin upgrade'. 除非管理员运行“ svnadmin upgrade”,否则不会自动更新存储库。 To be sure of the version number of the repository, check the 'format' file. 要确定存储库的版本号,请检查“格式”文件。 See @bdumitriu's comment . 参见@bdumitriu的评论

Go to the repository folder and type 转到存储库文件夹并输入

svnadmin info .

it will return what you need, like the repository format and the client compatibility version. 它将返回您需要的内容,例如存储库格式和客户端兼容性版本。

Path: .
UUID: e65b8a35-4d38-7941-a369-78be7fd1bdf9
Revisions: 1294
Repository Format: 5
Compatible With Version: 1.10.0
Repository Capability: mergeinfo
Filesystem Type: fsfs
Filesystem Format: 8
FSFS Sharded: yes
FSFS Shard Size: 1000
FSFS Shards Packed: 1/1
FSFS Logical Addressing: yes
Configuration File: db\fsfs.conf

If you use VisualSVN Server, you can find out the version number by several different means.如果您使用 VisualSVN Server,您可以通过几种不同的方式找到版本号。

Use VisualSVN Server Manager使用 VisualSVN 服务器管理器

Follow these steps to find out the version via the management console:按照以下步骤通过管理控制台查找版本:

  1. Start the VisualSVN Server Manager console.启动VisualSVN 服务器管理器控制台。
  2. See the Version at the bottom-right corner of the dashboard.查看仪表板右下角的版本

在此处输入图片说明

If you click Version you will also see the versions of the components.如果单击版本,您还将看到组件的版本。

在此处输入图片说明

Check the README.txt file检查 README.txt 文件

Follow these steps to find out the version from the readme.txt file:按照以下步骤从 readme.txt 文件中找出版本:

  1. Start notepad.exe .启动记事本.exe
  2. Open the %VISUALSVN_SERVER%README.txt file.打开%VISUALSVN_SERVER%README.txt文件。 The first line shows the version number.第一行显示版本号。

在此处输入图片说明

命令行上的以下内容应为您提供版本号

   svn --version

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM