[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: Ryan Schmidt <subversion-2005_at_ryandesign.com>
Date: 2005-07-02 16:52:37 CEST

I see no bug; I see pilot error:

On 30.06.2005, at 12:34, thomas mauch wrote:

> - 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

Right here. You've created a branch not from trunk, but from a
modified copy of trunk. The way I understood it, if you ever intend
to merge your branch back into trunk, you should make a copy of an
unmodified trunk. Meaning: you should either make the change in the
trunk working copy, then commit it to trunk, and then create the
branch from trunk; or you should create the branch from trunk, then
get a working copy of the branch, then make the change in the branch,
then commit the change to the branch (depending on whether you wanted
the change to be in the trunk or in the 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

The conflict is not erroneous; it is completely expected. The problem
is that uni_druck_gp12.c in branch @ <revision-when-branch-was-
created> does not match the state of uni_druck_gp12.c in trunk @
<revision-when-branch-was-created>. When you do a merge, you must
always do so on like objects, and you're not. The diff your merge is
generating does not contain the steps necessary to get
uni_druck_gp12.c from r502 (which is what you have in trunk) to r503
(which is what your branch started with).

So, again, the solution is this: the revision that creates a branch
should do only that. Do not try to do anything else in the same
revision, such as make changes to uni_druck_gp12.c.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Jul 2 16:56:07 2005

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