I wrote some commands to help module maintainers.
drush help patch
Applies the given patch to the affected module.
Examples:
0 drush patch
http://example.com/file.patch
1 drush patch
http://drupal.org/node/69696969
Arguments:
url URL to the patch. Can be a HTTP URL
to the actual patch file or a d.o
node
Reverts the changes of the given patch.
Examples:
0 drush unpatch
http://example.com/file.patch
1 drush unpatch
http://drupal.org/node/69696969
Arguments:
url URL to the patch. Can be a HTTP URL
to the actual patch file or a d.o
node
Applies the given patch to the affected module and run the relevant simpletest
tests, then revert the files.
Examples:
0 drush patchtest
http://example.com/file.patch
1 drush patchtest --affected
module1,module2
http://example.com/file.patch
Arguments:
url URL to the patch. Can be a HTTP URL
to the actual patch file or a d.o
node
Options:
--affected Comma separated names of affected
modules. Tests for these modules
will be executed. Use --affected=all
to run all the tests on the site.
--force Run the tests even if the patching
is unsuccessful.
Executes the simpletest test for the given module only.
Examples:
0 drush moduletest user
1 drush moduletest simpletest
2 drush moduletest all
Arguments:
module Name of the module. If "all" is
given, all of the tests will be
executed
Options:
--verbose Show the full output of run-test.sh,
not only the failed tests.
The help of the commands are self-explaining.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | patchtest.drush_.inc_.gz | 3.41 KB | aron novak |
| patchtest.drush_.inc_.gz | 3.42 KB | aron novak |
Comments
Comment #1
jonhattanI just take a quick look to the code. You should change the calls to `module_rebuild_cache` by `drush_get_modules`, that has been recently introduced in HEAD for D7 compatibility.
Comment #2
aron novakjonhattan: thank you for the notice, it's great that drush provides cross-version compabitility.
New .inc is attached.
Comment #3
moshe weitzman commentedWow, this is really really nice. I have some minor drush API type feedback, but I think I will just play with this and see how it goes. Meanwhile, would be great of folks reviewed this.
Would it be helpful if some form of #580530: Command to run simpletests were in drush? Might be better than relying on run-tests.sh.
Comment #4
moshe weitzman commentedHmm. On first try I get:
Can we make this detection code more robust? I tried running this from the sites/all/modules/og directory and the drupal root.
Comment #5
R-H commentedI get the same failed to detect module
:/var/www/pressflow/sites/all/modules/logintoboggan# drush patch http://drupal.org/files/issues/logintoboggan.module_21.patch
Failed to detect which module to patch.
Comment #6
greg.1.anderson commentedThis looks good; we should revisit after drush-3.0 stable is out.
See related issue #392762: Kitten-o-matic.
Comment #7
greg.1.anderson commentedAll this and more now being worked on at http://drupal.org/node/1078108