Sharing issue in VSTS Source control
Hello guys,
I'm trying to migrate our VSS database to VSTS Source Control and I don't really understend how can I make "sharing" happen at VSTS?
For example we have next VSS source tree:
$root
|-DummyProject
|-Includes
|-ProjectA
|-ProjectB
Both of them have shared files from <Include>.
My question is: What is an alternative for us in VSTS in terms of do not re-organize our current code?
Thanks a lot guys.
[463 byte] By [
monkzen] at [2007-12-21]
Two basic ways:
- Use different relative paths. Let's say your layout is:
$/root
|-Common |-CommonLib1
|-CommonLib2
|-DummyProject
|-ProjectA
|-ProjectB
|-Includes
|- [CommonLib1 was shared here]
Instead of making ProjectA reference ..\Includes\CommonLib1, point it at ..\..\Common\CommonLib1.
- Use branching & merging. Branch $/root/Common/CommonLib1 -> $/root/DummyProject/Includes/CommonLib1.
#1 is easier: change it once & forget it, just like you did with sharing. #2 is more flexible: by choosing when & what to merge, you get to control exactly which code DummyProject is built against.
Thanks a lot that waht I thought :)
My second question is how can I create VSTS SCC layout like:
$root
|-root_of_external_products
|-ProductA
|-ProjectA
|-ProjectB
|
|-root_of_internal_products
|-ProductB
|-ProjectA
|-ProjectB
Thanks for your help.
For the most part, you can just do it. The only tricky part is that top level folders are what we call Team Projects: they carry a whole bunch of heavyweight settings like process guidance, work item templates, SCC checkin & checkout policies, etc.
Here's a guide to deciding how many Team Projects you need. My guess is that the majority of people coming from VSS, especially smaller teams, will encounter the least hassle by working under a single TP. In addition, I usually recommend reserving the next folder level underneath the team project for branches. Thus, your structure would be
$/TeamProject
|-MainBranch
|-root_of_external_products
|-ProductA
|-ProjectA
|-ProjectB
|
|-root_of_internal_products
|-ProductB
|-ProjectA
|-ProjectB
Thanks a lot.
Your comments were very helpfull in my case.
How do you do to apply the method #1?
I don't know how use relative path and sharing in TFS... Thank you if someone can explain me the procedure to apply this solution.
Thanks
Use different relative paths. Let's say your layout is:
$/root
|-Common
|-CommonLib1
|-CommonLib2
|-DummyProject
|-ProjectA
|-ProjectB
|-Includes
|- [CommonLib1 was shared here]
Instead of making ProjectA reference ..\Includes\CommonLib1, point it at ..\..\Common\CommonLib1.
Open Project A.
In Solution Explorer, expand the References node.
Delete the reference to CommonLib1.
Add a new reference -> browse to the CommonLib1 that's under root/Common.
Well with a references it works pretty well, but how about individual files?
Let say I have VERSION.H file which is shared in 20 different projects in VSS.
When I convert those projects to VSTS the convertor creates branches of this file in 20 places.
I change the file in one place(main branch) and exspect the changes in all places after check in.
Merge? It allows to merge one by one only, which is not convinient :)
As you've probably noticed, if you naively "add existing file" VS will copy the file so it's underneath the active project. You probably need to change your build process so it doesn't require multiple copies of the same file. I realize this isn't a great answer :(
Well I would happy to change company projects structure, but it requirets a lot of effort and heavy time consuming :( I'll probably go for CS Converter to make it work...
Thanks for your help
As a long time user of SourceSafe I having a hard time comtemplating life without shares. I hope someone can fill me in on the best practices for VSTS. Also I'd appreciate it if someone can point me to a blog discussing the reasons behind not having shares -- I vaguely remember reading something many months ago but I don't remember the details.
For example, say I have 300 Visual Studio Projects and 20 share 1 file, a different 20 share another file, etc. It seems like my choices are
a) dump all shared files into a common folder. This will be a mess with lots of unrelated files all in one folder
b) generate many common folders, e.g. common graphics, common math, common conversion, common interface, etc. This seems most palatable but is a lot of work and also has the fundamental problem if I want to get all of a modules files (say to bring home to work on) the files will be scattered in many folders
c) use branch and merge which, if my understanding is correct, won't allow me to see the full history on each file and will make checking in files painstaking.
Thanks,
Jeff
We've just release TFSLinks v1.0. This product maintains the relations between shared files and automatically updates all instances whenever a new revision is checked-in to any copy of the shared file. You may define the shared files manually, or import it from your original VSS project.
For more information, see:
http://www.componentsoftware.com/Products/TFSLinks
David Matyas
ComponentSoftware Inc.
I have different qusetion about TFS SCC.
How can I map two different projects to one local folder?
Example:
$-|
|_Project_1
|_Project_2
Map to C:\Common Project
Thanks,
You still have the option to add the file to the project as a link. Doing so, you are always sure to be using the last version of the file in all the projects that "adds" the file this way.
You can do it by, using the option "add existing file", locate the file, and finally select the "add as link" menu option at the context menu from the add button of the dialog
Unfortunately it is not project issue.
What I actualy need is to get common code from two different folders of TFS SCC.
For example:
I have the next structure:
$ root
-- Core (product)
|_ file_1.asp
-- Extensions
|_ file_2.asp
I need to get both of them to example: C:\Product folder.
TFS SCC doesn't let me map Core & Extension to one point C:\Product.
And I don't really know what to do in this case :( other then map Core to C:\Core, Extension to C:\Extension and manually copy file_1.asp from C:\Core, file_2.asp from C:\Extension to C:\Product ... with is not quite ellegant :(