SVN : repository structure when 2 differents major version development in parallel?
Question: I am quite new with subversion, and I whant to know how to structure a
repository. As I read, 'trunk' directory is for the main development, 'tags'
is to snapshot a version, 'branches' is for doing some big changes/testing and
not disturb the trunk.

The problem is when one have two major versions to develop in parallel : I do
not see very well how to structure that. I take the exemple of the python
langage, both version 2 and 3 are under development, I see these structure
possibilities :

    
    
    1st one :
    ===========
    
    repos/
      python2/
        trunk/
        tags/
          V2.5/
          V2.6/
          V2.7/
        branches/
          big_modif1/
          testing2/
      python3/
        trunk/
        tags/
          V3.0/
          V3.1/
          V3.2/
        branches/
          big_modif43/
          testing37/
    
    2nd one :
    ===========
    
    repos/
      python/
        trunk/
          V2/
          V3/
        tags/
          V2.5/
          V2.6/
          V2.7/
          V3.0/
          V3.1/
          V3.2/
        branches/
          big_modif_on_v2.x/
          testing2_on_v2.x/
          big_modif43_on_v3.x/
          testing37_on_v3.x/
    
    3rd one :
    ===========
    
    repos/
      python/
        trunk/
        tags/
          V2.5/
          V2.6/
          V2.7/
          V3.0/
          V3.1/
          V3.2/
        branches/
          V2_trunk/
          V3_trunk/
          big_modif_on_v2.x/
          testing2_on_v2.x/
          big_modif43_on_v3.x/
          testing37_on_v3.x/
    

What will you choose (of course, you can propose something else) ?


Answer: I think a combination could be the best. Let me explain it with your example:

  * Python 2 and Python 3 are developed in the same project, from the same team (so should be developed at least in one repository).
  * Python 3 is the future (main) development version, Python 2 is not actively developed further (not sure about that).
  * Both are released to the public and should stay in sync, but no Python 3 feature should leak into Python 2.

So I would follow the ["single project repo layout"](http://svnbook.red-
bean.com/en/1.6/svn-book.html#svn.tour.importing.layout) (described in the
[SVN red book](http://svnbook.red-bean.com/en/1.6/svn-book.html)):

    
    
    repos/
      python/
        trunk/
        branches/
          V2/
        tags/
          ...
          V2.7/
          ...
          V3.2/
    

The main point here is that V2 was branched when the development on Version 3
was begun. And that you should stick tothe following merging rules:

  * Merge only bug fixes in V2 to trunk if they are compatible to it.
  * Don't merge from trunk (== V3) to V2.

