I am using windows 7 and cygwin. Recently installed Bazaar inside cygwin and use it with it.
Now Drush up is broken.
The directories I am getting the errors in have no bazaar repos or files whatsoever.
Am running the latest drush 5.x version (7.x-5.0-rc4)

Am getting the following error:

Drush was unable to get the bzr status on                                          [error]
c:/wamp/www/undpaul-Domains/undpaul-live/sites/all/modules/contrib/webform.
Check that you have Bazaar 
installed and that this directory is a Bazaar working copy.
The specific errors are below:
bzr: ERROR: exceptions.NotImplementedError: <bound method
GitRevisionTree.filter_unversioned_files of <GitRevisionTree instance at
2cebab0, rev_id='git-v1:f957497652eb2129867a20c6b9a51eca5cc952f2'>>

and further down

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 919, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1124, in run_bzr
  File "bzrlib\commands.pyo", line 672, in run_argv_aliases
  File "bzrlib\commands.pyo", line 694, in run
  File "bzrlib\cleanup.pyo", line 136, in run_simple
  File "bzrlib\cleanup.pyo", line 166, in _do_with_cleanups
  File "bzrlib\commands.pyo", line 1141, in ignore_pipe
  File "bzrlib\builtins.pyo", line 314, in run
  File "bzrlib\status.pyo", line 165, in show_tree_status
  File "bzrlib\status.pyo", line 365, in _filter_nonexistent
  File "bzrlib\tree.pyo", line 576, in filter_unversioned_files
NotImplementedError: <bound method GitRevisionTree.filter_unversioned_files of
<GitRevisionTree instance at 2cebab0,
rev_id='git-v1:f957497652eb2129867a20c6b9a51eca5cc952f2'>>

bzr 2.5b5 on python 2.6.6 (Windows-7-6.1.7600)
arguments: ['bzr', 'status', '--short', '.']
plugins: bzrtools[2.5.0], changelog_merge[2.5b5], colo[0.3.1dev],
    explorer[1.2.1], fastimport[0.12.0dev], git[0.6.6], launchpad[2.5b5],
    loom[2.2.1dev], netrc_credential_store[2.5b5], news_merge[2.5b5],
    pipeline[1.4.0], qbzr[0.22.0dev], rewrite[0.6.3dev], svn[1.1.2],
    upload[1.0.1dev], xmloutput[0.8.8]
encoding: 'cp1252', fsenc: 'mbcs', lang: 'C.UTF-8'

*** Bazaar has encountered an internal error.  This probably indicates a
    bug in Bazaar.  You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

I am unsure if this is an error of Bazaar or of drush, or of both?
Why does Drush even want to get a bzr status, if this is not a bazaar directory?
Have tried to update my cygwin bazaar version, also no luck.

Strange thing is, I have another computer at work with an identical setup, and drush up is not broken there. I might be running an older version of drush 5.x-dev there, but still.

Comments

sreynen’s picture

I'm having this same problem on OSX after installing bzr.

sreynen’s picture

Version: 7.x-5.0-rc4 » 7.x-5.3

I worked around this problem by commenting out the error line in bzr.inc.

eigentor’s picture

Ah, movement in the issue!
@sreynen, please point me to the correct line in bzr.inc.
I may be lazy, but it would help :)

eigentor’s picture

So here is what I found: If you encounter this error, you can circumvent it by outcommenting some code in /commands/pm/version_control/bzr.inc inside the drush folder.
This is at your own risk since the bzr.inc file aims at preventing you to lose changes in a Bazaar Repository that you have made and not yet committed.

I outcommented both occurrences of the else statement that holds the error message you see. I guess the first one would be enough, but it works like this. Here the complete code up to the latest outcommented bit with the outcommented parts:

class drush_version_control_bzr implements drush_version_control {

  /**
   * Implementation of pre_update().
   *
   * Check that the project or drupal core directory looks clean
   */
  public function pre_update(&$project, $items_to_test = array()) {
    // Bazaar needs a list of items to test within the given project.
    // If $items_to_test is empty we need to force it to test the project
    // directory itself --once we've cd'ed to it.
    if (empty($items_to_test)) {
      $items_to_test = array('.' => '.');
    }
    $args = array_keys($items_to_test);
    array_unshift($args, 'bzr status --short' . str_repeat(' %s', count($args)));
    array_unshift($args, $project['full_project_path']);
    if (call_user_func_array('drush_shell_cd_and_exec', $args)) {
      $output = preg_grep('/^[\sRCP][\sNDKM][\s\*]/', drush_shell_exec_output());
      if (!empty($output)) {
        return drush_set_error('DRUSH_PM_BZR_LOCAL_CHANGES', dt("The Bazaar working copy at !path appears to have uncommitted changes (see below). Please commit or revert these changes before continuing:\n!output", array('!path' => $project['full_project_path'], '!output' => implode("\n", $output))));
      }
    }
    // else {
    //   return drush_set_error('DRUSH_PM_BZR_NOT_FOUND', dt("Drush was unable to get the bzr status on !path. Check that you have Bazaar \ninstalled and that this directory is a Bazaar working copy.\nThe specific errors are below:\n!errors", array('!path' => $project['full_project_path'], '!errors' => implode("\n", drush_shell_exec_output()))));
    // }
    return TRUE;
  }

  /**
   * Implementation of rollback().
   */
  public function rollback($project) {
    if (drush_shell_exec('bzr revert %s', $project['full_project_path'])) {
      $output = drush_shell_exec_output();
      if (!empty($output)) {
        return drush_set_error('DRUSH_PM_BZR_LOCAL_CHANGES', dt("The Bazaar working copy at !path appears to have uncommitted changes (see below). Please commit or revert these changes before continuing:\n!output", array('!path' => $project['full_project_path'], '!output' => implode("\n", $output))));
      }
    }
    // else {
    //   return drush_set_error('DRUSH_PM_BZR_NOT_FOUND', dt("Drush was unable to get the Bazaar status on !path. Check that you have Bazaar \ninstalled and that this directory is a Bazaar working copy.\nThe specific errors are below:\n!errors", array('!path' => $project['full_project_path'], '!errors' => implode("\n", drush_shell_exec_output()))));
    // }
  }
jonhattan’s picture

Version: 7.x-5.3 »
Status: Active » Postponed (maintainer needs more info)

Are you using drupal or any module from git? Perhaps you've installed bzr-git extension and this setup don't play nice.

OTOH, to avoid bzr intervention you can force --version-control to a set of working engines. Example:

drush dl token --version-control=backup
drush dl token --version-control=backup,svn

The second example if you're using svn.

alexiswatson’s picture

The issue also seems to present itself when using

drush up drupal

on "path/to/drupal/drupal-7.XX". No bzr-git or anything of the sort. The same workaround posted in #5 suppresses the check:

drush up drupal --version-control=backup

greg.1.anderson’s picture

Version: » 8.x-6.x-dev
Status: Postponed (maintainer needs more info) » 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.

greg.1.anderson’s picture

Issue summary: View changes

updated issue summary