svn提交失败,但repo中的旧修订版已随我的编辑而更改



我对正在使用的文件做了一个小更改,并准备提交我的编辑。

$ svn commit -m "comment"
Sending        pom.xml
svn: E160042: Commit failed (details follow):
svn: E160042: File or directory 'pom.xml' is out of date; try updating
svn: E160024: resource out of date; try updating

AFAIK,现在回购应该没有任何变化,对吧?显然有人做了更改,我忘记在编辑文件之前更新我的工作副本,我更新了。

$ svn update
Updating '.':
U    another.unrelated.file
G    pom.xml
Updated to revision 11943.

不出所料,我们的更改被合并(到我的工作副本中,对吧?),所以我检查了状态。

$ svn status

没有变化?为什么?pom.xml的合并工作副本不应该标记为已修改吗?我运行svn info来查看发生了什么。

$ svn info
Path: .
Working Copy Root Path: working/dir
URL: https://not.relevant
Repository Root: https://not.relevant
Repository UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Revision: 11943
Node Kind: directory
Schedule: normal
Last Changed Author: otherguy
Last Changed Rev: 11856
Last Changed Date: 2012-01-04 16:12:42 +0100 (Wed, 04 Jan 2012)

"Last Changed"不应该是我的零钱,而不是8天前其他人的零钱吗?所以我查看回购文件,看看里面到底有什么。

svn cat https://company.com/repo/path/to/pom.xml | less

它显示了文件的合并版本!(我和其他人都做出了改变)。

这里发生了什么事?svn是否在没有更新任何元数据的情况下用我的更改更改了文件的现有修订版?这可能吗?

我认为您的工作副本仍然过期。

红皮书上写着:

http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.cat.html

如果您的工作副本已过期(或您有本地修改)并且您希望在工作副本中查看文件的HEAD修订,svn-cat-r HEAD FILENAME将自动获取指定的路径:

您的本地pom.xml实际上与从repo中获取的pom.xml不同吗?

最新更新