Friday, December 07, 2007

A scare when changing workspace mappings

Here is a good way to scare even the most seasoned developer.


  • Set your workspace U000001-XPA mapping so $/TeamProject/MySource is pulled down to c:\MySource
  • Check out $/TeamProject/MySource/MyFile.cs to c:\MySource\MyFile.cs
  • Make a change to MyFile.cs, but do not check in.
  • Now let's say for some reason you want to get the code $/TeamProject/MySource to c:\MyTempSource. To do so you decide to change workspace U000001-XPA mapping so $/TeamProject/MySource is pulled down to c:\MyTempSource.
  • Do a Get Latest.
  • Open up My Computer and you should see code under c:\MyTempSource. And you should notice that all code, including the code that was checked out and changed!, is deleted from MySource.
  • Start freaking out.

This just happened to one of our tech leads. Luckily he checked in the code before running through these steps. So he felt alright, but did have me over to his desk to take a look and see if it's correct behavior. I didn't think it was and did some testing.

Well good news. Team Explorer and Teamprise are smart enough to move the changes under the new mapping location. In our case. c:\MyTempSource. In addition, Team Explorer and Teamprise are smart enough to not delete any files that were in the original location (i.e. c:\MySource), but NOT added to the list of pending changes.

I think this is correct behavior, but it does scare us a bit.

No comments: