Update fails, when using bzr version control, and there is more than one project to update. The reason is because after installing the first project, drush does a bzr status, and sees the uncommitted changes from that first update. It then aborts the rest of the updates, and proceeds to roll back the first one.

klaas@vimex:~/web/drupal-7/sites/example.org$ drush up --debug
Bootstrap to phase 0. [0.01 sec, 2.67 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.02 sec, 2.89 MB] [bootstrap]
Bootstrap to phase 6. [0.03 sec, 6.03 MB]                                                        [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.03 sec, 6.04 MB]                       [bootstrap]
Initialized Drupal 7.0 root directory at /home/klaas/web/drupal-7 [0.05 sec, 7.56 MB]               [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.05 sec, 7.57 MB]                       [bootstrap]
Initialized Drupal site example.org at sites/example.org [0.05 sec, 7.57 MB]            [notice]
Loading drushrc "/home/klaas/web/example/drushrc.php" into "site" scope. [0.05 sec, 7.57   [bootstrap]
MB]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.05 sec, 7.58 MB]              [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.05 sec, 7.6 MB]                    [bootstrap]
Successfully connected to the Drupal database. [0.05 sec, 7.6 MB]                                [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.06 sec, 8.37 MB]                       [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [0.26 sec, 31.28 MB]                     [bootstrap]
Successfully logged into Drupal as Anonymous (uid=0) [0.26 sec, 31.76 MB]                        [bootstrap]
Found command: pm-update (commandfile=pm) [0.26 sec, 31.76 MB]                                   [bootstrap]
Initializing drush commandfile: user [0.26 sec, 31.77 MB]                                        [bootstrap]
Including /home/klaas/web/drush/commands/pm/updatecode.pm.inc [0.26 sec, 31.8 MB]                [bootstrap]
Executing: wget --version
Refreshing update status information ...
Done.
Update information last refreshed: Thu, 13/01/2011 - 18:36

Update status information on all installed and enabled Drupal projects:
 Name                 Installed version  Proposed version  Status                                   
 Localization update  7.x-1.0-alpha2     7.x-1.0-alpha2    Up to date                               
 Libraries API        7.x-1.x-dev        7.x-1.x-dev       Update available                         
 Mollom               7.x-1.x-dev        7.x-1.x-dev       Update available                         
 Pathauto             7.x-1.0-alpha2     7.x-1.0-beta1     Update available                         
 Site verification    7.x-1.0-rc2        7.x-1.0-rc2       Up to date                               
 Token                7.x-1.0-alpha3     7.x-1.0-beta1     Update available                         


Drush was checked out from CVS; cannot self-update. [6.05 sec, 33.89 MB]                            [notice]
Code updates will be made to the following projects: Libraries API [libraries-7.x-1.x-dev], Mollom [mollom-7.x-1.x-dev], Pathauto [pathauto-7.x-1.0-beta1], Token [token-7.x-1.0-beta1]

Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n): y
Starting to update Libraries API code at sites/example.org/modules/libraries... [64.92 sec,   [notice]
33.89 MB]
Verifying signature for svn version control engine. [64.92 sec, 33.92 MB]                            [debug]
Executing: svn info '/home/klaas/web/drupal-7/sites/example.org/modules/libraries'
  svn: '/home/klaas/web/drupal-7/sites/example.org/modules/libraries' is not a working copy
Verifying signature for bzr version control engine. [66.34 sec, 33.91 MB]                            [debug]
Executing: bzr root '/home/klaas/web/drupal-7/sites/example.org/modules/libraries'
  /home/klaas/web/example
Calling chdir(/home/klaas/web/drupal-7/sites/example.org/modules/libraries)
Executing: bzr status --short 
Calling chdir(/home/klaas/web/drupal-7)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/LICENSE.txt)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/libraries.api.php)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/README.txt)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/libraries.drush.inc)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/libraries_test.info)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/libraries_test.inc)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/libraries_test.js)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_1.js)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_2.php)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_1.css)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_info_file.libraries.info)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_3.js)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_4.php)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/README.txt)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_4.js)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_1.php)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_2.js)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_3.php)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_2.css)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_3.css)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/example/example_4.css)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/libraries.test)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/libraries_test.module)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/tests/libraries_test.css)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/CHANGELOG.txt)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/libraries.info)
Calling unlink(/home/klaas/web/drupal-7/sites/example.org/modules/libraries/libraries.module)
Calling chdir(/home/klaas/web/drupal-7/sites/example.org/modules)
Executing: wget -P . 'http://ftp.drupal.org/files/projects/libraries-7.x-1.x-dev.tar.gz'
  --2011-01-13 18:37:28--  http://ftp.drupal.org/files/projects/libraries-7.x-1.x-dev.tar.gz
  Resolving ftp.drupal.org... 64.50.236.52, 64.50.233.100
  Connecting to ftp.drupal.org|64.50.236.52|:80... connected.
  HTTP request sent, awaiting response... 200 OK
  Length: 22053 (22K) [application/x-gzip]
  Saving to: `./libraries-7.x-1.x-dev.tar.gz'
  
       0K .......... .......... .                               100% 37.4K=0.6s
  
  2011-01-13 18:37:29 (37.4 KB/s) - `./libraries-7.x-1.x-dev.tar.gz' saved [22053/22053]
  
