eclipse 如何修复 Subversion 锁定错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9756157/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 20:58:12  来源:igfitidea点击:

How to fix Subversion lock error

eclipsesvnsubclipse

提问by Cerin

How do you fix the Subversion/Subclipse error "Attempted to lock an already-locked dir"?

如何修复 Subversion/Subclipse 错误“试图锁定已锁定的目录”?

Googling shows people routinely encounter this error, and the only solution I've seen posted is to run Subclipse's Team->Cleanup command. Unfortunately, I get this error whenI run the Team->Cleanup command. Are there any other options?

谷歌搜索显示人们经常遇到这个错误,我看到发布的唯一解决方案是运行 Subclipse 的 Team->Cleanup 命令。不幸的是,我运行 Team->Cleanup 命令时出现此错误。还有其他选择吗?

采纳答案by Cerin

I tried recursively deleting all lockfiles, but that just resulted the error "Path is not a working copy". I ended up having to do Team->Disconnect and then Team->Share. Upon reconnect, it complained about existing .svnfiles, which it deleted. Now it seems to be working.

我尝试递归删除所有lock文件,但这只是导致错误“路径不是工作副本”。我最终不得不执行 Team->Disconnect 然后 Team->Share。重新连接后,它抱怨.svn已删除的现有文件。现在它似乎正在工作。

回答by user3312309

I had similar problem. Team->Refresh/Cleanup Solved my problem

我有类似的问题。团队->刷新/清理解决了我的问题

回答by Vijay Bhatt

Error :Attempted to lock an already-locked dirsvn: Working copy 'C:\work\myproject\workspaces\HPDP' locked.

错误:试图锁定已锁定的目录svn:工作副本 'C:\work\myproject\workspaces\HPDP' 已锁定。

Solution:Worked for me.

解决方案:对我来说有效。

        Right-click on project-->Team-->Refresh/Cleanup

回答by Andrea Girardi

I tried all suggestion from this thread but the only one that worked is:

我尝试了该线程中的所有建议,但唯一有效的是:

  1. go to the folder on which the project locked folder is stored
  2. execute svn cleanup
  1. 转到存储项目锁定文件夹的文件夹
  2. 执行svn 清理

回答by robot-nofollow

I get this too. I go to the directory (not in Eclipse) where the files are, go into the .svn dir and delete the file called lock.

我也明白了。我转到文件所在的目录(不在 Eclipse 中),进入 .svn 目录并删除名为lock的文件。

Flip back to Eclipse and continue.

翻转回 Eclipse 并继续。

There is a similar question here Problems committing file to SVN repository

这里有一个类似的问题问题提交文件到 SVN 存储库

回答by Mhandroid

I solved this problem by doing these:

我通过执行以下操作解决了这个问题:

  1. Right click on your project.

  2. Click on Team

  3. Click Refresh/Cleaup

  1. 右键单击您的项目。

  2. 点击团队

  3. 单击刷新/清除

回答by Justin

Old question, but none of the above solutions worked for me. What did work was to close eclipse, then using Tortoise, right click on the project in Windows Explorer and choose 'TortoiseSVN' -> 'Clean up', then just use the default checkboxed items (Clean up working copy status, include externals), then hit OK.

老问题,但上述解决方案都不适合我。所做的工作是关闭 Eclipse,然后使用 Tortoise,右键单击 Windows 资源管理器中的项目并选择“TortoiseSVN”->“清理”,然后只使用默认的复选框项目(清理工作副本状态,包括外部),然后点击确定。

This cleaned up the folder, then I was able to update and commit files as normal.

这清理了文件夹,然后我就可以像往常一样更新和提交文件。

回答by Akitha_MJ

Just Right Click on Project

只需右键单击项目

  1. Click on Team

  2. Click Refresh/Cleaup

  1. 点击团队

  2. 单击刷新/清除

this will remove all the current lockfiles created by SVN

这将删除SVN 创建的所有当前锁定文件

hope this will help !!!!

希望这会有所帮助!!!!

回答by Cedric Simon

Using SVN 1.8, deleting lock file does not help (lock file does not exists).

使用 SVN 1.8,删除锁定文件没有帮助(锁定文件不存在)。

Refresh/Cleanup did not solve either.

刷新/清理也没有解决。

What did solve:

解决了什么:

1) Backup your directory, just incase...
2) Team... Disconnect. Choose to remove .svn files
3) Add it again to SVN.

Note: In my case, error was due to loss of network connection during initial commit.

注意:就我而言,错误是由于初始提交期间网络连接丢失造成的。

回答by SkateScout

After the same problem with "phantom lock" the only solution was:

在“幻像锁”出现同样的问题之后,唯一的解决方案是:

1) Disconnect the Project Eclipse->Team->Disconnect (select option to delete .svn folder)

1) 断开项目 Eclipse->Team->Disconnect(选择删除 .svn 文件夹的选项)

2) Than "reconnect" Eclipse->Team->SVN->Share Project. Ignore the warning about better do an checkout. After this all worked fine.

2)比“重新连接”Eclipse->团队->SVN->共享项目。忽略关于更好地结帐的警告。在这一切之后一切正常。

Cleanup and Restart was no solutions, also Scan Locks did not show anything.

清理和重新启动没有解决方案,扫描锁定也没有显示任何内容。

回答by Szabó ákos

We had the same repeating problem. It's a disaster. What can you do if cleanup and unlock does not help because there is no existing lock?

我们有同样的重复问题。这是一场灾难。如果清理和解锁没有帮助,因为没有现有的锁,你能做什么?

  1. Search the hidden .svnfolder in your directory structure. It contains a wc.dbfile which is an sql lite file.
  2. Open it with an sql client, e.g. DBeaver. Add an sql lite connection to the dbeaver by selecting the wc.dbfile.
  3. Open the WC_LOCK table. You can see one or more rows that contains the URL which was mentioned in the phantom lock error window.
  4. Delete these rows from the table.
  5. Try to update your project from the repo.
  6. If you use more than 1 repo in 1 project (externals) another phantom lock may appear during the update. In this case repeat the process with that folder.
  1. .svn在目录结构中搜索隐藏文件夹。它包含一个wc.db文件,它是一个 sql lite 文件。
  2. 用 sql 客户端打开它,例如 DBeaver。通过选择wc.db文件将 sql lite 连接添加到 dbeaver 。
  3. 打开 WC_LOCK 表。您可以看到一行或多行包含幻像锁定错误窗口中提到的 URL。
  4. 从表中删除这些行。
  5. 尝试从 repo 更新您的项目。
  6. 如果您在 1 个项目(外部)中使用 1 个以上的 repo,则更新期间可能会出现另一个幻象锁。在这种情况下,对该文件夹重复该过程。