Question

I am trying to understand how to solve the following situation.

I have a TFS 2012 server with three collections, say;

- http://tfs2012:8080/tfs/DefaultCollection/
- http://tfs2012:8080/tfs/CollectionOne/
- http://tfs2012:8080/tfs/CollectionTwo/

In CollectionOne and CollectionTwo I have a workspace of the same name, lets call it "TestWorkspace".

When I run a map command for that workspace on CollectionOne it works perfectly (can get, delete, update, etc). The issue comes when I try to unmap the workspace as I am done using it (think build machine), the following call fails.

tf.exe workfold /unmap /workspace:TestWorkspace E:\Temp

It fails with;

Multiple workspaces exist with the name TestWorkspace.
Please specify the Team Foundation Server or qualify the name with the owner.

Therefore I try the following;

tf.exe workfold /unmap /workspace:TestWorkspace E:\Temp /collection:http://tfs2012:8080/tfs/CollectionOne/

Which fails with the following;

The option collection is not allowed. 

Also specifying the owner of the workpsace doesn't help as they are owned by the same user.

How do I unmap a workspace which exists in two or more collections?

OTHER TIPS

This is indeed an annoying defect. Here's a simple workaround I've used successfully.

# Rename existing workspace to something unique
tf workspace /collection:http://yourserver:8080/tfs/DefaultCollection /newname:TEMPORARY /noprompt DEVBOX-SGY

# Unmap based on new (unique) name
tf workfold /unmap /workspace:TEMPORARY C:\Code\Tools

# Rename workspace back to original name to avoid side-effects
tf workspace /newname:DEVBOXSGY /noprompt TEMPORARY

Personally I was not able to use the workaround mentioned by sparkplug, because I needed something automation friendly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top