本文介绍了SVN 经常说文件被我锁定在另一个工作副本中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 SVN 存储库(托管在 Dreamhost 上),在二进制文件上设置了需求锁定.有时会发生这种情况,在提交由我锁定和修改的文件时,提交失败并显示错误:

I have an SVN repository (hosted on Dreamhost) with needs-lock set on binary files. It sometimes happen that, while committing files locked and modified by me, the commit fails with the error:

Error: Commit failed (details follow):
Error: File '/my/file.bin' is locked in
Error:  another working copy

如果我尝试获得该文件的锁定(不窃取它),它会说:

If I try to get the lock on that file (without stealing it) it says:

Error: Path '/my/file.bin' is already locked by user
Error:  'my_username' in filesystem '/home/user1/svn/repo1/db'

清理没有帮助,所以解决这个问题的唯一方法是窃取锁,然后提交成功.

Cleanup doesn't help, so the only way to solve this is to steal the lock, and then the commit succeedes.

这不是一个关键问题,但确实很烦人,尤其是在长时间提交的过程中.我倾向于认为这是由客户端或服务器的错误引起的,因为我确定我没有使用其他工作副本,并且这个问题在我身上发生得相当频繁(过去两天发生了 3 次)和我的同事使用存储库.

This is not a critical issue, but it is really annoying, especially when it happens in the middle of a long commit.I am inclined to think that this is caused by a bug of the client or the server, since I am sure that I'm not using other working copies, and the issue happens fairly frequently (3 times in the last two days) to me and my colleagues using the repository.

我们使用的是 TortoiseSVN 1.8.4,而 Dreamhost svn 服务器是 1.6.12.

We are using TortoiseSVN 1.8.4, while the Dreamhost svn server is 1.6.12.

感谢您的帮助.

更新:我注意到如果我在提交之前更新我的工作副本会发生错误(这没有错误,当然不会修改锁定的文件).通过检查文件的状态,在更新乌龟说它被我锁定之前(仅在本地检查),而在本地检查更新后,它给出????"作为锁定状态,并通过检查服务器然后说它被我锁定.更新后文件变为只读(因为需要锁定),即使它仍被标记为已修改.所以动作顺序是:锁定file.bin -> 修改file.bin -> 更新整个工作副本-> 提交-> 提交失败错误.更新后,工作副本似乎忘记了锁的状态,当它询问服务器时,它认为它已锁定在另一个工作副本上.

UPDATE: I noticed that the error happens if I do an update of my working copy before committing (which gives no error and of course does not modify the locked files). By checking the status of the file, before the update tortoise says it is locked by me (checking only locally), while after the update checking locally it gives "????" as locking state, and by checking the server it then says it is locked by me. After the update the file is made read-only (because of the needs-lock), even if it is still marked as modified. So the sequence of actions is: lock file.bin -> modify file.bin -> update the whole working copy -> commit -> commit failed error. After the update the working copy seems to forget the state of the lock, and when it asks the server it believes it is locked on another working copy.

推荐答案

在 Windows 上,我通过以下步骤解决了问题:1. 单击菜单中的Repo-browser"启动存储库浏览器.2. 找到锁定的文件.3. 在锁定的文件上右击鼠标.4. 点击破解锁".

On Windows, I fixed the problem by the following steps:1. Launch Repository Browser by clicking "Repo-browser" in the menu.2. Locate the locked file.3. Right click your mouse on the locked file.4. Click "break lock".

这篇关于SVN 经常说文件被我锁定在另一个工作副本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 10:45
查看更多