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

Re: Merge From Trunk to Branch

From: Hugo Villeneuve <hugo_at_hugovil.com>
Date: 2004-12-14 15:37:17 CET

>
> And further assume that a developer has made a branch named "Bar" under
> branches.
>
> The URL to the trunk is svn://svnserver/FooProject/trunk and the URL to
> the
> developer's branch is svn://svnserver/FooProject/branches/Bar.
>
> So far so good.
>
> The developer has been working away from the trunk for a couple of days
> (bad.. I
> know, but bear with me). They aren't yet ready to merge from their
> branch back
> into the trunk, but they want to merge from the trunk down to their
> branch to
> minimize the pain later and keep their branch as close to in-sync as
> they can.
>
> The developer has done 'svn log --stop-on-copy
> svn://svnserver/FooProject/branches/Bar'
> to figure out the repository revision of when the branch was made: 135.
> The current
> revision of the trunk is 164. The developer's working copy is fully
> committed to his
> branch.
>
> So, again, what he wants to do is to merge all changes in the trunk
> since 135 down into
> his branch without changing the trunk.
>
> What is the right way to accomplish this?
>
> I suspect it is something like 'svn merge' from the branch to the trunk
> and then
> instead of committing to the trunk, doing a 'svn switch' back to the
> branch,
> but since I haven't used switch before I'm not 100% sure.
>
> Can someone please help me out here? It seems like this would be a
> common occurance
> for people who use branches much.
>
> Thanks in advance,
>
> Peter

Hi Peter,
   If you work on a local copy, you could do:

    cd FooProject
    svn merge -r 135:164 trunk branches/Bar
 
(you can also replace "-r 135:164" with "-r 135:HEAD")

This way, you can easily check if it works the way you intend to, and revert if it's not. It's the same thing as a standard merge from a branch to the trunk, you just switch the source and destination.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Dec 14 16:15:44 2004

This is an archived mail posted to the Subversion Users mailing list.