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

RE: Merging 2 branches

From: Lakshman Srilakshmanan <lakshman.srilakshmanan_at_tradingpost.com.au>
Date: 2006-05-10 09:12:42 CEST

Hi Baz,

Thanks for your clarification. The merging process is slowly starting to
sink in.
I am sorry for this continuous barrage of questions please bear with me.

I did the following test. I edited sgs.prop and included a new comment
line (change x) each time.

1) create branch_A
2) create branch_B
3) change 1 made to branch_A @ rev 183
4) change 2 made to branch_A @ rev 184
5) change 3 made to branch_A @ rev 185
6) check-out branch_B and make it my current working dir.
7) svn merge svn://lakshman@lisa/Enterprise/Common/trunk

As per your email, I would have expected only changes in "rev 185" (ie
change 3) to be merged into branch_B. But instead, I found all the
changes from the previous revisions as well. This has got me perplexed.

What am I doing differently ?

Your assistance is greatly appreciated.

This is starting to drive me round the bend. Thank god the windows on my
7th floor are reinforced.


> -----Original Message-----
> From: Baz [mailto:brian.ewins@gmail.com]
> Sent: Tuesday, 9 May 2006 7:11 PM
> To: Lakshman Srilakshmanan
> Cc: users@subversion.tigris.org
> Subject: Re: Merging 2 branches
> On 5/9/06, Lakshman Srilakshmanan
> <lakshman.srilakshmanan@tradingpost.com.au> wrote:
> > Since I am merging regularly from trunk into project_A, wouldn't
> > project_A have all changes from trunk ? that being the case wouldn't
> > merge svn://..../trunk svn://..../branches/project_A be only the
> > enhancement done in project_A. ie the changes I need to apply into
> > project_B.
> >
> > If I am incorrect, could you please identify my misunderstanding.
> It's probably my misunderstanding of what you're doing. I presumed the
> sequence of events was something like this:
> 1. create branch A
> 2. changes made to branch A
> 3. changes made trunk (not the same changes as in branch)
> 4. create branch B
> 5. changes made to branch A
> 6. changes made to branch B
> 7. changes made to trunk
> 8. trunk changes merged to A (NB A still not identical to trunk
> because of r2, r5)
> 9. trunk changes merged to B (NB B still not identical to trunk
because of r6)
> 10. changes made to branch A
> 11. changes made to branch B
> 12. changes made to trunk
> At this point, the various options look like:
> svn merge -r 1:12 .../branch_A
> makes changes equivalent to applying r2, r5, r8, r10.
> It's too much because r8 has been applied to branch_B as r9.
> svn merge .../branch_A .../branch_B
> makes changes equivalent to undoing r10, r8, r5, r2 and applying r4,
> r6, r9, r11.
> Since those last 4 have already been applied to branch B, clearly
> *not* what we want.
> svn merge .../trunk .../branch_A
> makes changes equivalent to undoing r12 and applying r10.
> Applying this will not apply all the changes from branch A to branch B
> - r2, r5 get missed.
> However, this *will* be correct if the trunk and branch A ended up
> identical after r8. This seems to be what you're suggesting?
> The suggestion in my mail works out like this with the revisions
> svn merge -r 1:7 .../branch_A
> svn merge -r 9:12 .../branch_A
> Hopefully this makes things a bit clearer?
> -Baz

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed May 10 09:16:45 2006

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.