Deploy Feature changes by reverting with Hook Update Deploy Tools

If you are using a deploy workflow with your Drupal website you may be reverting your Features through code.  One approach is to make the Feature take care of itself by adding an .install file to the Feature and then adding a hook_update_N() to the install.  This has some nice advantages of keeping your changes compartmentalized.  Translation: fewer merge conflicts on your custom_deploy.install.

Calling feature_revert() in an .install sometimes gets the job done, but you have no idea.  It runs silently and leaves you scratching your head. Better to use Hook Update Deploy Tools module and call 

HookUpdateDeployTools\Features::revert($features);

And get meaningful output in your drush terminal, or output in update.php and logged in Watchdog like this:

output from drush updb

You can tell immediately if the Feature reverted fully, is still overridden or didn't even requre a revert.

 

section: