Here we detail guidance on using the subversion repository. In particular, we describe how to use branches for feature development and how to commit the branches back into the trunk when completed.
The root of the Nektar++ repository is https://gforge.sci.utah.edu/svn/nektar. The standard convention for code repositories stipulates three sub-directories: trunk, tags, branches. The trunk directory is the primary version of the code which should contain the latest completed features. The branches directory contains (temporary) copies of trunk in which new features can be developed without introducing instability into the trunk. Once the feature is complete and merged back into the trunk, the branch is usually deleted. The tags directory contains snapshots of the trunk at notable points in time (e.g. release candidates).
Revision numbers are repository-global and incremented whenever a commit is made in a trunk, a branch or in creating a tagged version. Therefore, the sequence of revision numbers for a given branch or the trunk will not necessarily be consecutive.
Branches are complete copies of the main (trunk) code tree and allow parallel development of partially complete features without them interfering with each other. When the feature is complete, the changes are merged back into the trunk. In this way, the trunk remains stable.
To create a branch:
svn copy https://gforge.sci.utah.edu/svn/nektar/trunk \ https://gforge.sci.utah.edu/svn/nektar/branches/my-feature
where my-feature is a name for the branch.
We will assume we have a branch 'my-feature' which we wish to merge into the trunk. Before starting, determine the following items of information:
svn log --stop-on-copy
svn update svn info
We merge the branch into the trunk and (optionally) pull any changes to the trunk since the branch was created into the branch. The latter is only necessary if we plan to continue working in the branch.
We begin by merging the changes to our branch into the trunk.
svn status
svn checkout https://gforge.sci.utah.edu/svn/nektar/trunk nek-trunk
svn merge --dry-run -r M:HEAD https://gforge.sci.utah.edu/svn/nektar/branches/my-feature
svn merge -r M:HEAD https://gforge.sci.utah.edu/svn/nektar/branches/my-feature
svn update
svn commit
"Merged revisions M:N of branch my-feature into trunk"
Optionally, we may now incorporate changes to the trunk which have happened since the branch was created into our branch to continue using it.
svn update
svn merge --dry-run -r M:N https://gforge.sci.utah.edu/svn/nektar/trunk
svn merge -r M:N https://gforge.sci.utah.edu/svn/nektar/trunk
svn commit
As a final check, the trunk and your branch should now be identical. This can be checked using:
svn diff https://gforge.sci.utah.edu/svn/nektar/trunk \ https://gforge.sci.utah.edu/svn/nektar/branches/my-feature
1.7.1