We run a large Drupal site with a lot of features. Our team modify the features on code, but the site users modify them on the production site. We end up with features that are not synchronized, and we needed a way to backport the changes made on the production site, to our code base.
Using drush, we can do a drush features-diff, but it is rather useless for complex features, as we have to backport each changes by hand in the code.
So I created new drush commands in order to get a unified diff of all the changes, which we can then use to patch our code base. It is used in production now, and it allows us to easily grab the changes made on production database, commit them in our code; once we push the new code, the features get back in sync nicely.
How to use:
On your production server, create the unified diff for one feature, or all (redirect only STDIN to the file):
drush features-udiff-all 1> ../features.diff
Then, transfer the file to your dev code base, and apply it as a patch:
patch -p0 < features.diff
Here's the patch, created against 7.x-1.0-beta, feed free to include it in the module if you see it fit, and to post improvements.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | unified_diffs_for-1308842-3.patch | 2.56 KB | helmo |
| features.drush_.inc_.patch | 7.09 KB | verot |
Comments
Comment #1
mpotter commentedWould be interested in seeing this patch updated for the latest release.
Comment #1.0
mpotter commentedupdate code
Comment #2
damienmckennaNeeds to be rerolled.
Comment #3
helmo commentedI hacked a bit on this as I prefer unified format...
This new patch gets me a unified version.
A remaining problem is that the code to guess the filename where it belongs did not work for me. So unfortunately simply using patch to apply it is not yet possible.
Comment #4
helmo commented