TFS 声称文件已锁定,即使它们没有 - 孤立锁

发布于 2024-09-30 08:49:29 字数 583 浏览 5 评论 0原文

我正在尝试使用 tf.exe 在两个分支之间执行无根据的合并。

当我运行该命令时,它失败并告诉我有 15-20 个文件被其他用户锁定。我查看了其他用户的待处理更改,他只在目标分支中签出了三个文件,并且没有一个文件被锁定。

以前有人经历过类似的事情吗?

编辑

在 Robaticus 的帮助下,我发现锁位于 tbl_lock 表中,但与它们关联的待处理更改不再存在。看起来除了那些给我们带来当前合并问题的锁之外,还有多个孤立锁。

有谁知道导致这些问题的原因或不涉及直接接触数据库的修复方法?我要做一些研究,看看是否能找到任何东西。

编辑 2

首次 Google 搜索“tfs 孤立锁”会返回以下内容:TFS 中的孤立锁

TFS 团队建议直接从表中删除它们,所以我想我必须这样做。

我没有看到任何帖子表明它已经修复。

I'm trying to perform a baseless merge between two branches using tf.exe.

When I run the command, it fails and tells me that there 15-20 files that are locked by another user. I've looked at the other user's pending changes and he only has three files checked out in the target branch and none of them are locked.

Has anyone experienced something similar to this before?

Edit

With help from Robaticus, I've found that the locks are in the tbl_lock table, but the pending changes they are associated with do not exist any more. It looks like there are multiple orphaned locks other than the ones that are giving us the current merge issue.

Does anyone know what causes these or a way of fixing them that does not involved touching the DB directly? I'm off to do a little research to see if I can find anything.

Edit 2

First Google search for 'tfs orphaned locks' returns this: Orphaned locks in TFS

The TFS team recommends deleting them directly from the table, so I guess I'll have to do that.

I didn't see any posts indicating that it had been fixed yet.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猫烠⑼条掵仅有一顆心 2024-10-07 08:49:29

您可能需要检查它们是否被锁定在废弃的工作空间中。为此,请安装 适用于 TFS 2008 的 TFS Power Tools(10 月版)。然后,您可以右键单击源浏览器中的文件夹并选择“在源代码管理中查找”。使用“状态...”,您可以找到该用户锁定的所有文件。

如果您具有管理权限,则可以有选择地删除任何锁定文件的锁定。

* 编辑:前面有危险代码 *

下面的代码可以针对 TFSVersionControl 数据库执行。这将显示所有被锁定的文件。这可能会告诉您某处是否有孤立文件。

我不建议您在该数据库中进行任何更改,当然,在执行此类操作之前,请始终确保您拥有存储库的最新备份。

select 
    lck.FullPath,
    wspc.WorkSpaceName,
    id.DisplayName
 from tbl_lock lck
inner join tbl_workspace wspc on wspc.WorkSpaceId = lck.WorkSpaceId
inner join tbl_identity id on id.IdentityId = wspc.OwnerId

You may want to check to see if they are locked in an abandoned workspace. To do this, install the TFS Power Tools (October edition) for TFS 2008. Then you can right click on a folder in the source explorer and "Find in source control." Use the "Status..." and you can find all files that are locked by that user.

If you have administrative rights, you can selectively remove the locks from any locked files.

* EDIT: Dangerous Code Ahead *

The code below can be executed against the TFSVersionControl database. This will show you all files that are locked. This might tell you if you have an orphaned file out there somewhere.

I wouldn't recommend that you make any changes within that database, and, of course, always make sure you have a current backup of your repository before you ever do something like this.

select 
    lck.FullPath,
    wspc.WorkSpaceName,
    id.DisplayName
 from tbl_lock lck
inner join tbl_workspace wspc on wspc.WorkSpaceId = lck.WorkSpaceId
inner join tbl_identity id on id.IdentityId = wspc.OwnerId
记忆消瘦 2024-10-07 08:49:29

您是否使用 Attrice Sidekicks 来调查此问题?这是一个围绕 TFS 命令行工具的漂亮 UI。

Did you use the Attrice Sidekicks to look into this issue. It is a nice UI around the commandline tools of TFS.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文