我如何知道当前的 svn 存储库是哪个版本?

Posted

技术标签:

【中文标题】我如何知道当前的 svn 存储库是哪个版本?【英文标题】:How do I know which version current svn repository is? 【发布时间】:2009-05-14 15:41:37 【问题描述】:

最近,我决定将我的 svn 存储库从 v1.5 升级到 v1.6。运行升级命令后,我在 CMD 窗口中看到了消息。

D:\svn>svnadmin upgrade repo
Repository lock acquired. 
Please wait; upgrading the repository may take some time...

Upgrade completed.

D:\svn>_

耶!!看起来很棒……但是……我怎么知道当前存储库是哪个版本?它是升级到 v1.6 还是仍然是 v1.5。我拥有的存储库很少。我怎样才能知道他们的版本?

【问题讨论】:

【参考方案1】:

查看存储库路径中的文件“格式”。它应该包含您的存储库的架构。由于 Subversion 1.4 是 5,并且在 Subversion 2 之前可能不会更改。只要架构不更改,就不需要“svnadmin upgrade”。

引用http://svn.apache.org/repos/asf/subversion/trunk/notes/repos_upgrade_HOWTO:

Anyone upgrading between versions of subversion that have different
repository schemas.  Schema versions are as follows:

    SUBVERSION VERSION NUMBER           SCHEMA VERSION
    -------------------------           --------------
    Up to and including 0.27            1
    0.28 - 0.33.1                       2
    0.34 - 1.3                          3
    (no released version used this)     4
    1.4 -                               5

If necessary you can see which schema version your repository is
currently using by looking at the format file in the repository.

It should be noted that these changes are extremely rare.  Now that
subversion has reached 1.0.0 our compatibility guarantees require
forward and backward compatible repository formats for all patch
releases and backward compatible for minor releases.  So until
2.0.0 comes out there will be no change that should require a 
dump for upgrading to newer versions.

While Subversion does create version 5 repositories by default as of
version 1.4, it still supports reading and writing version 3
repositories for backwards compatibility.  Additionally, a pre-1.3
client can communicate with a 1.4+ server accessing a version 5
repository.

不要将存储库模式与工作副本之一混淆。工作副本中的格式文件包含当前版本的 subversion 的“9”。

【讨论】:

我的说是 9。我认为这与 1.59 相关 感谢您尝试回答我的问题。我在位于存储库路径的格式文件中只看到了一个字母“5”。这是什么意思? -1 此文件最后修改时间:2006 年 12 月 11 日星期一 17:28:05 UTC(2 年零 5 个月前)由 glasser 看来是这样。 svn 1.4 到 1.6 的版本使用相同的存储库架构版本 如果您只是将版本 1.5 更改为 1.6,则不需要升级它。 @tuergeist:该文件未被弃用。当前版本的 subversions 也使用 schema-version 5 创建存储库。【参考方案2】:

除了/format,现在还有一个文件/db/format,e.g.在使用 1.6.x 创建的默认仓库中,它具有以下内容:

4 布局分片 1000

对于升级到 1.5.5 的 repo:

3 线性布局

对于普通的 1.4.2 存储库:

2

【讨论】:

【参考方案3】:

看这段代码改变subversion工作副本的format

最新的格式是

LATEST_FORMATS =  "1.4" : 8,
                   "1.5" : 9,
                   "1.6" : 10

【讨论】:

以上是关于我如何知道当前的 svn 存储库是哪个版本?的主要内容,如果未能解决你的问题,请参考以下文章

如何检查代码库是用哪个版本的 Python 编写的? [关闭]

如何在将一个巨大的存储库拆分为单独的存储库时将 SVN 转换为 GIT?

WebSVN - 存储库中路径的身份验证

svn 的非 LF 行结束问题 svn:ignore on dump load

Git vs SVN:性能和存储

如何在 xCode 9.0 中设置 SVN 存储库