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.

Comments

mpotter’s picture

Status: Active » Needs review

Would be interested in seeing this patch updated for the latest release.

mpotter’s picture

Issue summary: View changes

update code

damienmckenna’s picture

Version: 7.x-1.0-beta4 » 7.x-2.x-dev
Issue summary: View changes
Status: Needs review » Needs work

Needs to be rerolled.

helmo’s picture

I 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.

helmo’s picture

StatusFileSize
new2.56 KB