tags:

views:

29

answers:

2

Hi,

I know this is not related to coding. But this is important for coding, so posting here.

What does Trunk, Branch mean.

How does a release process go on in SVN?

I have 4 layers .

  1. developer machine code.
  2. stage02
  3. stage03
  4. production

what should be made the trunk?

A: 

The trunk usually (but not always) represents the mainline active code base to which everyone contributes during the normal course of development. Branches are created by forking off trunk (or another branch). Subversion's support for this is not great (even after fixing some major headaches in recent years) and most teams avoid it, which unfortunately means that they are usually trapped on trunk for all their work.

One practical approach you can use is to create a release branch whenever you release. This allows the team to continue evolving the product on trunk while support crews can fix bugs with the released product on the new branch. This generally works OK because there isn't much merge activity between trunk and the current release branch, and when there is, it is rarely structural in nature (moves, renames, etc., have a horrible effect on branching and merging in Subversion).

Marcelo Cantos
@Marcelo Cantos - thanks for reply . In my case what do you suggest. production is the one main code which is used by users and stage02 and stage03 where UAT is done. so how should be the structure . what should be trunk and what should be stage02 and stage03 and local system data.
pradeep
In the model I describe, every stage except production uses trunk, just different versions of it. Branches are only used to apply bug-fixes to publicly-released versions, and of course production feeds off the current release branch. This isn't ideal, I know, but frankly I have little faith in Subversion's branch/merge capabilities. If you want to the sensible thing, you really need to switch to a distributed VCS like Mercurial or git. I think git is a much better tool, though its Windows support is nowhere near as refined as Mercurial's, making it a tough call if you develop on Windows.
Marcelo Cantos
But Mercurial and git are both far better choices than Subversion.
Marcelo Cantos
A: 

Generally speaking, workflow is usually customized for specific team / project.

I worked with the following workflow:

  • Trunk is a place for main product trends. It contains currently developed version or product.

  • Branches are created for all released versions of a product. Hotfixes and minor updates are done in branches (and then built, tested and delivered to end-users). Similar fixes are committed to trunk, as well (or merged from branch altogether later).

  • Sometimes separate branches are created for big features, when feature development is done by group of developers, and/or may significantly affect other developers. Advantage of this approach is questionable, and depends on specific situation, because merge procedure in SVN is sometimes expensive.

  • Developer's machine keeps only working copy, with version developer is currently working on. Developer makes updates frequently, and fixes all conflicts. Also, developer makes commits with ready-to-use code frequently.

  • Product is built and tested frequently - this allows to find newly introduced bugs as soon as possible.

Merge procedure is rather expensive in SVN. Further workflow complication may result in painful merging. BTW, some teams cope with this successfully.

I'd recommend to take a look at distributed version control systems, as well. This post by Joel Spolsky provides great description of their main advantages: http://www.joelonsoftware.com/items/2010/03/17.html

Answering to your particular question, I may suggest the following (BTW, I can't see the whole development procedure, so this may be non-applicable):

  • Active development is performed in trunk. Trunk version is installed on test servers.

  • When product is accepted for release, new branch is created. This version is installed on production server.

  • Further product development is made in trunk, as well.

  • Hotfixes are made in corresponding branch. Branch version is tested on test servers and then delivered to production.

Kel