4

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.

4

2 回答 2

4

您可能需要检查它们是否被锁定在废弃的工作区中。为此,请为 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
于 2010-11-03T19:58:38.963 回答
2

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

于 2010-11-04T07:21:04.580 回答