8

Right, this has been breaking me for two days. I can't get an answer anywhere!

I have drush 4.4 on my server. I am using SVN via Unfuddle.com. I have a site, I want to update a lot of modules. I want to update just the code, then check it's working (DB updates are not a concern at this point) then commit the relevant code.

It used to be that drush dl would simply download the module code over the top of the old module, without removing it. That is no longer the case. Now, AFAICT, drush removes the module directory and replaces it with the newer version. That's all well and good, because it solves the problem of old files that are no longer in the updated module being left behind.

However, using the drush dl or upc commands, I am stuck, because running these commands does indeed get the newer version, but it destroys the SVN data folder in the process, leaving me with "! module/file.php" problems everywhere for files that aren't there any more.

I have been advised that "drush upc/dl modulename --version-control=svn" should work, but it doesn't. The SVN data is still destroyed.

This leaves me with the potential nightmare of having to: svn del module, svn commit -m"Removed module", drush dl module, (test the module), svn add module, svn commit -m"Added module" - for every single module, which is a total horror.

I do not want to set up drush to auto-commit my changes, I just want to download them and commit them all manually at the end when I'm happy with the changes. This can't be that hard, but I simply cannot get it to work.

I have also been advised that moving to git (yes, I'm aware unfuddle supports git!) is also a solution, but it's not an immediate one, and is not satisfactory at this point in time.

Can anyone please shed some light on this?!

  • Might be easier to learn git. – chrisjlee May 25 '11 at 17:00
6

because running these commands does indeed get the newer version, but it destroys the SVN data folder in the process, leaving me with "! module/file.php"

I'm running Drush 4.4 and this does not appear to be the case for me. Running drush upc or drush up keeps your .svn directories intact. You can svn status to review the changes to the modules. New files are indicated by ? and removed files are indicated by !.

Test your site's functionality. Once you are satisfied that the modules are still working correctly, you can then svn add/remove with a snippet such as the following:

add:

svn status | grep '^\?' | cut -c8- | while read f; do svn add "$f"; done

remove:

svn status | grep '^\!' | cut -c8- | while read f; do svn rm "$f"; done
  • Perhaps "destroys svn data" was an error on my part - previously, I didn't see any ! but just ?, which I duly svn added. This is perhaps a point of ignorance on my part. I suppose it was expectation of the ease of the previous manner in which I worked, which was (due to something now fixed in drush) actually erroneous. – NikLP May 18 '11 at 18:41
4

You should add --svnsync to your command.

Example :

 drush pm-update module_to_update --version-control=svn --svnsync 

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.