Could someone look at this bug please ? Privatemsg and Privatemsg Views are separate projects yet I see the following:
http://drupal.org/project/cvs/735184
Also Berdir is listed as committer of Privatemsg Views while he's not. http://drupal.org/node/735184/committers

Comments

damien tournoud’s picture

Project: Drupal.org infrastructure » CVS integration
Version: » 6.x-1.x-dev
Component: CVS » Code
Category: support » bug

Looks like a bug in the CVS module.

damien tournoud’s picture

http://drupal.org/cvs?commit=295734 is very interesting:

Privatemsg: /modules/privatemsg/translations/privatemsg.pot 1.3
Privatemsg: /modules/privatemsg/translations/ru.po 1.2
Privatemsg Views: /modules/privatemsg/views/privatemsg.views.inc 1.2
Privatemsg Views: /modules/privatemsg/views/views_handler_field_privatemsg_link.inc 1.2

For some reason, /modules/privatemsg/views/ is matched to Privatemsg Views.

damien tournoud’s picture

Ok, it seems that xcvs-loginfo.php doesn't use the same technique to determine the project a file belong to as xcvs-taginfo.php, for some (probably historical) reasons.

Correct way (from xcvs_db_get_drupal_project_nid()):

    while (count($parts) > 1) {
      $project_dir = '/'. implode('/', $parts) . '/';
      array_pop($parts);
      $project = mysql_query("SELECT n.nid FROM cvs_projects cp INNER JOIN node n ON n.nid = cp.nid WHERE n.status = 1 AND cp.rid = ". $xcvs[cvs_repo_id] ." AND cp.directory = '". mysql_real_escape_string($project_dir) ."'");
      if ($project && mysql_num_rows($project) > 0) {
        return $nids[$file] = mysql_result($project, 0);
      }
    }

Bad way (from xcvs_init() in xcvs-loginfo.php):

          $project = mysql_query("SELECT nid FROM cvs_projects WHERE rid = ". $xcvs[cvs_repo_id] ." AND '". mysql_real_escape_string($cvslog_file->file) ."' LIKE CONCAT(directory, '%')");
damien tournoud’s picture

The LIKE operator has two wildcards: '%', which matches any number of characters and '_', which matches exactly one character. As a consequence:

> SELECT '/a/b/' LIKE '/a_b/%';
1
dww’s picture

Status: Active » Closed (duplicate)