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

Re: SVN Merge questions

From: John Peacock <john.peacock_at_havurah-software.org>
Date: Mon, 25 Feb 2008 07:43:53 -0500

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_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-02-25 13:43:50 CET

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.