Pergunta

Using Team Foundation Server 2010 I am trying to unshelve a series of changes made by another developer on my team. This shelve set includes some Nuget packages which include dlls. I am receiving multiple errors along the lines of:

The item $/file/path/some.dll is locked for check-out by USER in workspace MACHINENAME.

In 2008 Mac Noland asserted in his blog post Unshelving files that have File Merging disabled that this error is caused by having file merging being disabled. Which makes good sense to have file merges disabled for binaries. Based on the error I am assuming that TFS 2010 is still utilizing the merge utility when unshelving (makes sense as to why). That said I do not want to enable file merging for dll files.

Unfortunately, understanding what is going on and fixing it are two different things. In TFS is there a way to unshelve binary files which were shelved by a different user?

Foi útil?

Solução

If the user created the shelveset, but left everything checked out locally, you will receive this error. Since TFS usually allows only a single checkout for binary files, a shelveset can't be unshelved if it contains a binary file which is locked by another user.

You can attempt to unlock the file with the following command -

tf lock itemspec /lock:none /workspace:OtherUsersWorkspace

You should be able to determine the workspace from the error message, and you'll also need to specify the user - /workspace:WORKSPACE;userid

Outras dicas

In my case my source code is located at below location in my work station

D:\TFS\Source\Development\Cars.

I opened Visual Studio Command Prompt under Visual Studio Tools and ran it as Administrator.

I changed my command prompt to move to

D:\TFS\Source\Development\Cars

Executed below line

D:\TFS\Source\Development\Cars> tf lock HE/* /lock:none /workspace:zigglerworkspace /login:ziggler /collection:ziggler1pxtfs01\WebProjects

zigglerworkspace - my workspace name

ziggler - my user name

ziggler1pxtfs01\WebProjects - TFS server url

This released locks on all files and folders under HE folder which is located at

D:\TFS\Source\Development\Cars\HE

  1. Install Microsoft Team Foundation Server 2010 Power Tools

  2. Add C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools to your system path

  3. cd c:[some location]\"destination workspace"

  4. tfpt unshelve /migrate "shelveset name";otherUserName /source:"$/ProjectName/Main/Source" /target:"$/ProjectName/Main/Target"

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top