【问题标题】:What causes SVN “Working copy <path> is locked”?什么导致 SVN “工作副本 <path> 被锁定”?
【发布时间】:2013-12-16 15:48:23
【问题描述】:

我编写了一个控制台应用程序,它使用 SharpSVN 来更新我的存储库中的 3 个文件夹。想将其转换为批处理脚本以消除对 SharpSVN 的依赖。

想出了这个:

CD C:\Program Files\TortoiseSVN\bin\
START TortoiseProc.exe /command:update /path:"C:\AMG\trunk\AMG_AccountManager\AMC\Core" /closeonend:0
START TortoiseProc.exe /command:update /path:"C:\AMG\trunk\AMG_AccountManager\AMC\Modules" /closeonend:0
START TortoiseProc.exe /command:update /path:"C:\AMG\trunk\AMG_AccountManager\MW" /closeonend:0

我找到了this as an answer to another SO question。当我运行它时,我会从 Tortoise 中弹出 3 个窗口。

有人说:

Error: Working copy 'C:\AMG\trunk\AMG_AccountManager\AMC' locked.
Error: 'C:\AMG\trunk\AMG_AccountManager\AMC' is already locked.

第二个说:

Error: Working copy 'C:\AMG\trunk\AMG_AccountManager' locked.
Error: 'C:\AMG\trunk\AMG_AccountManager\AMC' is already locked.

第三个成功更新了 Modules 文件夹。有谁知道是什么导致前两个被锁定?

【问题讨论】:

    标签: svn batch-file tortoisesvn


    【解决方案1】:

    您不能对同一个工作副本同时执行三个更新操作。这是设计使然,而这正是工作副本锁定所完成的。

    如果你想使用 TortoiseSVN,你必须使用 start command/wait 标志并一一更新:

    /wait :启动一个应用程序并等待它结束。

    如果您不需要花哨的 GUI,您可以直接调用 svn(假设您在安装 TortoiseSVN 时选择了命令行工具)。

    【讨论】:

    • 哦,我明白了。所以我只是喜欢START TortoiseProc.exe /wait &lt;everything else in my original post&gt;吗?
    • 我自己没试过。注意/waitstart 的标志,而不是TortoiseProc.exe
    • 谢谢。我做了 START /wait 并且有效,但是我必须在 Tortoise 弹出的屏幕上单击“确定”,然后它才会更新下一个...不确定我是否比现有的控制台更喜欢这个应用程序,它只是做他们所有。再次感谢。
    • /closeonend:0 可能没有传递给TortoiseProc.exe。批处理语法非常难以正确。
    • 不,那是我的错误。它应该是 1 而不是 0
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-12
    • 1970-01-01
    • 2010-09-12
    • 2012-02-03
    • 2011-06-19
    • 1970-01-01
    • 2011-12-20
    相关资源
    最近更新 更多