[Svnmerge] svnmerge and multiple branch problems

John Smith johnsmith71251 at gmail.com
Fri Oct 27 17:32:13 PDT 2006


Hello,

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.

[sarah at somewhere:~]$ # Create the repository
[sarah at somewhere:~]$ svnadmin create $HOME/.repo
[sarah at somewhere:~]$ # Create an environment variable pointing to the
repository
[sarah at somewhere:~]$ export REPO=svn+ssh://localhost/$HOME/.repo
[sarah at somewhere:~]$ # Make the conventional tags, branches, and trunk
directories
[sarah at somewhere:~]$ svn mkdir $REPO/tags $REPO/branches $REPO/trunk -m ""
Committed revision 1.
[sarah at somewhere:~]$ # Make the 1st branch and name it "first"
[sarah at somewhere:~]$ svn cp $REPO/trunk $REPO/branches/first -m ""
Committed revision 2.
[sarah at somewhere:~]$ # Create a container directory to hold trunk and our
branches and name it "testing"
[sarah at somewhere:~]$ mkdir testing
[sarah at somewhere:~]$ # Change directory to the container directory
[sarah at somewhere:~]$ cd testing
[sarah at somewhere:~/testing]$ # Check out trunk
[sarah at somewhere:~/testing]$ svn co $REPO/trunk
Checked out revision 2.
[sarah at somewhere:~/testing]$ # Check out the branch named "first"
[sarah at somewhere:~/testing]$ svn co $REPO/branches/first
Checked out revision 2.
[sarah at somewhere:~/testing]$ # Change directory to the directory containing
trunk
[sarah at somewhere:~/testing]$ cd trunk/
[sarah at somewhere:~/testing/trunk]$ # Initialize merge tracking for branch
"first" in trunk
[sarah at somewhere:~/testing/trunk]$ svnmerge init ../first/
property 'svnmerge-integrated' set on '.'
[sarah at somewhere:~/testing/trunk]$ # Commit
[sarah at somewhere:~/testing/trunk]$ svn ci -F svnmerge-commit-message.txt
Sending        .
Committed revision 3.
[sarah at somewhere:~/testing/trunk]$ # Change directory to the directory
containing the branch "first"
[sarah at somewhere:~/testing/trunk]$ cd ../first/
[sarah at somewhere:~/testing/first]$ # Initialize merge tracking for trunk in
branch "first"
[sarah at somewhere:~/testing/first]$ svnmerge init ../trunk/
property 'svnmerge-integrated' set on '.'
[sarah at somewhere:~/testing/first]$ # Commit
[sarah at somewhere:~/testing/first]$ svn ci -F svnmerge-commit-message.txt
Sending        .
Committed revision 4.
[sarah at somewhere:~/testing/first]$ # Then, Sarah creates a file in her
branch
[sarah at somewhere:~/testing/first]$ echo foo > foo
[sarah at somewhere:~/teting/first]$ # Adds it to subversion
[sarah at somewhere:~/testing/first]$ svn add foo
A         foo
[sarah at somewhere:~/testing/first]$ # Then commits it
[sarah at somewhere:~/testing/first]$ svn ci foo -m ""
Adding         foo
Transmitting file data .
Committed revision 5.
[sarah at somewhere:~/testing/first]$ # QA tells Sarah to merge her branch
"first" into trunk, so she changes to the directory containing trunk
[sarah at somewhere:~/testing/first]$ cd ../trunk/
[sarah at somewhere:~/testing/trunk]$ # Then checks what revisions are
available for merging
[sarah at somewhere:~/testing/trunk]$ svnmerge avail -ldb

svnmerge: changes in revision 5 follow

Index: foo
===================================================================
--- foo (revision 0)
+++ foo (revision 5)
@@ -0,0 +1 @@
+foo

[sarah at somewhere:~/testing/trunk]$ # Then she merges her change into trunk
[sarah at somewhere:~/testing/trunk]$ svnmerge merge -b
property 'svnmerge-integrated' set on '.'

A  foo

property 'svnmerge-integrated' set on '.'

[sarah at somewhere:~/testing/trunk]$ svn update
At revision 5.
[sarah at somewhere:~/testing/trunk]$ # She checks in the merged changes
[sarah at somewhere:~/testing/trunk]$ svn ci -F svnmerge-commit-message.txt
Sending        .
Adding         foo

