I just tried to update a site on my local machine from Drupal 7.14 to 7.15 with "drush up". I use Mercurial (hg) for version control. (I know that most Drupal sites use Git, but we standardized on Hg before we started working with Drupal.)

I was surprised to see that the update process pretty much hollowed out the .hg folder, which is where Mercurial stores all of its information. I got the following warning from drush:

rmdir(C:/Dev/mysite/.hg): Directory not empty filesystem.inc:141

Is there something I need to do to tell drush to please leave that folder alone? I googled this issue and didn't find anything helpful.

[update 08/29/2012] I thought I'd post an update to this, since I still haven't solved the problem. I tried to update a fairly vanilla test Drupal site from 7.14 to 7.15 this morning, and got the same error. Drush failed to update Drupal, and pretty much destroyed the .hg folder in the process. Here's a full dump of the messages from Drush as it did this:

    Code updates will be made to drupal core.
    WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
    Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.

    Do you really want to continue? (y/n): y
    rmdir(C:/Dev/drupal-7-test/.hg): Directory not empty filesystem.inc:141              [warning]
    string(2) "\037ï"
    array(1) {
      [1] =>
    string(2) "\037ï"
    array(1) {
      [1] =>
    Destination directory C:/Dev/drupal-7-test/drupal-7.15 already exists.                 [error]
    Project drupal was updated successfully. Installed version is now 7.15.
    Backups were saved into the directory                                                     [ok]
    Backups were restored successfully.                                                       [ok]
    rmdir(C:/Dev/drupal-7-test/.hg): Directory not empty filesystem.inc:141              [warning]

I'm running Drush 5.5. I'm OK with having to update Drupal manually for now, but it's a weird problem, so I may spend some more time on it, if I can spare the time.

  • Did you ever find a fix to this issue? I have the exact same problem. I'm running Drush 5.8 and upgrading Drupal from 7.20 to 7.21. I get the same warning you got from Drush after running "drush up". After blowing out my local repo and restoring several times, I finally realized what the issue was. For a temporary fix, I made a backup of the .hg folder first before running updates and then restored it back in after. It would be nice if drush just left this folder untouched. Thanks! – Justine Mar 27 '13 at 14:48
  • Justine - No I never did find a fix. I pretty much gave up on using "drush up" due to this issue (and a few others). – Andrew Huey Mar 27 '13 at 15:20
  • What were the other issues you mentioned? – Justine Mar 27 '13 at 19:02
  • Justine - I don't remember the specifics. Just general flakiness. I found that doing the upgrades via plain file copy just worked better. – Andrew Huey Mar 27 '13 at 19:36

wow ... drush up to my knowledge shouldnt touch any (dot) hidden files or directories. Drush up just looks for more recent module packages and updates them, which has nothing todo with .hg or .svn or .git directories.

Are you talking about a global .hg directory for your projects, or like an .hg directory within a module folder somewhere!?

  • It's the .hg folder in the project root. – Andrew Huey Aug 2 '12 at 21:40
  • ya I dunno. I use Hg almost exclusively as well ... I've never had this occur on my sites ... – tenken Aug 3 '12 at 5:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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