Here's an tutorial explaining how to merge a subversion branch back into trunk:
# First you'll need a local working copy of your trunk
$ cd /path/to/checkout/trunk
$ svn co https://HOSTNAME/repo/trunk .
# The above command will return the latest revision of the trunk
# which you'll need to remember for a later command. Example:
Checked out revision 76.
# If you already have a working copy of your trunk,
# running an "svn update" will set your repo to the latest revision
# and return the latest revision:
$ cd /path/to/checkout/trunk
$ svn update
At revision 76.
# Now, you'll need to find the revision when the branch was created:
$ svn log --stop-on-copy https://HOSTNAME/repo/branches/20091205 | tail -5
------------------------------------------------------------------------
r63 | eric | 2009-10-07 15:10:28 -0400 (Wed, 07 Oct 2009) | 1 line
Created branch.
------------------------------------------------------------------------
# Now that you know the latest trunk revision and the branch created revision,
# you can execute the merge on your local working copy of trunk
# NOTE: it would be a good idea to ensure you are not executing the merge
# in an active environment!
$ cd /path/to/checkout/trunk
$ svn merge -r 63:76 https://HOSTNAME/repo/branches/20091205 .
# NOTE: the revision range syntax is: "-r BRANCH:TRUNK"
# Now if you execute an "svn stat" command you'll see that all the changes from your branch have been applied to your working copy of trunk. Hopefully, there are no conflicts! Now you can review the changes, test your code, and commit.If you need to merge some changes made to trunk into your branch, you could do the following:
# find the branch created revision:
$ svn log --stop-on-copy https://HOSTNAME/repo/branches/20091205 | tail -5
------------------------------------------------------------------------
r63 | eric | 2009-10-07 15:10:28 -0400 (Wed, 07 Oct 2009) | 1 line
Created branch.
------------------------------------------------------------------------
# find the latest revision of trunk:
$ svn info https://HOSTNAME/repo/trunk | grep -i ^Last\ Changed\ Rev
Last Changed Rev: 76
# from checked out local copy of branch:
$ svn merge -r 63:76 https://HOSTNAME/repo/trunk .










Individually
You can also merge individual revisions with the -c argument:
svn merge -c 63 https://HOSTNAME/repo/branches/20091205This way you can step through each revision and ensure it commits correctly, then proceed to the next one. I've found it often safer to do it this way when merging code from a branch to a trunk that has also had changes applied since the original branching.
Subversion managing multiple client specifics
Somewhat related, i have this difficulty.
We use 1 drupal-6.16 trunc with all the basics for a new site. But for client A we have a clientA module, clientA theme, settings, Files. And for client B, a module, theme etc.
How can i make it that i can do checkout of the base and a checkout of a specific client to a version controlled copy. And still be able to commit changes to f.i. clientA module backup into that clients branch? Checking out all clients for every install and deleting the once we do need is our current practice ;-)
I have tried many settings but it just wont get right.
kind regards, and a great very usefull blog!
pls check the rss, i couldnt get it to work.
Joel - drupal developer
options
Hi Joel,
Typically, I commit the sites folder into a separately managed SVN repository, and then create a new sites folder (and repo) for each client.
Repo 1: Drupal installation (minus sites folder)
Repo 2: sites folder, putting all shared modules in themes in sites/all
Repo N: client folder in sites directory
You could also look into svn:externals (http://svnbook.red-bean.com/en/1.0/ch07s03.html).
Regards,
Eric