SVN Vendor Branches provides Three-way merging within version control.
The premise is simple. You're using code from another source (Drupal.org or Acquia). You may make changes to the code and so will the developers of Drupal and contributed modules. You want THEIR changes and you want to keep YOURS too.
The solution is SVN Vendor Branches and the almighty svn merge command.
The trick is learning how to use/setup the vendor branch in the first place.
The following steps, and this 32 minute video, should get you going with one of the most efficient ways to manage your Drupal codebase.
All URLS below can use one of the possible protocols
- file:/// = local version control
- svn+ssh:// = svn direct through ssh
- http:// = non secure via web
- https:// = secure via web
PHASE 1: Establishing the repository with a vendor branch
svnadmin create acquia6(create repository)tar xzf [FILE] --strip-components=1(extract within desired folder)svn mkdir file:///acquia/repos/acquia6/vendor -m 'Making the vendor branch'svn mkdir file:///acquia/repos/acquia6/vendor/current -m 'Making the current vendor branch'svn import file:///acquia/repos/acquia6/vendor/current -m 'Adding current 1.0.2 release to vendor/current'svn copy file:///acquia/repos/acquia6/vendor/current file:///acquia/repos/acquia6/vendor/102 -m 'Tagging the 1.0.2 release'svn copy file:///acquia/repos/acquia6/vendor/current file:///acquia/repos/acquia6 -m 'Tagging my core Acquia Drupal'svn checkout file:///acquia/repos/acquia6/vendor/current .(within the desired location)
PHASE 2: Upgrading the vendor code
curl -O http://acquia.com/files/downloads/acquia-drupal-X.X.X.xxxx.tar.gz(get the latest)tar xzf [NEW_RELEASE] --strip-components=1(extract within folder of vendor/current) - check using 'svn info'- svn status to find added and removed files/folders - use svngrep to add them
svn commit -m 'Upgrading Acquia Drupal to 1.2.1'(commit updated code to vendor/current)svn copy file:///acquia/repos/acquia6/vendor/current file:///acquia/repos/acquia6/vendor/121 -m 'Tagging the 1.2.1 release'
PHASE 3: Upgrading your site code
svn switch file:///acquia/repos/acquia6/current(switch to your site)svn merge file:///acquia/repos/acquia6/vendor/102 file:///acquia/repos/acquia6/vendor/current(THE MAGIC!)svn commit -m 'Merged in upgrade to 1.2.1'- Run update.php for database upgrades
- Check that your site it working as planned


I haven’t been able to get any of the GotDrupal.com videos to play. Please make them available for subscription via RSS feed & Miro.
I can't access this link. I don't know why, maybe there's a problem with my server. I wil try again tomorrow. classifieds |ads|orange county restaurants
Just a note, untarring over the existing stuff does not remove files that were removed in the new tarball that existed in the old tarball. Following your instructions as is will leave outdated files behind, which can be a security risk (it isn't often, but it can be). I'm not sure if there's another switch that does that, but I wouldn't count on it.
I didn't even consider that. I have to be honest, in my own system, I personally checkout CVS from cvs.drupal.org, which does take care of removing files. It would be nice if Acquia provided svn source releases and you could use svk, git or some other system to manage the removed files. It sure does make it easier than pulling from a download.
So I guess its
rm -rf *, then untaring into vendor/current. Fortunately, .svn won't be deleted because it's a special file, but I'm sure there's a better way to manage this shortcoming.Using "
rm -rf *" will leave the .svn folder at the top level untouched, but will remove the .svn folders within all the subdirectories, so important housekeeping information will be lost.I have seen a method of merging two vendor branches which avoids the need to copy the files in place:
svn merge --ignore-ancestry file:///acquia/repos/acquia6/vendor/102 file:///acquia/repos/acquia6/vendor/121
See http://lookfirst.com/2007/11/subversion-vendor-branches-howto.html
I think another method is to make a new working version by checking out a copy of the new vendor release, and then merging the previous vendor release and the locally patched version. In other words, "apply to the new release all the changes I applied to the old release". I have tested both these methods and they seem to work, including removing old files and adding new ones.
I noticed a lot of chatter about vendor branching practices using various VCS's. I've avoided reading into it as seemed as a something I already knew/didn't need.
Know I see what all the stuff is about, and have picked up a new merge command which I need to try for myself. Though I think your rollback technique via
svn updateisn't all that useful. As you cannot commit change you have performed in your working copy until you perform an update. To undo a revision (r5), I merge that revision in reverse:svn merge -c -5 file://...Thanks for making a video about this, I don't think I would of ever bothered to read about it!
Hi, thanks for creating such great Drupal video tutorials. I'm just starting with SVN and I watched this video and your Optimized CVS/SVN Setup actually twice ;)
I found Updating Drupal using SVN Vendor Branches another excellent help and I'm now setting up a combination of these examples. Above linked article contains a very nice alternative to your svngrep command, using svn_load_dirs.pl. I'm now using svn_load_dirs.pl since it's seems easier.
Re the video not working, I also encountered some problems. In Windows it doesn't load at all in my browser, after downloading and playing in VLC there seems to be a problem with part of the video: the first seconds are OK, then the screen disappears while audio continues. When I forward to halfway in the video, I get back the screen. Seems to be something with the initial background in the video.
Anyway, thanks!
Thanks for the vid. There is one part of vendor branching that I am still having issues with...
David from Minimalmedia sums it up pretty well is his article Upgrading Drupal Core With Vendor Branches and svn_load_dirs: Almost Perfect.
Do you have any solutions you would recommend?
Hi, Matt. Thanks for video, I really enjoyed it. But I've some questions. Why cant we merge our working trunk (for example it is drupal 6-15 with some modifications) just with the new release drupal 6-16 (also for example)? Following you tutorial, we should first merge 6-15 with 6-16, and only then with our working copy. As for me I cant understand it.
Also I didnt understand you actions in part with using svn-grep. Sorry for my ENG, greetings from Ukraine :)