Is about managing source codes by branching. Branching is a way to have 2 or more sets of source code with each has it's own development, but eventually, merging them into the main trunk.
Example, in most development, we normally have "development" & "release" version. As word means, the "development" version is meant for development & testing. But the "release" version, would be the ultimate version that roll out for production use. For this example, "release" will be the trunk & "development" will be the branch.
A view of it :
web_blog(repository) | +release | | | +front_end | | | +engine | | +development | +front_end | +engine
To create this hierarchy :
cd /home/user/svn_repositories
svnadmin create web_blog
svn mkdir file:///home/user/svn_repositories/web_blog/release
svn import /home/user/web_blog_initial_source_code \ file:///home/user/svn_repositories/web_blog/release
svn copy file:///home/user/svn_repositories/web_blog/release \ file:///home/user/svn_repositories/web_blog/development
Usually, the cycle of branching & merging of codes looks like this :
- To work on "development" branch, do a usual checkout from the development branch, e.g.
svn checkout file:///home/user/svn_repositories/web_blog/development
- Then work on the code in "development" branch working copy
- Commit as usual, e.g.
svn commit -m "The codes are ready for production"
- Test the codes in devel branch until it is stable and ready for release
- When the code is ready to merge with release trunk, checkout a copy from "release" trunk, and cd into it. MAKE SURE the current directory is in the root of "release" working copy!
- Merging the "release" code with "development" code, e.g.
svn merge file:///home/user/svn_repositories/web_blog/development
- To check out what are the file changes :
svn status
- Finally, commit the merge, e.g.
svn commit -m "Merging the development codes"
Hasta la vista !!!
ref : The Subversion Book, legally free online
No comments:
Post a Comment