Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double-revert features #1073

Merged
merged 2 commits into from
Feb 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions phing/tasks/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,16 @@
</drush>
<!-- Revert all features. -->
<foreach list="${cm.features.bundle}" param="bundle" target="setup:update:features-import" />
<!-- Revert all features again! -->
<!-- @see https://www.drupal.org/node/2851532 -->
<foreach list="${cm.features.bundle}" param="bundle" target="setup:update:features-import" />
<if>
<equals arg1="${cm.features.no-overrides}" arg2="true"/>
<then>
<echo>Checking for features overrides...</echo>
<foreach list="${cm.features.bundle}" param="bundle" target="setup:update:features-override-check" />
</then>
</if>
</then>
</if>
<!-- Rebuild caches. -->
Expand Down Expand Up @@ -290,17 +300,14 @@
<drush command="fra" assume="yes" alias="${drush.alias}" passthru="false">
<option name="bundle">${bundle}</option>
</drush>
</target>

<target name="setup:update:features-override-check" description="Checks if features are overridden.">
<exec dir="${docroot}" command="${drush.cmd} fl --bundle=${bundle} | grep -Ei '(changed|conflicts|added)( *)$'" outputProperty="features.overrides"/>
<if>
<equals arg1="${cm.features.no-overrides}" arg2="true"/>
<istrue value="${features.overrides}"/>
<then>
<echo>Checking for features overrides...</echo>
<exec dir="${docroot}" command="${drush.cmd} fl --bundle=${bundle} | grep -Ei '(changed|conflicts|added)( *)$'" outputProperty="features.overrides"/>
<if>
<istrue value="${features.overrides}"/>
<then>
<fail>A feature in the ${bundle} bundle is overridden. You must re-export this feature to incorporate the changes.</fail>
</then>
</if>
<fail>A feature in the ${bundle} bundle is overridden. You must re-export this feature to incorporate the changes.</fail>
</then>
</if>
</target>
Expand Down