I was quite excited when I found out about svnmerge. I'm hoping it will make my life much easier. I've read the Wiki, Ken Kinder's tutorial, and much of the mailing list. However, I've been struggling with it the past few days, and I'm hoping someone might be able to assist. I thank you in advance.
I work at a small company (using rhel4/svn1.1.4) where our development workflow basically goes like this:
- trunk is always stable and represents qa-tested/approved code
- a developer creates a branch off of trunk to do new development
- occasionally, a developer will merge trunk into his/her branch
- a developer will merge their branch into trunk after it has been approved by qa
As it stands now, we're tracking revisions by-hand, and doing merges manually. And, at any given time, there are multiple developers all doing development in their own branches. I'm very much hoping that I can use svnmerge to make the merging less painful and error-prone.
We're using the svnmerge.py from http://svn.collab.net/repos/svn/trunk/contrib/client-side/svnmerge.py
Below is the sequence of commands and output--with annotations--of my attempts with svnmerge. The end-result is an error condition; a property conflict with svnmerge-integrated. I'd very much appreciate anyone who could tell me what I'm doing wrong, or if I should be doing something differently. Thanks again.
The main idea below is that: dev1 makes a change in her branch, merges it into trunk, and then makes another change in her branch. dev2 creates a new branch off of trunk. dev1 again merges her branch into trunk. dev2 tries to merge trunk into her branch, but the operation fails.
[EMAIL PROTECTED]:~]$ # Create the repository
[EMAIL PROTECTED]:~]$ svnadmin create $HOME/.repo
[EMAIL PROTECTED]:~]$ # Create an environment variable pointing to the repository
[EMAIL PROTECTED]:~]$ export REPO=svn+ssh://localhost/$HOME/.repo
[EMAIL PROTECTED]:~]$ # Make the conventional tags, branches, and trunk directories
[EMAIL PROTECTED]:~]$ svn mkdir $REPO/tags $REPO/branches $REPO/trunk -m ""
Committed revision 1.
[EMAIL PROTECTED]:~]$ # Make the 1st branch and name it "first"
[EMAIL PROTECTED]:~]$ svn cp $REPO/trunk $REPO/branches/first -m ""
Committed revision 2.
[EMAIL PROTECTED]:~]$ # Create a container directory to hold trunk and our branches and name it "testing"
[EMAIL PROTECTED]:~]$ mkdir testing
[EMAIL PROTECTED]:~]$ # Change directory to the container directory
[EMAIL PROTECTED]:~]$ cd testing
[EMAIL PROTECTED]:~/testing]$ # Check out trunk
[EMAIL PROTECTED]:~/testing]$ svn co $REPO/trunk
Checked out revision 2.
[EMAIL PROTECTED]:~/testing]$ # Check out the branch named "first"
[EMAIL PROTECTED]:~/testing]$ svn co $REPO/branches/first
Checked out revision 2.
[EMAIL PROTECTED]:~/testing]$ # Change directory to the directory containing trunk
[EMAIL PROTECTED]:~/testing]$ cd trunk/
[EMAIL PROTECTED]:~/testing/trunk]$ # Initialize merge tracking for branch "first" in trunk
[EMAIL PROTECTED]:~/testing/trunk]$ svnmerge init ../first/
property 'svnmerge-integrated' set on '.'
[EMAIL PROTECTED]:~/testing/trunk]$ # Commit
[EMAIL PROTECTED]:~/testing/trunk]$ svn ci -F svnmerge-commit-message.txt
Sending .
Committed revision 3.
[EMAIL PROTECTED]:~/testing/trunk]$ # Change directory to the directory containing the branch "first"
[EMAIL PROTECTED]:~/testing/trunk]$ cd ../first/
[EMAIL PROTECTED]:~/testing/first]$ # Initialize merge tracking for trunk in branch "first"
[EMAIL PROTECTED]:~/testing/first]$ svnmerge init ../trunk/
property 'svnmerge-integrated' set on '.'
[EMAIL PROTECTED]:~/testing/first]$ # Commit
[EMAIL PROTECTED]:~/testing/first]$ svn ci -F svnmerge-commit-message.txt
Sending .
Committed revision 4.
[EMAIL PROTECTED] :~/testing/first]$ # Then, Sarah creates a file in her branch
[EMAIL PROTECTED]:~/testing/first]$ echo foo > foo
[EMAIL PROTECTED]:~/teting/first]$ # Adds it to subversion
[EMAIL PROTECTED]:~/testing/first]$ svn add foo
A foo
[EMAIL PROTECTED]:~/testing/first]$ # Then commits it
[EMAIL PROTECTED]:~/testing/first]$ svn ci foo -m ""
Adding foo
Transmitting file data .
Committed revision 5.
[EMAIL PROTECTED] :~/testing/first]$ # QA tells Sarah to merge her branch "first" into trunk, so she changes to the directory containing trunk
[EMAIL PROTECTED]:~/testing/first]$ cd ../trunk/
[EMAIL PROTECTED]:~/testing/trunk]$ # Then checks what revisions are available for merging
[EMAIL PROTECTED]:~/testing/trunk]$ svnmerge avail -ldb
svnmerge: changes in revision 5 follow
Index: foo
===================================================================
--- foo (revision 0)
+++ foo (revision 5)
@@ -0,0 +1 @@
+foo
[EMAIL PROTECTED]:~/testing/trunk]$ # Then she merges her change into trunk
[EMAIL PROTECTED]:~/testing/trunk]$ svnmerge merge -b
property 'svnmerge-integrated' set on '.'
A foo
property 'svnmerge-integrated' set on '.'
[EMAIL PROTECTED]:~/testing/trunk]$ svn update
At revision 5.
[EMAIL PROTECTED]:~/testing/trunk]$ # She checks in the merged changes
[EMAIL PROTECTED] :~/testing/trunk]$ svn ci -F svnmerge-commit-message.txt
Sending .
Adding foo
Committed revision 6.
[EMAIL PROTECTED]:~/testing/trunk]$ # Sarah changes directory to the branch "first"
[EMAIL PROTECTED]:~/testing/trunk]$ cd ../first/
[EMAIL PROTECTED]:~/testing/first]$ # Then, she creates a new file..
[EMAIL PROTECTED]:~/testing/first]$ echo bar > bar
[EMAIL PROTECTED]:~/testing/first]$ # And, adds it to subversion
[EMAIL PROTECTED]:~/testing/first]$ svn add bar
A bar
[EMAIL PROTECTED]:~/testing/first]$ # Then commits it and goes out to lunch
[EMAIL PROTECTED]:~/testing/first]$ svn ci bar -m ""
Adding bar
Transmitting file data .
Committed revision 7.
[EMAIL PROTECTED]:~/testing/first]$ cd ..
[EMAIL PROTECTED]:~/testing]$ # Meanwhile, Beth comes in to work and creates a new branch named "second"
[EMAIL PROTECTED] :~/testing]$ svn cp $REPO/trunk $REPO/branches/second -m ""
Committed revision 8.
[EMAIL PROTECTED]:~/testing]$ # And checks out her branch named "second"
[EMAIL PROTECTED]:~/testing]$ svn co $REPO/branches/second
A second/foo
U second
Checked out revision 8.
[EMAIL PROTECTED]:~/testing]$ cd trunk/
[EMAIL PROTECTED]:~/testing/trunk]$ # She inits merge tracking for branch "second" in trunk
[EMAIL PROTECTED]:~/testing/trunk]$ svnmerge init ../second/
property 'svnmerge-integrated' set on '.'
[EMAIL PROTECTED]:~/testing/trunk]$ # And commits her change
[EMAIL PROTECTED]:~/testing/trunk]$ svn ci -F svnmerge-commit-message.txt
Sending .
Committed revision 9.
[EMAIL PROTECTED]:~/testing/trunk]$ cd ../second/
[EMAIL PROTECTED]:~/testing/second]$ # Then, she inits merge tracking for trunk in the "second" branch
[EMAIL PROTECTED]:~/testing/second]$ svnmerge init ../trunk/
property 'svnmerge-integrated' set on '.'
[EMAIL PROTECTED]:~/testing/second]$ # And, commits that..
[EMAIL PROTECTED]:~/testing/second]$ svn ci -F svnmerge-commit-message.txt
Sending .
Committed revision 10.
[EMAIL PROTECTED]:~/testing/second]$ cd ../trunk/
[EMAIL PROTECTED]:~/testing/trunk]$ # QA tells the 1st developer, Sarah, to merge her latest change into trunk..
[EMAIL PROTECTED]:~/testing/trunk]$ svnmerge avail -lb --head branches/first
------------------------------------------------------------------------
r7 | someone | 2006-10-27 17:23:16 -0400 (Fri, 27 Oct 2006) | 1 line
Changed paths:
A /branches/first/bar
[EMAIL PROTECTED]:~/testing/trunk]$ # So, she does..
[EMAIL PROTECTED]:~/testing/trunk]$ svnmerge merge -b --head branches/first
property 'svnmerge-integrated' set on '.'
A bar
property 'svnmerge-integrated' set on '.'
[EMAIL PROTECTED]:~/testing/trunk]$ svn update
At revision 10.
[EMAIL PROTECTED]:~/testing/trunk]$ # Then, Sarah commits the merge
[EMAIL PROTECTED]:~/testing/trunk]$ svn ci -F svnmerge-commit-message.txt
Sending .
Adding bar
Committed revision 11.
[EMAIL PROTECTED]:~/testing/trunk]$ # Beth wants to update her branch "second" with the latest changes from Sarah that are now in trunk...
[EMAIL PROTECTED]:~/testing/trunk]$ cd ../second/
[EMAIL PROTECTED]:~/testing/second]$ # Beth looks to see what is available..
[EMAIL PROTECTED]:~/testing/second]$ svnmerge avail -lb --head trunk
------------------------------------------------------------------------
r11 | someone | 2006-10-27 17:26:17 -0400 (Fri, 27 Oct 2006) | 7 lines
Changed paths:
M /trunk
A /trunk/bar (from /branches/first/bar:7)
Merged revisions 6-10 via svnmerge from
svn+ssh://somewhere/home/someone/.repo/branches/first
........
r7 | someone | 2006-10-27 17:23:16 -0400 (Fri, 27 Oct 2006) | 1 line
........
[EMAIL PROTECTED]:~/testing/second]$ svnmerge avail -lbd --head trunk
svnmerge: changes in revision 11 follow
Index: bar
===================================================================
--- bar (revision 0)
+++ bar (revision 11)
@@ -0,0 +1 @@
+bar
Property changes on:
___________________________________________________________________
Name: svnmerge-integrated
+ /branches/first:1-10 /branches/second:1-8
[EMAIL PROTECTED]:~/testing/second]$ # And, then, unsuccessfully tries to merge it in :-(
[EMAIL PROTECTED]:~/testing/second]$ svnmerge merge -b --head trunk
property 'svnmerge-integrated' set on '.'
A bar
C .
property 'svnmerge-integrated' set on '.'
[EMAIL PROTECTED]:~/testing/second]$ svn diff
Property changes on:
___________________________________________________________________
Name: svnmerge-integrated
- /branches/first:1-5 /trunk:1-9
+ /branches/first:1-5 /trunk:1-11
[EMAIL PROTECTED]:~/testing/second]$ more dir_conflicts.prej
Property 'svnmerge-integrated' locally changed to '/branches/first:1-5 /branches/second:1-8', but update sets it to '/branches/first:1-10 /branches/second:1-8'
[EMAIL PROTECTED]:~/testing/second]$
_______________________________________________ Svnmerge mailing list [email protected] http://www.orcaware.com/mailman/listinfo/svnmerge
