Workspace folder mapping bug?

I have a directory at C:\Projects\Foo\Src\Runtime\EncryptionLib\UnitTests that I branched to location $/Foo/Branches/Developer/hillr/Exp_UnitTests. I then try to cloak $/Foo/Src/Runtime/EncryptionLib/UnitTest and then map $/Foo/Branches/Developer/hillr/Exp_UnitTests/UnitTests to C:\Project\Foo\Src\Runtime\EncryptionLib\UnitTests. VSTS gets confused. When I edit files in the UnitTests dir in this worksapce they are really being edited on the trunk instead of my private branch. When I go back to the Workspace mapping it has removed the two lines I added and put in:

active $/Foo/Src/Runtime/EncryptionLib <missing an extra EncryptionLib here>
C:\Projects\Foo\Src\Runtime\EncryptionLib\EncryptionLib
active $/Foo/Src/Runtime/EncryptionLib/UnitTests
C:\Projects\Foo\Src\Runtime\EncryptionLib\UnitTests

So not only did it whack my previous mappings but it put back an incorrect mapping. Is what I am trying to do not possible or is this just a bug? If it's not clear what I am trying to do let me explain it. I am trying to mimic the "parallel universe" model of branching found in clear case where I can have a private branch that appears in the same location as the branch source but just on my machine. That means my build scripts don't have to do anything special since the code in my private branch is located in the same directories in my workspace as their non-branched counterparts. I thought I could do this with path space branching with some clever use of cloaking and mapping.

[1524 byte] By [KeithHill] at [2007-12-16]
# 1

One thing to note is that you can't have a folder cloaked if a parent of that folder isn't mapped. Therefore, if you actually do have $/Foo/Src/Runtime/EncryptionLib/EncryptionLib mapped rather than just $/Foo/Src/Runtime/EncryptionLib, you should have received an error when trying to cloak the UnitTest directory (if things are working as expected, of course).

In terms of where the odd cloaking behavior comes in, though, I'd like to try to reproduce the problem locally to get a better handle on it. Are you using the "Manage Workspaces" dialog to edit your current workspaces or are you using the command line "h workspace" command? Are you trying to set all the mappings at once or in sequence, saving the workspace state between?

Thanks!

AdamSingerMSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 2

I'm using the File -> Source Control -> Workspaces ... dlg. I tried to cloak first & then map in single session. However I didn't know the rule about mapping the parent dir before cloaking the subdir.

KeithHill at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 3
It seems to work in the more recent builds, though I'll keep a sharp eye out for it. Could you try performing the mapping and cloaking in a new workspace to see if it happens there, too? Thanks for passing the issue along!
AdamSingerMSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 4
Yeah I'll try that. I should have mentioned that I had another line in my mappings config. The first line, which I didn't mention was:

active $/Foo C:\Projects\Foo

I would have thought that having this top level dir mapped would have been enough to allow me to cloak a directory several levels down. I hope it is not the case that you must map the cloaked directory's immediate parent directory.

KeithHill at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 5
I hope it is not the case that you must map the cloaked directory's immediate parent directory.

Nope, thankfully. You just have to have something further up the tree mapped to cloak a folder.

AdamSingerMSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 6
I tried this again on a different project with Beta 2 and I still can't get it to work. The local folder remains mapped under the Trunk dir when I specifically added a mapping to a repository directory under Branches. Hopefully this is fixed in the July CTP. I should be able to try that in a few weeks.
KeithHill at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 7
I figured how to make this work from the command line. First you remap the "normal" project to a dummy location:

active $/Foo/Src/Runtime/EncryptionLib/UnitTests
C:\Temp\Devnull

Then you map in the branched folder:

active $/Foo/Branches/Developer/hillr/Exp_UnitTests
C:\Projects\Foo\Src\Runtime\EncryptionLib\UnitTests

This seems to work pretty good from the command line but confuses VS pretty good. Within the Source Control Explorer, looking at the Properties on UnitTests insists the repository location is $/Foo/Src/Runtime/EncryptionLib/UnitTest. However at the command, executing h.exe properties indicates correctly that the location is $/Foo/Branches/Developer/hillr/Exp_UnitTests/UnitTests. Also, when you load the solution somehow VS knows what you've done and wants to remap the repository folder pointing to c:\Temp\Devnull back into what it thinks the "correct" location is which of course is occuppied by the branched version. Figures. Anytime you try to do something "advanced" WRT to building your SW, VS gets in your way. Here I was hoping that MSBUILD was going to solve all these issues. Unfortunately it seems that the SCCI API in VS 2005 is just as crappy as ever. Yes, I'm a bit frustrated. :-(

KeithHill at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 8
Ah- I see where you're coming from.

I think the main issue here is that Source Control Explorer is actually a window into the server rather than a reflection of what data you have stored/mapped locally. It will grey out items that you don't have locally (either because they're not mapped or you haven't gotten latest), though it still shows them with their server paths. Hence, the folder named "UnitTests" is still the server item listed despite the remapping. What the remapping gives you the power to do is have a common script which says "run items from this relative path" and then pull from your alternative test branch rather than the original.

AdamSingerMSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 9
It seems like a nice enhancement to the properties dialog box opened up from the Source Control Explorer would be to also list the "local" path in addition to the repository path.
KeithHill at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 10
While we do show the "Local Path" above the file list to show where the current directory maps to, this doesn't help for individual file mappings. I'll follow up with our PM/Devs to see what we can do here.

Thanks!

AdamSingerMSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...

Visual Studio Team System

Site Classified