[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Bug in svn merge when files are commited with changes into the branch

From: Dominic Anello <danello_at_danky.com>
Date: 2005-06-30 16:42:20 CEST

On 2005-06-30 12:34:25 +0200, thomas mauch wrote:
----8<----
> I attach 3 files and describe how to reproduce the problem:
>
> - You have a repository test with directories trunk/src and branches
> - Copy attached file uni_druck_gp12.c.r502 into
> trunk/src/uni_druck_gp12.c
> and commit it - this is the version before the branch is created
> - Copy attached file uni_druck_gp12.c.r503 into
> trunk/src/uni_druck_gp12.c -
> the file now contains the changes which have been made when the branch
> was created
> - Create the branch: svn copy src
> svn://server//test/branches/test-branch
> - Checkout the branch and copy attached file uni_druck_gp12.c.r540 into
> trunk/branches/test-branches/uni_druck_gp12.c - the file now contains
> the
> changes made when the branch was active
> - Commit the branch
> - Now checkout a new trunk directory and execute the command
> svn merge -r <revision-when-branch-was-created>:HEAD
> svn://test/branches/test-branch and the file uni_druck_gp12.c will
> have erroneously a status of conflict

This last step may be your problem. For simplicity's sake, let's say
that revision-when-branch-was-created=503

You're merge command is
svn merge -r 503:HEAD svn://test/branches/test-branch

This will apply the differences between 503 and HEAD. However, it will
no include the differences *in* r503, so those changes get left out and
you can get conflicts.

If you were to do
svn log -q -v -r 503 svn://test/branches/test-branch
You would probably see this:
------------------------------------------------------------------------
r503 | tmauch | 2005-06-30 10:34:05 -0500 (Thu, 30 June 2005)
Changed paths:
   A /branches/test-branch (from /trunk:502)
   M /branches/test-branch/uni_druck_gp12.c
------------------------------------------------------------------------

So your merge command should be
svn merge -r 502:HEAD svn://test/branches/test-branch

Most examples show starting with the branch creating rev because the
common case is to just create a branch with no modified files in the
commit. I do the same thing to bump version numbers when I branch, and
I have to remember to start with branch_creation-1 when merging back to
trunk.

HTH,

-Dominic

  • application/pgp-signature attachment: stored
Received on Thu Jun 30 18:16:01 2005

This is an archived mail posted to the Subversion Users mailing list.