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

RE: Re: merging a branch to the trunk

From: Ralph Navarro <RNavarro_at_iperia.com>
Date: 2006-03-21 18:05:34 CET

The task of merging a change set from when the branch was created to the
HEAD appears to be a frequent operation of doing a merge. Is there a
feature planned in the works to create a keyword that could provide this
point in time automatically for the user (e.g. BRANCH_CREATED or
something similar)?

Ralph Navarro
Cell..: 508-287-0190
Email.: RNavarro@iperia.com

-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2006Q1@ryandesign.com]
Sent: Tuesday, March 21, 2006 11:31 AM
To: Craig White
Cc: users@subversion.tigris.org
Subject: Re: merging a branch to the trunk

On Mar 21, 2006, at 16:47, Craig White wrote:

> Let me try to describe what I am trying to do in another way.
>
> I want to merge my branch 'phase2' into my main trunk
>
> I change directories to my main trunk
> $ pwd
> /home/craig/svn/th-db/trunk
>
> svn merge --dry-run -r 1:20 svn \
> +craigssh://craig@srv1.example.com/home/craig/svn/th-db/branches/
> phase2
>
> but it 'appears' to me that it is creating everything new inside my
> trunk...
>
> Skipped 'test'
> Skipped 'test/unit'
> A test/unit/client_test.rb
> A test/unit/user_test.rb
> A test/unit/notifier_test.rb
> A test/unit/clients_test.rb
> A test/unit/error_mailer_test.rb
> A test/unit/facility_test.rb
> A test/unit/case_manager_test.rb
> A test/unit/referral_note_test.rb
> A test/unit/case_managers_test.rb
> A test/unit/placement_test.rb
> A test/test_helper.rb
>
> when all these files already exist in the 'trunk'

Subversion tracks back through time. When you ask for revision 1 of
branches/phase2, Subversion sees that branches/phase2 didn't exist in
revision 1, but at some point after revision 1 you created that
branch by copying the trunk. So Subversion tracks back to the trunk
and gives you changes that occurred there, including the adding of
those files. That's why it's adding them now.

You need to get the revision number at which you created the branch.
As someone else already said, use "svn log --stop-on-copy" on the
branch to discover that. Then merge from that revision to the most
recent revision of the branch. So for example if you discover using
"svn log --stop-on-copy" that you created the branch in revision 10,
and now it's revision 20, then that means you want to take the list
of changes performed between revisions 10 and 20 of the branch, and
perform them on a working copy of the trunk. Therefore:

cd /home/craig/svn/th-db/trunk
svn merge -r10:20 \
svn+craigssh://craig@srv1.example.com/home/craig/svn/th-db/branches/
phase2

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Mar 21 18:07:33 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.