kprobst
kprobst

Reputation: 16651

TFS: Removing leftover custom mappings after moving folders

I have a workspace where I want the repository root mapped to a particular folder (e.g., $/ mapped to D:\Home). This then picks up the default "natural" folder structure in the repository without having to map stuff manually.

There's a pair of subprojects that I had under the default TFS structure and were recently moved around under another folder. TFS helpfully remembers that those were pointed to a particular location on my hard drive, but what I need is for them to lose the (now) custom mapping and simply go back to picking up the default mapping location based on where their parent folder points to.

I can see an option to remap the folders, but no option to simply drop the custom mapping. IIRC Visual Source Safe had a way to do this -- to just stop mapping a folder in a custom way and return it to being mapped by default based on its parent folder. But I can't figure out if TFS can do that as well...

If it makes any difference, this is TFS2005 being used from VS2010.

EDIT

Here's an example to make this clearer. Say $/ was mapped originally to D:\Home. So $/Foo would map 'naturally' to D:\Home\Foo. $/Foo/Widget was also mapped naturally to D:\Home\Foo\Widget. Then Widget was moved from under $/Foo to $/Bar, but TFS is still telling me that the mapping is to D:\Home\Foo\Widget, when I want it to be D:\Home\Bar\Widget. I want to remove the custom mapping and let Widget be mapped to the 'natural' location under its parent folder, not point to the older location.

Upvotes: 3

Views: 4233

Answers (3)

Tarun Arora
Tarun Arora

Reputation: 4822

Nice and easy. Everytime you associate a file by checking it into TFS, TFS remembers the source path by creating a reference to it in the list folders mapped to your workspaces.

To clean this up, open Visual Studio, Connect to TFS. Go to File menu, chose Workspaces. You will see all the mappings that visual studio has managed to create for you. Feel free to clock or delete the ones you are not interested in. http://msdn.microsoft.com/en-us/library/ms181386.aspx

HTH. Cheers, Tarun

Upvotes: 0

Mike Veigel
Mike Veigel

Reputation: 3815

I think I understand what you are trying to do.

How did you move that widget? Did you use TeamExplore -> Source Control Explorer to move it? If not...

Open Source Control Explorer -> Go to your widget and right-click -> Move (Option is directly under Brancing and Merging)

You will see a dialog with a From and To box. Browse to the new location on your HDD and move the widget.

In this way, TFS will pickup the new location correctly and it will be naturally mapped again. Anytime you want to move Widget (where widget = project or folder etc) from $/something to another $/something use the Move tool. Checkin in the change and you should be good to go.

Upvotes: 2

Edward Thomson
Edward Thomson

Reputation: 78623

When you create a Working Folder within Team Foundation Server, you specify the server path you want to map, the local path on your computer, and the recursion level. For folders beneath those paths, the server determines the local paths based on those mappings (and recursion level) but it does not actually create any new mappings or any long-term state, the local paths will be recalculated. (In other words, there's nothing to clean up after a rename.)

If a folder rename is checked in on the server, to update this on your local workspace, you simply need to do a get on the parent folder. For example, if $/Foo is renamed to $/Bar, you should do a get on $/ in order to get that rename locally.

Upvotes: 1

Related Questions