Committed revision 6.
[sarah at somewhere:~/testing/trunk]$ # Sarah changes directory to the branch
"first"
[sarah at somewhere:~/testing/trunk]$ cd ../first/
[sarah at somewhere:~/testing/first]$ # Then, she creates a new file..
[sarah at somewhere:~/testing/first]$ echo bar > bar
[sarah at somewhere:~/testing/first]$ # And, adds it to subversion
[sarah at somewhere:~/testing/first]$ svn add bar
A         bar
[sarah at somewhere:~/testing/first]$ # Then commits it and goes out to lunch
[sarah at somewhere:~/testing/first]$ svn ci bar -m ""
Adding         bar
Transmitting file data .
Committed revision 7.
[sarah at somewhere:~/testing/first]$ cd ..
[beth at somewhere:~/testing]$ # Meanwhile, Beth comes in to work and creates a
new branch named "second"
[beth at somewhere:~/testing]$ svn cp $REPO/trunk $REPO/branches/second -m ""
Committed revision 8.
[beth at somewhere:~/testing]$ # And checks out her branch named "second"
[beth at somewhere:~/testing]$ svn co $REPO/branches/second
A  second/foo
 U second
Checked out revision 8.
[beth at somewhere:~/testing]$ cd trunk/
[beth at somewhere:~/testing/trunk]$ # She inits merge tracking for branch
"second" in trunk
[beth at somewhere:~/testing/trunk]$ svnmerge init ../second/
property 'svnmerge-integrated' set on '.'
[beth at somewhere:~/testing/trunk]$ # And commits her change
[beth at somewhere:~/testing/trunk]$ svn ci -F svnmerge-commit-message.txt
Sending        .
Committed revision 9.
[beth at somewhere:~/testing/trunk]$ cd ../second/
[beth at somewhere:~/testing/second]$ # Then, she inits merge tracking for
trunk in the "second" branch
[beth at somewhere:~/testing/second]$ svnmerge init ../trunk/
property 'svnmerge-integrated' set on '.'
[beth at somewhere:~/testing/second]$ # And, commits that..
[beth at somewhere:~/testing/second]$ svn ci -F svnmerge-commit-message.txt
Sending        .
Committed revision 10.
[beth at somewhere:~/testing/second]$ cd ../trunk/
[sarah at somewhere:~/testing/trunk]$ # QA tells the 1st developer, Sarah, to
merge her latest change into trunk..
[sarah at somewhere:~/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
[sarah at somewhere:~/testing/trunk]$ # So, she does..
[sarah at somewhere:~/testing/trunk]$ svnmerge merge -b --head branches/first
property 'svnmerge-integrated' set on '.'

A  bar

property 'svnmerge-integrated' set on '.'

[sarah at somewhere:~/testing/trunk]$ svn update
At revision 10.
[sarah at somewhere:~/testing/trunk]$ # Then, Sarah commits the merge
[sarah at somewhere:~/testing/trunk]$ svn ci -F svnmerge-commit-message.txt
Sending        .
Adding         bar

Committed revision 11.
[beth at somewhere:~/testing/trunk]$ # Beth wants to update her branch "second"
with the latest changes from Sarah that are now in trunk...
[beth at somewhere:~/testing/trunk]$ cd ../second/
[beth at somewhere:~/testing/second]$ # Beth looks to see what is available..
[beth at somewhere:~/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
........


[beth at somewhere:~/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
[beth at somewhere:~/testing/second]$ # And, then, unsuccessfully tries to
merge it in :-(
[beth at somewhere:~/testing/second]$ svnmerge merge -b --head trunk
property 'svnmerge-integrated' set on '.'

A  bar
 C .

property 'svnmerge-integrated' set on '.'

[beth at somewhere:~/testing/second]$ svn diff

Property changes on:
___________________________________________________________________
Name: svnmerge-integrated
   - /branches/first:1-5 /trunk:1-9
   + /branches/first:1-5 /trunk:1-11

[beth at somewhere:~/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'
[beth at somewhere:~/testing/second]$
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/svnmerge/attachments/20061028/17a335a4/attachment.html>


More information about the Svnmerge mailing list