Reputation: 63748
I'm porting a legacy VSS-based build script to TFS. The script gets files from several server locations into different directories... to make this work with the same structure in TFS I frequently map & unmap specific working folders.
This seemed to work, until the script gets the same server file into two different local folders. Even though previous working folders are un-mapped, TFS moves the existing copy of the file rather than getting a second copy.
e.g:
On line 7, I get "Replacing file.abc (moved from c:\dir1)" and end up with only one copy of file.abc.
I'm aware our process is not TFS-friendly but right now I just want it working so we can drop VSS, and then focus on re-structuring afterwards. Is there a way to stop this behaviour or a workaround I could use that doesn't totally change our process?
Upvotes: 0
Views: 206
Reputation: 314
I had the same problem and found no answer online so I figured out the solution and wrote up a blog post: http://www.softwarepronto.com/2013/09/getting-multiple-labels-from-tfs-using.html.
If you don't want to read the blog, the solution is to create the workspaces in different directories (see below):
MKDIR D:\ATest
CD /D D:\ATest
tf workspace /delete WorkSpaceATest /noprompt
tf workspace /new WorkSpaceATest /noprompt
tf workfold /map $/ATest D:\ATest /WorkSpace:WorkSpaceATest
tf get /version:LATest01
MKDIR D:\BTest
CD /D D:\BTest
tf workspace /delete WorkSpaceBTest /noprompt
tf workspace /new WorkSpaceBTest /noprompt
tf workfold /map $/BTest D:\BTest /WorkSpace:WorkSpaceBTest
tf get /version:LBTest01
Upvotes: 0
Reputation: 10090
What I would do to get this working fast:
Upvotes: 1
Reputation: 57902
I don't think you can achieve this in TFS. if you remove a workspace mapping it'll remove the files. If you try to map the same file to 2 places you'll get an error.
You need to fix your build process. A short term solution might be to get the file once and then copy it to any other locationsit is needed. otherwise I think you need to bite the bullet and refactor your build process to be simpler. regardless of what systems you are using, simplifying you're build will help you in the long term.
Upvotes: 0