Share via


Maps & cloaks

Here's a brief introduction to one of the features of Hatteras I own testing: working folder mappings and cloakings.

A mapping is what you use to tell Hatteras where files in the repository end up on your hard drive when you sync. As an example, let's imagine a repository that contains 2 folders called project1 and project2. You can use the command “workfold” to create a new mapping to this repository: 

    h workfold /map $/ c:\mysource

This command creates a mapping of the repository root, $/, to the folder c:\mysource. If this is the only working folder specification in your workspace, then the subfolders $/project1 and $/project2 will also get created on your local machine when you sync to the repository. But what if you only care about project1? That's where cloakings come into play. You can use a cloaking specification to mask out subfolders you don't want (in this case, $/project2):

    h workfold /cloak $/project2

Now, if you use the “workfold” command without any parameters, you'll see a list of your working folder specifications:

    C:\mysource>h workfold
==============================================
Workspace : JBBDEV1 (jasonba)
Repository: TEAMDEV
$/: C:\mysource
(cloaked) $/project2:

It's easy to see that your list of cloakings could get out of hand if you want to mask out a large number of subfolders. So, in practice, it's easier to just explicitly map in the items you care about, and leave the rest unmapped. To get there from here, you can use the /unmap option, the /decloak option, and then the /map option:

    C:\mysource>h workfold /unmap $/

    C:\mysource>h workfold /decloak $/project2

    C:\mysource>h workfold /map $/project1 c:\mysource\project1

Now, your working folder mapping looks like this:

C:\mysource>h workfold
==============================================
Workspace : JBBDEV1 (jasonba)
Repository: TEAMDEV
$/project1: C:\mysource\project1

So, when you sync, you only get the 1 project you care about - $/project1. Of course, you can map the repository folder to any local folder on your machine. The names don't have to match. So, instead of that last command, you could use:

C:\mysource>h workfold /map $/project1 c:\mysource\myproject1

That's it for our brief tour of mappings and cloakings. My next few VSTS blogs will outline some of the other features I test, and then I'll get into some interesting cross-feature cases that have been interesting to work with.

Also, if you have questions about Hatteras features or want more information on anything I blog about, please don't hesitate to ask.

Comments