How can I use pm-update or pm-updatecode for projects that have patches which aren't yet included in a stable release on d.o.? I don't want to have to re-apply the patches (if necessary) to the updated project.

  1. Site developers can manually keep a list of patches in a patches folder or with patches.txt, but that can't be automated and is prone to errors.

  2. Building a Drupal site with Git just points users at drush up. Even though a backup of the original project would be saved, I'd still have to manually figure out which projects had patches and re-apply them to the current version of the project.

  3. A few years ago, #1060500: drush diff [module/core] ? asked about drush up diff functionality and was directed to the Hacked! module. I've used that many times, but only to see what has changed in a site/module. You can't use the Hacked! drush commands to perform the project update.

  4. Use the Diff Update shell script on pg. 143 of The Definitive Guide to Drupal 7. The script is available here: https://gitorious.org/agaric-scripts/agaric-scripts/blobs/master/version...

I've thought about modifying the Diff Update script for my needs, but I wanted to check first what the drush best practice is for updating patched projects. Thoughts?

Comments

greg.1.anderson’s picture

Status: Active » Fixed

There is no best practice for automating merges. See also #392762: Kitten-o-matic

I would recommend keeping your Drupal site checked in to git. Keep one branch for unpatched modules, and another branch with your patches. Switch to the unpatched branch before running pm-updatecode. Use git tools to merge changes from your old branch into a new fork of the unpatched branch. Throw away old patch branches when you don't need them any more.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.