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

Re: Correct way of doing merge in a complex repository?

From: Stefan Sperling <stsp_at_elego.de>
Date: Wed, 25 Jun 2014 20:46:22 +0200

On Wed, Jun 25, 2014 at 10:47:47AM -0700, Xin LI wrote:
> Hi,
>
> In the FreeBSD project, we use "vendor branch" and merge changes that
> happen there to trunk. The FreeBSD project's repository can be accessed at
> svn://svn.freebsd.org/base or via web at http://svnweb.freebsd.org/base .
>
> Now I'm facing a problem with the merging approach and would like to know
> if there is a good solution to this. Long story short, I have done a
> series of 'svn mv' before applying new vendor code into vendor branch so
> can maintain file's history (commit message can be seen at [1]).
>
> When merging that changeset to ^/head/contrib/file, I got a lot of
> conflicts, complaining on local modification vs incoming delete.
>
> Is there a way to keep the file history when doing the merge? The
> repository was converted from CVS where we do heavy repo-copies to maintain
> that.

I can reproduce the tree conflicts.

Recall that SVN models renames as a copy and a delete, which are handled
independently by Subversion. So it helps to think in terms of copy+delete
when you resolve these conflicts, rather than thinking about it in term
of a "move" operation.

Tree conflicts are flagged on files which are deleted by the merge and
differ in content from the file which were originally deleted. You'll
have to compare each of the conflicted files to the corresponding file
at the move target location (e.g. ascmagic.c to src/ascmagic.c), e.g.
like this: svn diff --old ascmagic.c --new src/ascmagic.c

Then you'll need to decide if any changes from the old ascmagic.c
need to be applied to the new src/ascmagic.c. Once you've done that,
you can mark the conflict resolved: svn resolved ascmagic.c

There are other ways of dealing with this, but the above is probably
the easiest approach to get going with.
Received on 2014-06-25 20:47:01 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.