共用方式為


Remapping in style

James introduced me to a neat trick recently with working folders. Oftentimes, I create a workspace and only want to map one team project to the local workspace root. Of course, I could use the UI, but that's not scriptable from a command file. I could also explicitly unmap the root and then remap. However, this requires the remap to indicate both workspace name and server name like so:

h workspace /new /noprompt /server:TfsCentral AdamWorkspaceh workfold /unmap $/h workfold /map $/Project1 . /workspace:AdamWorkspace /server:TfsCentral

Instead of all this, we can simply remap over the current folder, 'automagically' deleting the old mapping. Moreover, if none of /map, /unmap, /cloak, /decloak are specified, the workfold command assumes /map. So, we could simply do this:

h workspace /new /noprompt /server:TfsCentral AdamWorkspaceh workfold $/Project1 .

Now, when I switch servers, I only have to update the server name in the workspace creation line of my command file. Thanks, James!

Comments

  • Anonymous
    May 08, 2005
    Visual Studio Team System

    If you’re installing Beta 2 using Virtual PC, you should learn to appreciate...
  • Anonymous
    June 08, 2005
    The comment has been removed
  • Anonymous
    June 21, 2005
    The comment has been removed
  • Anonymous
    April 10, 2006
    The comment has been removed
  • Anonymous
    April 11, 2006
    Hi Jay-

    I recommend checking out this forum thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=334975&SiteID=1

    It sounds like there might be another workspace on your computer mapped to that local folder already.