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

Re: Understanding merging.

From: Ryan Schmidt <subversion-2005_at_ryandesign.com>
Date: 2005-10-26 17:34:01 CEST

On Oct 26, 2005, at 17:08, Anastasios Angelidis wrote:

>> In that case, get a working copy of Trunk, go into it, and merge
>> the change into the working copy:
>>
>> cd /path/to/working/copy/of/Trunk
>> svn merge -r3:4 svn://myserver/Development/Test_Project/Branches/
>> Bug_Fixes
>>
>> This means "Make a recipe that transforms revision 3 of the
>> Bug_Fixes branch into revision 4, and apply that recipe to the
>> working copy I'm in right now."
>>
>
> Ok it worked but I'm not exactly understanding why -r3:4. The
> working copy is at r5 and I want to merge r4 into it... to make the
> working copy finally r6. Maybe you can explain it differently? Thanks
>

The fact that your working copy is at revision 5 right now is
irrelevant.

You also do not know for certain that, when you commit, you will get
revision 6. If there are other developers, they may be committing
other things, and you might end up with revision 7, or 8, or 10, or
52. That's also irrelevant.

What's relevant is the revision in which the change occurred that you
want to merge, and the path in the repository where the change was
made. In your case, it happened in revision 4 of Branches/Bug_Fixes.
Revision 4 has the change; the revision before that, revision 3, did
not have the change. So, to construct a diff that applies the change,
you need to ask for a difference between revisions 3 and 4, rooted at
the Branches/Bug_Fixes path, because that corresponds to the path of
the working copy of Trunk that you have now (because Branches/
Bug_Fixes was at one time a copy of Trunk).

When you do the merge, the difference gets applied to your working
copy of Trunk, you commit it, and thus, the change that had occurred
in revision 4 of the branch has now been made to the trunk.

If it's still unclear, look more closely into what Subversion is
doing. Look at the diff it's generating:

svn diff -r3:4 \
svn://myserver/Development/Test_Project/Branches/Bug_Fixes

Convince yourself that the list of instructions printed by this
command are indeed the changes that you want performed on your
working copy of Trunk.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Oct 26 17:37:42 2005

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.