In the past couple of days, I've been delving into prescriptive architecture guidance for Team Foundation Server (TFS). Along the way I learnt something new, something I never knew existed in TFS. It's called cloaking. Allow me to quote the following text from the Team Development with Visual Studio Team Foundation Server prescriptive architecture guidance (search under Chapter 4):
Cloaking You can use cloaking as a performance optimization when you want to prevent a part of the source control tree from being retrieved. The following are typical scenarios for using cloaking:• You want to build the project locally and a folder is not needed for the build, for example a documentation folder.• You are part of a large team project and you only want to retrieve part of the project. For either of the above scenarios you can cloak folders to stop the client retrieving those folders. You cloak folders on the client by editing the workspace and changing the status of the working folder from active to cloak. Keep the following recommendations in mind when you cloak:• Do not cloak individual files. This is likely lead to maintenance problems later in the project.• For a large project, map out the root folder and cloak sub folders rather than creating multiple workspaces for the project.
Cloaking
You can use cloaking as a performance optimization when you want to prevent a part of the source control tree from being retrieved. The following are typical scenarios for using cloaking:• You want to build the project locally and a folder is not needed for the build, for example a documentation folder.• You are part of a large team project and you only want to retrieve part of the project.
For either of the above scenarios you can cloak folders to stop the client retrieving those folders. You cloak folders on the client by editing the workspace and changing the status of the working folder from active to cloak.
Keep the following recommendations in mind when you cloak:• Do not cloak individual files. This is likely lead to maintenance problems later in the project.• For a large project, map out the root folder and cloak sub folders rather than creating multiple workspaces for the project.
Having said that, I went ahead to put this to practice on Visual Studio TFS 2008. Before I got started, I paid close attention to the statement that says, "You cloak folders on the client by editing the workspace and changing the status of the working folder from active to cloak.".
The question that begs is "What is a Workspace?".
Workspaces ExplainedA TFS workspace is a client-side copy of the files and folders in TFS source control. A workspace maps source control folders to local file system directories. When you make changes to files within the workspace on your local computer, the local changes, referred to as pending changes, are isolated in your workspace until you check them into the server as an atomic unit. The collective set of changes, checked in as a batch is referred to as a changeset.
As a good measure for practice, I didn't want to edit my existing default workspace, so I created a new workspace. This new workspace will map the source control folders to a new folder in my local file system. These were the steps I took to create a new workspace:
Please bear in mind that you can only cloak folders that have a mapped parent. Otherwise you get an error message like the following.