Downloading libraries-7.x-1.x-dev.tar.gz was successful. [67.93 sec, 34.05 MB]                      [notice]
Calling md5_file(libraries-7.x-1.x-dev.tar.gz)
Md5 checksum of libraries-7.x-1.x-dev.tar.gz verified. [67.93 sec, 34.05 MB]                        [notice]
Executing: gzip -d 'libraries-7.x-1.x-dev.tar.gz'
Executing: tar -xf 'libraries-7.x-1.x-dev.tar'
Calling unlink(libraries-7.x-1.x-dev.tar)
Calling chdir(/home/klaas/web/drupal-7)
Project libraries was updated successfully. Installed version is now 7.x-1.x-dev.
Starting to update Mollom code at sites/example.org/modules/mollom... [68.09 sec, 34.04 MB]   [notice]
Verifying signature for svn version control engine. [68.09 sec, 34.06 MB]                            [debug]
Executing: svn info '/home/klaas/web/drupal-7/sites/example.org/modules/mollom'
  svn: '/home/klaas/web/drupal-7/sites/example.org/modules/mollom' is not a working copy
Verifying signature for bzr version control engine. [68.13 sec, 34.06 MB]                            [debug]
Executing: bzr root '/home/klaas/web/drupal-7/sites/example.org/modules/mollom'
  /home/klaas/web/example
Calling chdir(/home/klaas/web/drupal-7/sites/example.org/modules/mollom)
Executing: bzr status --short 
   M  modules/libraries/CHANGELOG.txt
   M  modules/libraries/libraries.info
   M  modules/libraries/libraries.module
   M  modules/libraries/tests/libraries_test.info
   M  modules/libraries/tests/example/example_info_file.libraries.info
Calling chdir(/home/klaas/web/drupal-7)
The Bazaar working copy at /home/klaas/web/drupal-7/sites/example.org/modules/mollom       [error]
appears to have uncommitted changes (see below). Please commit or revert these changes before
continuing:
 M  modules/libraries/CHANGELOG.txt
 M  modules/libraries/libraries.info
 M  modules/libraries/libraries.module
 M  modules/libraries/tests/libraries_test.info
 M  modules/libraries/tests/example/example_info_file.libraries.info [68.47 sec, 34.05 MB]
Rolling back update of Libraries API code ... [68.48 sec, 32.49 MB]                                 [notice]
Verifying signature for svn version control engine. [68.48 sec, 32.51 MB]                            [debug]
Executing: svn info 'sites/example.org/modules/libraries'
  svn: 'sites/example.org/modules/libraries' is not a working copy
Verifying signature for bzr version control engine. [68.51 sec, 32.51 MB]                            [debug]
Executing: bzr root 'sites/example.org/modules/libraries'
  /home/klaas/web/example
Executing: bzr revert '/home/klaas/web/drupal-7/sites/example.org/modules/libraries'
   M  modules/libraries/CHANGELOG.txt
   M  modules/libraries/libraries.info
   M  modules/libraries/libraries.module
   M  modules/libraries/tests/example/example_info_file.libraries.info
   M  modules/libraries/tests/libraries_test.info
The Bazaar working copy at /home/klaas/web/drupal-7/sites/example.org/modules/libraries    [error]
appears to have uncommitted changes (see below). Please commit or revert these changes before
continuing:
 M  modules/libraries/CHANGELOG.txt
 M  modules/libraries/libraries.info
 M  modules/libraries/libraries.module
 M  modules/libraries/tests/example/example_info_file.libraries.info
 M  modules/libraries/tests/libraries_test.info [69.1 sec, 32.5 MB]
Changes made in drush_pm_updatecode have been rolled back. [69.1 sec, 32.49 MB]                   [rollback]
Command dispatch complete [69.1 sec, 32.44 MB]                                                      [notice]
 Timer                Cum (sec)  Count  Avg (msec) 
 page                 69.052     1      69052.3    
 drupal_http_request  64.264     6      10710.742  

Peak memory usage was 34.46 MB [69.1 sec, 32.44 MB]                                                 [memory]
klaas@vimex:~/web/drupal-7/sites/example.org$ 

Comments

frjo’s picture

Version: » All-versions-4.x-dev
Status: Active » Needs review
StatusFileSize
new1.04 KB

I believe I found the same problem. I include a patch with the fix I have made for the 4.x branch.

jonhattan’s picture

StatusFileSize
new1.39 KB

@frjo the patch you provide is not correct as it adds a new element to the array and it should also do count($args)+1. Also I think it will fail at some point when updating of drupal core.

Please test attached patch. I have no a proper bzr environment.

moshe weitzman’s picture

Assigned: Unassigned » jonhattan
Status: Needs review » Reviewed & tested by the community

Patch looks OK. Will let jonhattan make fine commit.

jonhattan’s picture

Status: Reviewed & tested by the community » Fixed
jonhattan’s picture

Assigned: jonhattan » msonnabaum
Status: Fixed » Patch (to be ported)
msonnabaum’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

kdebaas’s picture

Version: All-versions-4.x-dev »
Status: Closed (fixed) » Needs work
StatusFileSize
new63.95 KB

Sorry that I didn't have time to check and test this earlier. But I am still having the same issue, with both drush 4.4 and 5.dev. In the attached file is the output of drush up --debug.

greg.1.anderson’s picture

Version: » 8.x-6.x-dev
Status: Needs work » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.