version control - SVN build revision -
we working on java project , have automatic build everyday, , of times have checked in our code though not complete save it, many times build breaks due single person (not due error, code incomplete).
to avoid there option in svn can assign build revision/tag takes files revision, i.e people have completed code have build revision latest revision , people have incomplete code checkin point build revision earlier revision not break build.
branch-when-needed explained in subversion best practices doc best approach take.
the branch-when-needed system users commit day-to-day work on /trunk. rule #1: /trunk must compile , pass regression tests @ times. committers violate rule publically humiliated. rule #2: single commit (changeset) must not large discourage peer-review. rule #3: if rules #1 , #2 come conflict (i.e. it's impossible make series of small commits without disrupting trunk), user should create branch , commit series of smaller changesets there. allows peer-review without disrupting stability of /trunk. pros: /trunk guaranteed stable @ times. hassle of branching/merging rare. cons: adds bit of burden users' daily work: must compile , test before every commit.
use svn copy (cp)
create branches manage non-trivial changes.
svn copy <base url or path>/trunk <base url or path>/branches/enhancement-1
then commit changes related changes branch, not trunk.
merge changes trunk branches, regularly, in order not outdate branch trunk.
cd branch-dir svn merge -r <rev1>:<rev2> <base url or path>/trunk svn ci
when changes in branch stable enough, merge them trunk.
cd trunk-dir svn merge -r <revx>:<revy> <base url or path>/branches/enhancement-1 svn ci
keeping track of important revision numbers (rev1, rev2, revx, revy, etc.) make lot easier going through svn log
.
sample repository layout.
project/ ├── branches │ ├── major-refactoring-1 <= specific changes on refactoring can not moved trunk yet │ ├── production <= of time changes trunk merged production releases │ ├── user-1 <= changes done user not stable enough move trunk │ └── user-2 ├── tags └── trunk
other guides:
http://mazamascience.com/workingwithdata/?p=623
svn best-practices - working in team
Comments
Post a Comment