Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I (and how to) apply a patch created from trunk to a branch?

I was working on the trunk recently and the changed I did I thought others might need them so I created a patch just before committing.

Now a fellow dev who was working on a branch (which comes from the trunk a couple of weeks back) needs those changes to go on a new server.

I'm trying to apply my patch with Tortoise SVN but it does'nt seam to like the disparities of my working copies. I have :

  • My trunk at : D:\SVN\Trunk
  • The branch at : D:\SVN\Branches\TheBranchINeedToPatch

Am I trying to do something impossible ? Is there something I'm missing ?

Can I apply a trunk patch to a branch working copy ?

Thanks for the help!

like image 771
Sébastien Richer Avatar asked Dec 01 '10 22:12

Sébastien Richer


1 Answers

Perquisite: Let's say you are currently working on the branch. To check that use svn info. The url should be pointing to your branch

Then you can merge the changes from trunk to your branch by using merge command

svn merge -r FROM_REVISION:REQUIRED_REVISION url/to/trunk .
or
svn merge -r 26:32 url/to/trunk .

This will bring all change sets from rev 26 to 32 of trunk into your branch.

Ah, there already is a discussion on how to do this with TortoiseSVN: Using TortoiseSVN how do I merge changes from the trunk to a branch and vice versa?

like image 186
pyfunc Avatar answered Sep 17 '22 07:09

pyfunc