Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using the tofu scale with svn

Has anyone tried using the tofu-scale descriped in Practical Perforce by Laura Wingerd together with svn?

The tofu-scale tells us how to propagate changes between branches (codelines). Changes in stable branches should be merged to less stable branches (firm-to-soft), and changes in the less stable branches should be copied to the stable branches (soft-to-firm). See How Software Evolves

This results in development branches where changes made to more stable branches are being merged, and thus improving code in the development branch bringing in new development and bugfixes.

Figure taken from Practical Perforce (ISBN 10: 0-596-10185-6) http://dl.getdropbox.com/u/136976/tofu%20scale.png

So the question is: Can you do this in svn and if; how do you update from the parent when working on a branch? I know from CVS, that updating from one branch to another gives you a lot of problems when you want to merge your changes back into the parent branch (often being the mainline)

like image 488
homaxto Avatar asked Aug 21 '09 13:08

homaxto


3 Answers

  1. Use the standard trunk/, branches/, tags/ structure
  2. Use trunk/ as your mainline
  3. Create branches for development and release in branches/ - you can distinguish them using a naming convention or even replace branches/ with development/ and release/
  4. Use svn merge to perform both merges and copies - read Advanced Merging first
like image 51
D.Shawley Avatar answered Oct 22 '22 17:10

D.Shawley


Reading more on the subject I found what I believe is a precise description of what is needed in order to do this kind of change propagation between branches in svn.

It is descriped in the book Version Control With Subversion by C. Michael Pilato et al. in the subchapter Basic Merging - Keeping a Branch in Sync

The follwing is cited from the book.

Subversion is aware of the history of your branch and knows when it divided away from the trunk. To replicate the latest, greatest trunk changes to your branch, first make sure your working copy of the branch is “clean”—that it has no local modifications reported by svn status. Then simply run:

$ svn merge http://svn.example.com/repos/calc/trunk

Once you have a clean working copy of the trunk, you're ready to merge your branch back into it:

$ pwd
/home/user/calc-trunk

$ svn update  # (make sure the working copy is up to date)
$ svn merge --reintegrate http://svn.example.com/repos/calc/branches/my-calc-branch
$ svn commit -m "Merge my-calc-branch back into trunk!"

Please read the whole chapter (and maybe even the book) before starting on this. It is recommended reading.

like image 3
homaxto Avatar answered Oct 22 '22 16:10

homaxto


Yes, you can do that in Subversion, it is more or less standard practice.

The idea is to merge from the more stable with less change to the less stable, in order to minimize unrelated changes that would make merging more difficult.

Merging back to the mainline is done by first merging all changes from the mainline into the branch, and then copying the branch, that is replacing the mainline by the merged branch.

like image 2
starblue Avatar answered Oct 22 '22 17:10

starblue