开发者

Migrating multiple VSS top-level projects to a TFS repository - how (and why)?

We are coming from a Visual Source Safe background and are trying to look at migrating to team foundation server 2008.

I'm having some trouble understanding how to set up the source control. Consider the following folder structure in Figure #1 below on the file system:

Figure #1:

C:\src\01-development

  • Proj1
  • Proj2
  • Proj3
  • Proj4
  • Proj5
  • Proj6

Now, let's say that under Proj1, I have a solution called solution1, and it has dependencies against the projects located in Proj2 and Proj3. So what I do in the solution for Proj1 is use Visual Studio's "add existing project" feature to add Proj2 and Proj3 to Proj1's solution. Now I have all three projects in Proj1's solution, enabling me to modify code, recompile the dependent projects, etc. Proj4, Proj5, and Proj6 are not related to Proj1, Proj2, and Proj3.

With Visual Source Safe, this is easy and we just checked in Proj1, Proj2 and Proj3 to the source safe repository and everything works fine.

So, now I want to set up a TFS team project for Proj1. So in Visual Studio 2008, I new File/New Team Project and type in Proj1 for the team project name and let it go through about 10 minutes of stuff and finally it creates the team project. Under the team explorer, there's a开发者_如何学Go node called Source Control. If you double click that node, it'll take you to the source control explorer, and I see the TFS server name and underneath that the TFS project name (call it Proj1).

Question #1: Now, what I would like to do is to add the Proj1, Proj2 and Proj3 file system folders to this team project. So, I right click on the Proj1 node in the Source Control Explorer and do "Add Items to Folder". Then, I select Proj1, Proj2 and Proj3 from the file system, and TFS loads them into the Source Control Explorer window. But then, if I map the Local Path to C:\src\01-development\Proj1 and do a get latest, TFS will create another folder inside of the C:\src\01-development\Proj1 folder called Proj1, and it will pull all the files there. This isn't what I want to happen. I want TFS to use my existing Proj1, Proj2 and Proj3 folders in the same way Visual Source Safe would.

Is there a way to do what I want to do?

Question #2: I've used subversion and although it has its quirks, I have found it an order of magnitude easier to use than TFS. My boss is dead-set on using TFS though and I can't seem to sway him away from it. His reasoning is that TFS offers the project management integration that you don't get with subversion. I just wondered for those of you who have worked with both, are there any strong reasons to use one over the other?


The key thing I was doing wrong was trying to have source folders outside of the main TFS project folder. What I learned was that with TFS, its best to keep everything under this root umbrella folder.

So going back to my original example: C:\src\01-development

* Proj1
* Proj2
* Proj3
* Proj4
* Proj5
* Proj6

If Proj1 has dependencies against Proj2 and Proj3, then I could use a directory structure like this:

Proj1Root

  • Proj1
  • Proj2
  • Proj3

Now, if Proj2 and Proj3 could be shared among other projects (besides Proj1) then I could also make TFS projects for those projects, and I could then "branch" Proj2 and Proj3 into Proj1.

So now we have:

Proj2Root

  • Proj2

Proj3Root

  • Proj3

Proj1Root

  • Proj1
  • Proj2 (branched from under Proj2Root)
  • Proj3 (branched from under Proj3Root)

Then I can make changes to the code under Proj2Root and Proj3Root, and I can merge those changes into Proj1Root later (or I can choose not to merge them).

Anyway, tvanfosson was right, it was just that I wasn't really familiar with TFS and I was letting my frustration get the better of me. I posted this answer in the hopes that if someone else has the same struggles about how to set up the directory structure, maybe this will be of help.


If you had added the solution to source control from the solution instead of adding it via the Source Control Explorer, it would have used your existing folder structure. With the solution open, you can simply right-click on the solution and choose "Add Solution to Source Control." This will add all of the items in the solution to the chosen (or newly created) source control folder. Note: you do still have to create the team project first.

You can also move the checked out tree around by going to the Source Control Explorer. Choosing "Workspaces" from the dropdown, then clicking on the workspace of interest and clicking Edit. Once you have your workspace open in edit mode, you can change the local folder to which the workspace is mapped. Note that this will delete the files in the existing location.

I suggest playing around with TFS with a test project a bit before trying some of these things on your production code. You might also want to check out the Team System Developer Center on MSDN, and download the TFS Power Tools while you are there.

As to your second question -- I actually don't use the project management facilities in TFS. For what I do even the agile stuff in TFS is too heavy weight. I rely mostly on a set of wikis for each project to keep track of what needs to be done. That's not to say that the tools aren't good, just that I don't have any direct experience with them except that they are more than I, primarily a solo developer, need.


"The project that you are attempting to add to source control may cause other source control users to have difficulty opening this solution or getting newer versions of it."

I think this warning is telling. It seems that solutions are meant to house child projects that exist underneath it (logically and physically on the file system). Even this article from the Patterns and Practices Team from way back in 2002 seems to indicate this.

That being said, of course I don't know much about your work environment or your needs, but I just wanted to point out a root problem I see.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