You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "I-Smith, Brooke" <br...@boeing.com> on 2008/02/25 08:51:54 UTC

SVN Merge questions

Gidday SVNers,

svn, version 1.4.4 (r25188)
   compiled Jul 19 2007, 10:47:50
(Solaris).

The following SVN Merge behaviour seems wrong.  Schenario:

*	rev 20 - merge commit from branches/bsmith to trunk
*	rev 21 - branches/bsmith - I performed some deletes and adds.  
*	rev 22 - branches/other_person - some changes

I want to merge from my branch to trunk:
*	cd trunk_working_copy
*	svn merge --dry-run r:21:22 $REPO/branches/bsmith

Nothing happens (no output).

Try:
*	svn merge --dry-run r:20:22 $REPO/branches/bsmith

Works and merges changes at rev21.  Why.  Doesn't "r 21:22" mean all changes from rev 21 to rev 22?  So r 20:22 means all changes including 20, 21 and 22.  

Secondly, when you merge should you avoid where you have merged before?  As in the above scenario I would have thought I wouldn't want r:20:22.

I'm not on users@subversion.tigris.org and would appreciate if you could CC any replies to me also (I'm CC'd).

Thanks,

Brooke
------------------------------------------------------
            Brooke Benjamin Oehm Smith 
Technical Publishing Development Team Lead 
      Product Support Group, Operations
               Boeing Australia Limited 
                   +61 7 3306 3335 

The environment should be put in the category of our national security.  Defense of our resources is just as important as defense abroad.  Otherwise what is there to defend?  ~Robert Redford, Yosemite National Park dedication, 1985

P Please consider the environment before printing this email.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


RE: SVN Merge questions

Posted by "I-Smith, Brooke" <br...@boeing.com>.
Excellent John, the answer I was hoping for (clarity).  Our team struggles with merges because we tend to keep our branches active rather then create a new one for each task.  I've known about merge tracking in 1.5 and look forward to the day it is released.

Cheers,

Brooke

-----Original Message-----
From: John Peacock [mailto:john.peacock@havurah-software.org]
Sent: Monday, 25 February 2008 10:44 PM
To: I-Smith, Brooke
Cc: users@subversion.tigris.org
Subject: Re: SVN Merge questions


I-Smith, Brooke wrote:
> Doesn't "r 21:22" mean all changes from rev 21 to rev 22?  So r 20:22 means all changes including 20, 21 and 22.  

Because the '-r' option does not operate on changesets like you are expecting;
it denotes which revision to use as the start point for a diff.  So to merge in
the changes that were made in 21, you need to make a diff between 20 and 21 (and
so on for 22, except see below).

You may want to use the '-c' parameter instead, if that makes more sense to you.
 In this case you would type the line:

	svn merge -c 21 ...

which is in every way equivalent to

	svn merge -r20:21 ...

The presence of '22' in your original merge is misleading because you are
merging changes from a specific path, and "branches/bsmith" didn't change in
r22, so that will generate no changes.

> Secondly, when you merge should you avoid where you have merged before?  As in the above scenario I would have thought I wouldn't want r:20:22.

Yes, you should avoid merging what you have already merged before.  If you do
the above merge and make more changes in "branches/bsmith", then you would not
start your merge with 20 any longer, but rather with the first commit that you
make to that branch (minus 1) and the last commit you made before merging.

In other words:

	svn merge -c 21 $REPO/branches/bsmith
	... make various changes to the repo including possibly other paths
	svn merge -r42:47 $REPO/branches/bsmith

where you want to merge in the changes made _on that branch_ in revisions 43-47
inclusive.

FWIW, when 1.5.0 is released, it will have much better merge support, so
Subversion will automatically track what revisions have been merged from where
and eliminate duplicates automatically (as much as possible).

Does that help?

John

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: SVN Merge questions

Posted by John Peacock <jo...@havurah-software.org>.
I-Smith, Brooke wrote:
> Doesn't "r 21:22" mean all changes from rev 21 to rev 22?  So r 20:22 means all changes including 20, 21 and 22.  

Because the '-r' option does not operate on changesets like you are expecting;
it denotes which revision to use as the start point for a diff.  So to merge in
the changes that were made in 21, you need to make a diff between 20 and 21 (and
so on for 22, except see below).

You may want to use the '-c' parameter instead, if that makes more sense to you.
 In this case you would type the line:

	svn merge -c 21 ...

which is in every way equivalent to

	svn merge -r20:21 ...

The presence of '22' in your original merge is misleading because you are
merging changes from a specific path, and "branches/bsmith" didn't change in
r22, so that will generate no changes.

> Secondly, when you merge should you avoid where you have merged before?  As in the above scenario I would have thought I wouldn't want r:20:22.

Yes, you should avoid merging what you have already merged before.  If you do
the above merge and make more changes in "branches/bsmith", then you would not
start your merge with 20 any longer, but rather with the first commit that you
make to that branch (minus 1) and the last commit you made before merging.

In other words:

	svn merge -c 21 $REPO/branches/bsmith
	... make various changes to the repo including possibly other paths
	svn merge -r42:47 $REPO/branches/bsmith

where you want to merge in the changes made _on that branch_ in revisions 43-47
inclusive.

FWIW, when 1.5.0 is released, it will have much better merge support, so
Subversion will automatically track what revisions have been merged from where
and eliminate duplicates automatically (as much as possible).

Does that help?

John

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org