Svn: organizing the module at the beginning of the development process

OK, I understand that the trunk / tags / branch thingy box is for a repository with one project.

Now let me say that I have a main project and a number of small auxiliary modules / plugins / tools / scripts, etc. In the early stages there are a lot of renaming, reorganization, etc., and some of them die an early death, they do not go anywhere. For me, it makes no sense to insert a certain module into the trunk until the organization becomes quite stable. (at this moment copying on the body is "cheap" to svn design)

Where would it be best to place a small module (say "FooModule") at the beginning of the development process?

  • / branches / development / FooModule?
  • / development / FooModule?
  • / sandbox / modules / FooModule?

Does anyone have experience organizing subversion repositories in a similar way? what worked for you?

+4
source share
6 answers

This is a very interesting question, because there are many advantages to starting law (modulation, low connection ...). Anyway, here's how I get started:

1) put everything in the trunk:

http://svn/application/trunk/application 

2) if possible, start early to break the code into modules

 http://svn/application/trunk/application1 module1 module2 

3) if the module is stable, move it upstream to your own repository:

 http://svn/module1/trunk 

4) finally, when you have several stable modules and applications, you can get

 http://svn/application1/trunk http://svn/application2/trunk http://svn/module1/trunk http://svn/module2/trunk 

Each application / module has its own release cycle.

Alternatively, you can see what the Spring Framework does (a very good organization, if you ask me)

 http://svn/application1/trunk http://svn/application2/trunk http://svn/framework/trunk/module1 http://svn/framework/trunk/module2 

I would advise you not to split the code into connecting lines / branches for each module, at least at the beginning of the project: as soon as you start branching (and do not work on the trunk), you will not be able to work with HEADS of another module: you need to either expand everything their projects at the same time, or work with certain versions (1.0, not SNAPSHOT). I don't think I'm very clear, but let me know if I have to explain it differently.

+2
source

I'm not sure if my organization structure fits your needs, but I took a completely different approach than the trunk / tags / branch model. See http://www.mattwrock.com/post/2009/10/10/The-Perfect-Build-Pard-2-Version-Control.aspx for more details.

Here is our structure:

 /prod /prod/app1/20090903 /prod/app1/20090917 /prod/app2/20090903 /sandbox /sandbox/users/mwrock /staging /staging/app1 /staging/app2 /trunk /trunk/libraries /trunk/desktop /trunk/docs /trunk/services /trunk/sql /trunk/testing /trunk/thirdparty /trunk/web 

Here we have the following root folders:

  • Trunk . It contains the latest versions of code suitable for integration into the backbone. There is a single connecting line shared by all projects and teams. Only developers need to check this single folder and they have everything they need.

    Sandbox : these are areas of personal development used to branch long changes that you want to keep separate from the trunk until they are ready to combine luggage.

    Stage . This is the final area of ​​QA / UAT. The line is copied here once the development is considered stable and ready for final testing. This protects the release from development that has been transferred to other teams. When the release is at this point, you don’t want an unknown person to enter your code base.

    Prod : contains releases. Each application has its own folder under prod and each release has a folder named release date. The holding branch is copied to these releases tags during deployment, and they are a snapshot of the code at release time. The prod-area is a historical report of what exactly was released and when.

0
source

/branches/dev/FooModule would be the most sensible approach if you really don't want to have it in the trunk from the start IMHO. For which branches of development is there (except that this is usually the opposite, the code is copied from the trunk there, and then returns to the trunk in the end).

I would definitely avoid the unusual root paths such as the other two examples you gave. You will find additional considerations in Version Control with Subversion .

0
source

When I approached such things myself, I usually use a completely separate repository to keep cluttering the main repository with unnecessary versions.

0
source

I am a fan of having chests, tags, branches for each application. With this design, you can do whatever you want for the sandbox.

 app1/ trunk/ tags/ branches/ app2/ trunk/ tags/ branches/ sandbox/ trunk/ tags/ sure_you_could_keep_the_parallelism_up_here_but_is_there_really_any_need/ 

People will bicker back and forth about the pros and cons of doing it this way or the root level of the trunk, tags, branches, but one strong advantage of this method is that merging and checking is much less painful.

(Many people overlook this structure because they see that their projects use code between applications. We have some success using svn: externals when code sharing is needed. What's really nice is that even breaking changes in shared libraries will not be a problem if you use external links to bind to tags, which freezes the shared library at the moment when it was known that it was working.)

0
source

I cannot edit David's post, but I want to mention something with svn:externals : they are quite dangerous in terms of release (imo). Here's a nightmare scenario:

Imagine you svn:externals some module code inside your application; for this, suppose the version of Subversion is 1000 for the module. You create a branch, make a release and send it to the client.

Time goes by and after a couple of months / years the client asks you to fix the problem in the application. You will check the branch and run the svn updating project. Unfortunately, the associated module has changed a lot and now has version 23456. And now the application does not even compile.

Of course, what you should do is change svm:externals to indicate the exact version (1000) when you branch. And if you need to change the module code, then you need to point to the head of the branch created for the module in edition 1000.

A lot of unnecessary work, so I would strongly refuse to use external resources for any large project.

If you had good experience with svn:externals , I am all ears.

0
source

All Articles