tfssource-control-bindings

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.


Solution

  • 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.