Mapping two workspace folders to the same working

2019-07-19 19:50发布

问题:

I'm migrating a build system from VSS to TFS and one part of the VSS solution gets selected files from two VSS projects into the same dir.

Since TFS forces you to explicitly set working folders before you can get, I am not sure if this will work? I have had problems with separate workspaces overlapping each other's working directories, but probably the two VSS projects would be part of one TFS workspace so is this do-able?

回答1:

As far as I know, it is not possible to map two different TFS folders to the same local filesystem path, or to overlapping filesystem paths - regardless of whether the two mappings are in the same workspace, or in two different workspaces.

Since workspaces and their mappings are managed and stored on the TFS server, the server is capable of enforcing this restriction across all workspaces - even if the workspaces belong to different users. The important thing that the server checks for is the hostname of the client system that the workspace belongs to.

All this information comes from personal observation. There may be official documentation that confirms my observations, but I have not checked.

To answer your question: You might be able to pull this off if you can manipulate the build workspace in between the two get operations, i.e. remove one mapping after the first get and then add the second mapping before you attempt the second get. A possible candidate how to achieve this is with a PowerShell script. I would not recommend this, though, it sounds too much like a hack that will make you unhappy at the end of the day.