register
other register

Friday, August 10, 2007

svn merge example

Problem Solving:

Merge code from one branch to the trunk.

The release candidate server has the code from trunk.

In release_candidate server's source code directory:

svn merge --dry-run -r rev1:rev2 branch_url

# rev1 is the revision number when first branch out from trunk
# rev2 is the latest revision number from the branch

svn merge -r rev1:rev2 branch_url

svn status | grep "C "

# see any conflicts after merge, "C" stands for conflict

# for those conflict files, edit them to fix the conflict.

# filename.working is the local copy (here is the trunk code)
# filename.right is the latest from the branch
# filename.left is the original from the brach when first branched out from trunk

# happy

svn resolved filename

svn commit -m "commit rev1:rev2 branch_url"

# commit the merged code to the trunk

# done

For more svn knowledge, please see SVN RedBook

No comments: