Sunday, January 20, 2008 9:09 PM
barbilor
What happens when a Working Folder is removed from a Workspace
Team Foundation Server has the notion of Workspaces (Working with Version Control Workspaces on MSDN for more details).
One of the things that "scare" users the first time they use Workspaces is what happens when a Working Folder mapping is removed (or changed) from the local Workspace: all the local copies are deleted.
Users are scared because they fear to loose all their files, but this is not the case.
Files that are mapped on the server are preserved there, while files that are local are handled in different ways, but they're never deleted (unless the user select the wrong option). Let's examine three examples:
Example #1: Files and folders that are not mapped on the server
In the first example, a Visual Studio Solution is mapped inside the TFSRTM08 Workspace:
Inside the local folder there is a TXT file that is not mapped inside the Workspace.
If we decide to remove the Working Folder mapping between the Source Control Folder and the Local Folder using the Edit Workspace dialog:
Team Explorer detects that the Working Folder mapping is changed and needs a Get Latest Version to update the Workspace. Team Explorer 2005 will remind it with a messagebox, while Team Explorer 2008 allows to invoke the operation directly from the messagebox:
When the Workspace is updated (from the messagebox, from Team Explorer or from the command line) all the mapped files and folders are deleted from the local path.
If there are files (and folders in our case) that are not mapped, they are preserved, but all the other are gone.
Example #2: Removing a folder with pending changes
If the user has some pending changes in the Working Folder:
the pending changes are preserved if the mapping is removed (the steps to remove the mapping are the same as the previous example):
Example #3: Removing a folder with a writable mapped file
A file that is not checked out by the user is made writable by removing the read-only attribute:

When the Working Folder mapping is removed (as shown in the first example) and the Get Latest version operation is executed, a conflict on the local writable file is detected:
To resolve the conflict the user can choose to overwrite the local file (and in this case the file is deleted from the client) or to ignore the conflict:
If the conflict is ignored the file remains on the client:
Technorati Tags:
TFS,
Workspaces