You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Rickard Lindberg <ri...@gmail.com> on 2009/07/24 12:08:17 UTC

Problem with merge and --reintegrate

In our project we are using branches for two things: releases and features.

When most features have been implemented for the next release we copy trunk to
a release branch where we keep fixing bugs and preparing it for release.
Bug fixes have been merged back intro trunk resulting in trunk having the
svn:mergeinfo property set to /branches/release:xxx-yyy. Some commits to the
release branch we would not like to merge back to trunk though since they are
very local and only apply to that release. We trick subversion to skip those
revisions using the --record-only flag to merge. Nothing is ever cherry picked
from trunk to the release branch.

o---o----------o---------o----------------o--> trunk
    |             ^            ^
    |             |            |
    +---o---------o------------o----> release

With a feature branch, we copy the trunk to branches/feature. We regularly
merge changes from trunk into the feature branch and work on the feature at the
same time.

The problem occurred when trying to reintegrate the feature branch with trunk
using these commands:

  cd trunk
  svn merge --reintegrate path/to/feature/branch

With the 1.5.1 client I got the following error message:

  svn: Cannot reintegrate from '...' yet:
  Some revisions have been merged under it that have not been merged
  into the reintegration target; merge them first, then retry.

I am not sure why I get this message, but I suspect it is because of the
previous merges from release branches intro trunk.

So I tried with a 1.6 client. Then the merge seemed to work but the strange
thing (at least I thought) was that the command also wrote the svn:mergeinfo
property. Why does it do that? The documentation says the feature branch is
useless after a reintegration.

I also tried out this command:

  cd trunk
  svn merge --ignore-ancestry .@HEAD ../branches/feature/@HEAD .

I think this should do the same thing as the reintegrate thing. Am I right?
However this command also messed with the svn:mergeinfo property. I can't
understand why.

How should I do to properly merge my feature branch back into trunk?

I am not registered to the mailing list, so I would appreciate if you also
replied to me directly in addition to the mailing list.

-- 
Rickard Lindberg

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2375162

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Problem with merge and --reintegrate

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Jul 24, 2009 at 03:04:06PM +0200, Rickard Lindberg wrote:
> > One question though. Surely you'll want to cherry pick from the
> > trunk occasionally? What if someone fixes a bug there during general
> > dev that's appropriate for the release?
> 
> Ya, I guess. We just haven't done it yet. On the other hand, if you are
> supposed to fix a bug, isn't it better to fix it in the oldest maintained
> branch and then merge it back intro trunk from there?

There's no rule about this unless you make one up.

In Subversion itself all changes enter the code base through trunk.
We then do backports to the release branches. See this file for
a bit of insight on how this works (every change needs 3 votes to
go in): http://svn.collab.net/repos/svn/branches/1.6.x/STATUS

Stefan

Re: Problem with merge and --reintegrate

Posted by Rickard Lindberg <ri...@gmail.com>.
> This is exactly what we do, and what we experienced. My advice is, upgrade to 1.6.3 server and clients immediately. Then run svn propdel -R svn:mergeinfo across every branch, but being careful to revert the root folder's merge info before checking in. This cleans up all the crappy per file mergeinfo left behind by early buggy versions of 1.5. After these steps you should find that everything works pretty sweetly, with mergeinfo only being recorded on the root folder. Its so easy to let per file mergeinfo creep back in, and its a constant battle to keep the bloody stuff at bay (especially given all the per file patchup merges that typically have to be done when files and folders move around - in that case I use --ignore-ancestry which stops mergeinfo from being written).
>
> That's what we did anyway, and life got immeasurably better.

Ok. Thanks for your input.

> One question though. Surely you'll want to cherry pick from the trunk occasionally? What if someone fixes a bug there during general dev that's appropriate for the release?

Ya, I guess. We just haven't done it yet. On the other hand, if you are
supposed to fix a bug, isn't it better to fix it in the oldest maintained
branch and then merge it back intro trunk from there?

-- 
Rickard Lindberg

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2375180

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


RE: Problem with merge and --reintegrate

Posted by James French <Ja...@naturalmotion.com>.
This is exactly what we do, and what we experienced. My advice is, upgrade to 1.6.3 server and clients immediately. Then run svn propdel -R svn:mergeinfo across every branch, but being careful to revert the root folder's merge info before checking in. This cleans up all the crappy per file mergeinfo left behind by early buggy versions of 1.5. After these steps you should find that everything works pretty sweetly, with mergeinfo only being recorded on the root folder. Its so easy to let per file mergeinfo creep back in, and its a constant battle to keep the bloody stuff at bay (especially given all the per file patchup merges that typically have to be done when files and folders move around - in that case I use --ignore-ancestry which stops mergeinfo from being written).

That's what we did anyway, and life got immeasurably better.

One question though. Surely you'll want to cherry pick from the trunk occasionally? What if someone fixes a bug there during general dev that's appropriate for the release?

James

> -----Original Message-----
> From: Rickard Lindberg [mailto:ricli85@gmail.com]
> Sent: 24 July 2009 13:08
> To: users@subversion.tigris.org
> Subject: Problem with merge and --reintegrate
> 
> In our project we are using branches for two things: releases and
> features.
> 
> When most features have been implemented for the next release we copy
> trunk to
> a release branch where we keep fixing bugs and preparing it for
> release.
> Bug fixes have been merged back intro trunk resulting in trunk having
> the
> svn:mergeinfo property set to /branches/release:xxx-yyy. Some commits
> to the
> release branch we would not like to merge back to trunk though since
> they are
> very local and only apply to that release. We trick subversion to skip
> those
> revisions using the --record-only flag to merge. Nothing is ever cherry
> picked
> from trunk to the release branch.
> 
> o---o----------o---------o----------------o--> trunk
>     |             ^            ^
>     |             |            |
>     +---o---------o------------o----> release
> 
> With a feature branch, we copy the trunk to branches/feature. We
> regularly
> merge changes from trunk into the feature branch and work on the
> feature at the
> same time.
> 
> The problem occurred when trying to reintegrate the feature branch with
> trunk
> using these commands:
> 
>   cd trunk
>   svn merge --reintegrate path/to/feature/branch
> 
> With the 1.5.1 client I got the following error message:
> 
>   svn: Cannot reintegrate from '...' yet:
>   Some revisions have been merged under it that have not been merged
>   into the reintegration target; merge them first, then retry.
> 
> I am not sure why I get this message, but I suspect it is because of
> the
> previous merges from release branches intro trunk.
> 
> So I tried with a 1.6 client. Then the merge seemed to work but the
> strange
> thing (at least I thought) was that the command also wrote the
> svn:mergeinfo
> property. Why does it do that? The documentation says the feature
> branch is
> useless after a reintegration.
> 
> I also tried out this command:
> 
>   cd trunk
>   svn merge --ignore-ancestry .@HEAD ../branches/feature/@HEAD .
> 
> I think this should do the same thing as the reintegrate thing. Am I
> right?
> However this command also messed with the svn:mergeinfo property. I
> can't
> understand why.
> 
> How should I do to properly merge my feature branch back into trunk?
> 
> I am not registered to the mailing list, so I would appreciate if you
> also
> replied to me directly in addition to the mailing list.
> 
> --
> Rickard Lindberg
> 
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessage
> Id=2375162
> 
> To unsubscribe from this discussion, e-mail: [users-
> unsubscribe@subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2375177

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].