工作副本已锁定
我正在使用 subversion 作为版本控制来开发一个 Web,但收到“工作目录已锁定”错误消息
故事如下:
我有
PC-A:
- Windows XP Pro
- VisualSVN 2.5.2
- Tortoise SVN 1.7.3
PC-B:
- Windows XP Home
- Tortoise SVN 1.7.3
我已经使用 VisualSVN 在 PC-A 上创建了存储库。
从 PC-B,我将 http:\\PC-A:81\svn\test\trunk 检出到 D:\xampp\htdocs\test-lalala。
从 PC-A,我还签出了 http:\\PC-A:81\svn\test\trunk 到 D:\xampp\htdocs\test-lalala。
我创建了一个运行 my-post-commit.bat 文件的提交后挂钩,因此当我提交到 http:\\PC-A:81\svn\test\trunk 时,文件夹 D:\xampp\htdocs\test-lalalaon PC-遗嘱已更新,以便其他人可以看到结果。
"C:\Program Files\VisualSVN Server\bin\svn.exe" update "D:\xampp\htdocs\test-lalala" --username myusername --password mypassword --config-dir "C:\Program Files\VisualSVN Server\conf"
在PC-B上,创建index.php文件,并提交。当我提交时,我收到此错误消息
在 PC-A 上,我尝试右键单击 D:\ xampp\htdocs\test-lalala TortoiseSVN > CleanUp,并选中“清理工作副本状态”和“包括外部”(默认选中)。尝试添加文件并提交,但仍然收到相同的错误消息。
我尝试在 .svn 文件夹上查找锁定文件,但没有锁定文件。我还尝试删除 PC-A D:\xampp\htdocs\test-lalala 上的工作副本并再次签出,但是当我提交时,仍然收到相同的错误消息。
如何解决此错误消息?那么当我提交时,该文件夹会自动更新吗?
I'm developing a web using subversion as version control, but got "working directory locked" error message
Here's the story:
I have
PC-A:
- Windows XP Pro
- VisualSVN 2.5.2
- Tortoise SVN 1.7.3
PC-B:
- Windows XP Home
- Tortoise SVN 1.7.3
I have create repository on PC-A using VisualSVN.
From PC-B, I Checkout http:\\PC-A:81\svn\test\trunk to D:\xampp\htdocs\test-lalala.
From PC-A, I also checkout http:\\PC-A:81\svn\test\trunk to D:\xampp\htdocs\test-lalala.
I Create a post-commit hooks running my-post-commit.bat file so when I commit to http:\\PC-A:81\svn\test\trunk, folder D:\xampp\htdocs\test-lalalaon PC-A will updated, so other people can see the result.
"C:\Program Files\VisualSVN Server\bin\svn.exe" update "D:\xampp\htdocs\test-lalala" --username myusername --password mypassword --config-dir "C:\Program Files\VisualSVN Server\conf"
On PC-B, Create index.php file, and commit. When I commit, I get this error message
On PC-A, I try to right-click on D:\xampp\htdocs\test-lalala TortoiseSVN > CleanUp, and check "cleanup working copy status" and "Include externals" (checked by default). Try to add file and commit, but still got the same error message.
I try to look for lock file on .svn folder but there are no lock file. I also try to delete working copy on PC-A D:\xampp\htdocs\test-lalala and checkout again, but when I commit, still got the same error message.
How to solve this error message? So when I commit, the folder will updated automatically ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(16)
每次我收到工作副本锁定错误时,我都会运行“清理”。之后一切恢复正常。
在命令行上,您可以执行 svn cleanup ,这也会删除锁定文件。
注意:在上一级目录上执行此操作,大多数情况下应该可以解决。
Every time I get a Working copy locked error I run a "Clean up". After that everything is back to normal.
On the command line you can execute
svn cleanup
which also removes lock files.Note: Perform this operation on one level up directory and that should resolve most of the times.
对于仍然遇到此问题的任何人(错误:工作副本“{DIR}”已锁定。),我有您的解决方案:
我发现当其中一个 TortoiseSVN 窗口崩溃时,它会留下一个 TSVNCache.exe,该文件仍然有一些您的工作句柄复制,这会导致您看到的锁定问题(并且还会阻止清理工作)。
因此,要解决此问题:
1a
) 使用 Process Explorer 或类似工具删除 TSVNCache.exe 拥有的句柄
1b) ..或者更简单,只需使用任务管理器杀死 TSVNCache.exe
然后
2) 右键单击 ->乌龟SVN->清理。仅需要检查“清理工作副本状态”。
从那里开始,快乐的更新/提交。您可以通过执行 SVN 更新来重现锁定行为,然后在更新完成之前快速终止其 TortoiseProc.exe 进程。
To anyone still having this issue (Error: Working copy '{DIR}' locked.), I have your solution:
I found that when one of TortoiseSVN windows crash, it leaves a TSVNCache.exe that still has a few handles to your working copy and that is causing the Lock issues you are seeing (and also prevents Clean Up from doing it's job).
So to resolve this:
Either
1a) Use Process Explorer or similar to delete the handles owned by TSVNCache.exe
1b) ..Or even easier, just use Task Manager to kill TSVNCache.exe
Then
2) Right click -> TortoiseSVN -> Clean up. Only "Clean up working copy status" needs to be checked.
From there, happy updating/committing. You can reproduce Lock behavior by doing SVN Update and then quickly killing it's TortoiseProc.exe process before Update finishes.
在顶级目录级别运行“清理”。
Run a "Clean up" at the top directory level.
我通过删除WC_LOCK表中SQLite“.svn\wc.db”文件锁定记录中的WC_Lock记录解决了这个问题。
只需使用 SQLite 编辑器打开“wc.db”文件并
从 WC_LOCK 执行删除
该解决方案在另一个我现在找不到的链接中给出。但确实是一个很好的修复;不用担心删除所有目录
I solved it by deleting WC_Lock record in the SQLite ".svn\wc.db" file lock record in the WC_LOCK table.
Just open "wc.db" file with SQLite editor and executed
delete from WC_LOCK
The solution was given in another link that I cannot find right now. But really quite a fix; without worrying about deleting all directories
我通过删除隐藏的
.svn
文件夹并将其替换为新的签出.svn
来修复它,并且它起作用了。可能这个隐藏文件夹被搞乱了!I fixed it by deleting the hidden
.svn
folder and replaced it with the fresh checkout.svn
and it worked. Probably this hidden folder got messed up!我确信它对您来说工作正常
转到顶级 SVN 文件夹。
右键单击文件夹(包含您的 svn 文件)->乌龟SVN-> CleanUp
这肯定会解决你的问题。
I am sure It working fine for you
Goto top level SVN folder.
Right Click on folder(that has your svn files) -> TortoiseSVN -> CleanUp
This will surely solve your problem.
您只需一步即可修复它。
第 1 步:打开终端并转到您的项目,然后触发命令“svn cleanup”,然后“svn update”
You can fix it with only one step.
Step 1 : Open terminal and go to your project then fire command "svn cleanup" then "svn update"
如果您是 Windows 用户并使用“Tortoise SVN”用户。
选择文件。右键单击。
选项“乌龟SVN”-->得到锁。
使用选项“偷锁”。
If you are Windows guy and using "Tortoise SVN' user.
Select the File. Right Click.
Option 'Tortoise SVN' --> get Lock.
Use option 'Steal The Lock'.
我最终使用导出命令而不是更新命令。这是提交后挂钩
“C:\Program Files\VisualSVN Server\bin\svn.exe”导出“D:\xampp\htdocs\test-lalala”--quiet --non-interactive --force --username我的用户名 --密码 我的密码
I ended up using export command rather than update command. This is the post-commit hook
"C:\Program Files\VisualSVN Server\bin\svn.exe" export "D:\xampp\htdocs\test-lalala" --quiet --non-interactive --force --username myusername --password mypassword
错误“工作副本已锁定”,
只需按照以下步骤操作:
您可以正确更新 svn 而不会出现错误
error "working copy locked",
Just follow the steps :
You can update the svn properly without error
Tortoise svn -> 清理
这就是 SVN 中的全部内容
Tortoise svn ->clean up
Thats all in SVN
当您遇到工作副本错误时,只需运行 svn cleanup 即可清除所有不需要的文件和文件夹。如果仍然出现错误,则做一件事。
将文件复制到其他驱动器并删除工作副本文件夹或文件,然后进行更新,它将获取新文件,然后替换为更新的副本并提交相同的文件。
As you get working copy error, Just run the
svn cleanup
which clean all the unwanted files and folders. If still error comes, then do one thing.Copy your files to other drive and delete the working copy folder or file and then take a update it will fetch the fresh file and after this replace with your updated copy and commit the same.
我遇到过与您描述的相同的问题。这似乎是 Tortoise 1.7.3 上的一个错误。我已经恢复到 1.7.2,执行了清理和更新。
现在我的 SVN/Tortoise 又工作正常了
I have experienced the same issues as you described. It appears to be a bug on Tortoise 1.7.3. I have reverted back to 1.7.2, executed a cleanup and an update.
Now my SVN/Tortoise is working fine again
对于 PHPStorm 或 Intellij:
For PHPStorm or Intellij:
您的 BitLocker 磁盘加密是否正在运行?就我而言,它锁定了整个磁盘驱动器以进行加密,并且 SVN 因此错误而失败。
Is your BitLocker disk encryption running? In my case, it locked the whole drive of the disk for encryption, and SVN failed with this error.
重复两次
repeat twice