【问题标题】:Inconsistent behavior of SVN Info with externalsSVN Info 与外部的行为不一致
【发布时间】:2013-07-25 10:06:46
【问题描述】:

由于 SVN 存储库中的复杂结构,某些外部文件无法从存储库中正确检索。由于更改存储库结构不是一种选择,我开发了一个脚本,它遍历外部并在需要时“手动”检索它们(感谢“svn export”)。为了检测是否确实需要这个操作,我执行'svn info',假设如果文件不存在,或者它没有版本控制,它将返回不同于0。这确实是在 host1 (SVN Client 1.6.17) 中获得的行为:

# Initially, the directory is empty
host1$ ls
host1$ svn update

Fetching external item into 'main.rbf'
svn: warning: '<REMOTE_SVN_LOCATION1>'
is not the same repository as
'<REMOTE_SVN_LOCATION2>'

At revision 18413.

# Although we do the update, the external item is not fetched,
# as it is a single file coming from a different repository
# (known problem)
host1$ ls
# The file is not present, and SVN info acts accordingly
host1$ svn info main.rbf
main.rbf:  (Not a versioned resource)

svn: A problem occurred; see other errors for details

# If we force the SVN export
host1$ svn export <REMOTE_SVN_LOCATION1> main.rbf
A    main.rbf
Export complete.
host1$ ls
main.rbf

# then SVN info detects it and acts accordingly
host1$ svn info main.rbf
main.rbf:  (Not a versioned resource)

svn: A problem occurred; see other errors for details
host1$

在host2(SVN Client 1.6.11)中,“SVN info”的行为完全不同:无论文件是否存在(来自以前的导出),答案是:

# Directory is empty
host2$ ls
host2$ svn info main.rbf
Path: .
URL: <REMOTE_LOCATION>
Repository Root: ...
Repository UUID: ...
Revision: 18413
Node Kind: directory
Schedule: normal
Last Changed Author: ...
Last Changed Rev: 18326
Last Changed Date: ...

host2$ 

有什么理由来解释这种不一致的行为吗?如何在 host2 中检测到这个未版本控制的文件?

【问题讨论】:

  • 为什么你不想修复损坏的外部?
  • 我不能这样做...
  • 您可以在不更改 repo-tree 的情况下执行此操作:svn:external parent dir *of files to *some path in TARGET-REPO,修改 file-externals 以使用文件来自同一个仓库

标签: svn svn-externals


【解决方案1】:

svn infosvn info FILENAME不同的事情。

第二种形式可以获取unversioned文件的信息,第一种形式获取WC内部当前目录的信息

【讨论】:

  • 当然。如果你看到这个例子,你会注意到我总是使用第二种形式。
  • @Marda - 第二种形式永远不会适用于 unversioned 资源,我看到 host2$ svn info
  • 没错,这就是我所期望的,这是我在脚本中使用的信息,也是我在 host1 中得到的行为。为什么我在 host2 中得到不同的行为? (我已经更正了发布的代码)
  • 好吧,1.6.11的行为肯定是错误的,为什么不更新这个古老的版本呢?
猜你喜欢
  • 2011-03-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-23
  • 2013-09-02
  • 2020-02-28
相关资源
最近更新 更多