views:

509

answers:

6

I'm used to using TFS, and my company is now switching to SVN for a new project (the main reason is to better incorporate our java & .Net codebase under the same source control).

I am given to understand merges in subversion are hard (Jeff mentioned this in his latest podcast).

  1. What are the problems with subversion, when compared to TFS?
  2. How to mitigate? (withing the bounds of subversion, or as Jeff proposed, choosing another source control)

One strong feature that TFS offers is its automerge capabilities (greatly improved in TFS2008, although not perfect yet). Most merges don't require any action by the user. Is that the same in subversion?

Update - an accepted answer here can only come from someone who has experienced big merges in both TFS and subversion, and can actually compare & contrast the two. Knowing that "merge in subversion is good" or "TFS is crap" doesn't really help me decide, because it's subjectve. If you can compare to other alternatives, great - it is helpful. But my focus is subversion vs TFS.

The target team size I'm interested in is 6-30 active developers.

Update 2 - is there anyone that would make the case that merges in SVN are in fact easier than in TFS (taking tooling into consideration)?

+4  A: 

I'm not familiar with TFS, but until version 1.5, subversion's merge support consisted of little more than taking the diff of a (manually-specified) range of revisions, and applying it to another path in the repository. With version 1.5, merge tracking was implemented, but it appears to be rather complex with interesting edge cases.

If merging is critical for you, you may wish to consider one of the DVCSes that excel at merging, such as git or mercurial.

bdonlan
And it should be noted that it took a while for svn 1.5 merge support to stabilize. Only starting with 1.5.5 it is usable in several real-world cases, which I cannot recall ATM, but which were showstoppers in trying to adopt svn 1.5 support on a large codebase, namely GCC.
Laurynas Biveinis
We'll be working with SVN 1.6.x and a considerably less complicated project structure. Git and Mercurial are not practical options for us; none of the staff are familiar with either (or DVCS in general) and we cannot afford the (alleged) productivity loss due to the paradigm shift.
Tomer Gabel
This answer does not answer my question - it does not compare TFS with subversion.
ripper234
+4  A: 

I don't think merges in subversion are hard at all for the common cases, have a look at examples like these. I have found merging delightfully simple and easy; although some co-workers complain about liking CVS more, others p4 etc. etc. I suspect much of it has to do with familiarity with other tools, not with technical superiority/inferiority.

It may be that more complicated (three-way) merges are harder, but question is whether ones in common use are those. Personally I consider complicated merges (and long-living branches, complex tracking of branches and merging strategies etc) smell of code rot (or I guess SCM rot). YMMV.

StaxMan
A: 

Somewhat off topic, but if the question of moving from TFS for your java developers is still up in the air, I would recommend you look at Teamprise. It is a tool made just for Java developers that use TFS. It gives a Java user most of the power of Visual Studio integration (and some things even better) inside eclipse.

http://www.teamprise.com/

(FYI, I am not affiliated with them in any way...)

Vaccano

Vaccano
Thanks for the tip, but we've already evaluated Teamprise and found it (at the time) very finicky and unstable.
Tomer Gabel
+2  A: 

I have used subversion for a very long time, and let me tell you, merging is horrible and absolutely broken. I have changed to mercurial, even though I have no use for the distributed stuff, just to get branching that works.

Elaboration, as requested To successfully merge in SVN you need(ed) to know the version number the branch was carrying, which is not that difficult to find as long as you are only doing a single merge back into the trunk. Unfortunately some times you need to merge several times (ie it turns out that to add a feature you first had to fix a bug) in to the trunk, or you are doing merging between different branches which makes it impossible to keep track of which version number belong to which branch and what has previously been merged.

The version of SVN I use is 1.5.1, so it should work with the new style development, though it appear as I missed that.

tomjen
Is that svn 1.5 merging that you are referring to?
Laurynas Biveinis
Thanks, it appears you are referring to pre 1.5.5 merges -- the whole merge tracking system appears to have been significantly improved since. We have worked fairly extensively with Subversion 1.4 and took that as the baseline :-)
Tomer Gabel
+6  A: 

I have done big merges in both TFS and Subversion. The TFS codebase was a 1.5->2.0 branch of a SharePoint application with production changes merged into the 2.0 codebase. The SVN merge was a merge of new features from a fork into the baseline source.

You are already familiar with TFS so I'll spare you the details, other than to say that the changesets and TFS tools made the process very simple. We did get the TF14087 error due to an undelete issue but it was quickly resolved.

In SVN, the process was quite a bit more manual because we had to target specific versions of the files in SVN, and SVN did a diffmerge on files which did not allow us the flexibility we experienced with changesets in TFS (cases such as "not all changes in ChangesetA but all changes in ChangesetB"). We didn't have merge tracking at the time, nor was our source tree designed to support the best practices of SVN merge tracking.

I think now, with merge tracking in SVN, the process would be quite a bit simpler assuming you follow the best practices outlined by CollabNet. But bear in mind that TFS is a big product with really great GUI tools for managing your source, while SVN depends more heavily on the command-line, so this complicates things if you're used to working with the GUI.

Robert S.
Your answer is a candidate to be the accepted answer here. I understand you say the tooling of TFS is superior, and SVN lacked merge tracking. Do the tools for subversion use the fact SVN is now merge aware? Can I get streamlined merges like in TFS?
ripper234
svn merge --recordonly will do the "blocking changes" merge. It tricks SVN into thinking that the changes have already been merged. It's nowhere near as elegant as TFS's implementation. You cannot get streamlined merges like in TFS, yet.
Robert S.
don't forget Tortoise makes things easier, if you want all changes from 'changesetB' but not 'changesetA' (where a changeset is a revision in SVN) then you just select the revisions you want to merge from the log that Tortoise offers you.
gbjbaanb
A: 

There are pros and cons of all systems.

But one little useful note (that is close to off topic) is that a external powerful merge/diff program is often really useful. So whatever you choose make sure you have a nice 3-way merge tool around to help out when the automated stuff breaks.

BR Johan

Johan