V4 Source Code Repository
From SoftwarePractice.org
Contents |
Repository Structure
The structure of our repository will be as follows:
- trunk
- ...project files here...
- tags
- ...copies of trunk here for each milestone...
- branches
- ...copies of trunk here for active development...
We have selected this structure for several reasons. For one, it is best-practice recommended by the SVN developers, but it also gives us most flexibility and the ability to ensure quality attributes through testing.
Guidelines
To work with this structure there are several guidelines and procedures:
- Developers must not directly commit changes to the trunk or tags directories.
- Developers must create a copy of trunk in the branches folder, commit changes to that, and then notify the team that they are ready for their change to be integrated into the trunk.
- Another member of the team will review the changes, and notify QA when they are happy
- QA will run tests and notify the Technical Lead when they are happy
- The Technical Lead will merge the branch into the trunk
- Other developers working on branches will merge the new changes from the trunk into their branch before their branch can be integrated.
- At each milestone, the Technical Lead will copy the trunk into tags to record progress at these points.
There are several guidelines relating to the general use of SVN:
- Never commit build products. Any files generated by compiling other files should not be added to the repository. Otherwise every time the source file is changed, the generated file will be changed too. This 'pollutes' the project history with unnecessary file modifications.
- When a branch is integrated, other branches should be updated as soon as possible. The longer you wait to merge, the more difficult the merge will be.
- When merging changes from trunk, always say so in the commit message, and include the change number that was merged.
Branching with SVN
Branching with SVN uses the svn copy command. Do this whenever you want to work on a new feature. The syntax of the command is:
svn copy source_url dest_url
For example to create a branch my_branch (and check out a copy of it) use:
svn copy https://swordfish.eng.uts.edu.au/projects/sa08spr_v4/svn/trunk \
https://swordfish.eng.uts.edu.au/projects/sa08spr_v4/svn/branches/my_branch
svn co https://swordfish.eng.uts.edu.au/projects/sa08spr_v4/svn/branches/my_branch
Merging with SVN
Merging with SVN uses the svn merge command. You will need to do this whenever a branch gets integrated into the trunk. The syntax of this command is:
svn merge -c change source_url
For example if a branch was integrated into the trunk creating change 102, the commands to merge these changes into my_branch are:
svn co https://swordfish.eng.uts.edu.au/projects/sa08spr_v4/svn/branches/my_branch svn merge -c 102 https://swordfish.eng.uts.edu.su/projects/sa08spr_v4/svn/trunk ...at this point the changes will have been merged into the local working copy... ...review the merge, resolve any conflicts, and test... svn commit
If you already have a clean copy of my_branch it is ok to just use that copy rather than checking out a new copy.
SVN Glossary
- Branch - A copy of the trunk used for active development.
- Change - The set of differences between 2 revisions. Change n is the difference between revision n - 1 and n.
- Integrate - To merge a branch into the trunk.
- Merge - To 'copy' changes from the trunk into a branch.
- Tag - A copy of the trunk at a significant point (ie. a milestone). No one may commit changes to a tag.
- Trunk - The baseline of the project. All branches are copies of the trunk, but only the technical lead may commit changes to it.
