=== modified file 'includes/module.inc'
--- includes/module.inc	2009-07-28 19:06:15 +0000
+++ includes/module.inc	2009-07-31 06:00:47 +0000
@@ -103,6 +103,7 @@ function _module_build_dependencies($fil
   $p_major = '(?P<major>\d+)';
   // By setting the minor version to x, branches can be matched.
   $p_minor = '(?P<minor>\d+|x)';
+  $p_extra = '(?P<extra>-[A-Za-z]+\d+)?';
   foreach ($files as $filename => $file) {
     $graph[$file->name]['edges'] = array();
     if (isset($file->info['dependencies']) && is_array($file->info['dependencies'])) {
@@ -113,17 +114,21 @@ function _module_build_dependencies($fil
         if (isset($parts[1])) {
           $value['original_version'] = ' (' . $parts[1];
           foreach (explode(',', $parts[1]) as $version) {
-            if (preg_match("/^\s*$p_op\s*$p_core$p_major\.$p_minor/", $version, $matches)) {
+            if (preg_match("/^\s*$p_op\s*$p_core$p_major\.$p_minor$p_extra/", $version, $matches)) {
+              // Load defaults.
+              $matches += array('extra' => '');
               $op = !empty($matches['operation']) ? $matches['operation'] : '=';
               if ($matches['minor'] == 'x') {
-                // If a module is newer than 2.x then it's at least 3.0. 
+                // If a module is newer than 2.x then it's at least 
+                // 3.0-unstable0.
                 $matches['minor'] = 0;
+                $matches['extra'] = 'unstable0';
                 if ($op == '>') {
                   $matches['major']++;
                   $op = '>=';
                 }
                 // If a module is older or equivalent than 2.x then it is older
-                // than 3.0.
+                // than 3.0-unstable0.
                 if ($op == '<=') {
                   $matches['major']++;
                   $op = '<';
@@ -135,7 +140,7 @@ function _module_build_dependencies($fil
                 }
               }
               if ($op) {
-                $value['versions'][] = array('op' => $op, 'version' => $matches['major'] . '.' . $matches['minor']);
+                $value['versions'][] = array('op' => $op, 'version' => $matches['major'] . '.' . $matches['minor'] . $matches['extra']);
               }
             }
           }

=== modified file 'modules/simpletest/tests/system_test.module'
--- modules/simpletest/tests/system_test.module	2009-07-28 19:06:15 +0000
+++ modules/simpletest/tests/system_test.module	2009-07-31 06:03:40 +0000
@@ -180,7 +180,7 @@ function system_test_system_info_alter(&
     }
     if ($file->name == 'common_test') {
       $info['hidden'] = FALSE;
-      $info['version'] = '7.x-2.4';
+      $info['version'] = '7.x-2.4-beta3';
     }
   }
 }

=== modified file 'modules/system/system.test'
--- modules/system/system.test	2009-07-30 21:21:37 +0000
+++ modules/system/system.test	2009-07-31 06:12:36 +0000
@@ -218,7 +218,7 @@ class ModuleVersionTestCase extends Modu
    */
   function testModuleVersions() {
     $dependencies = array(
-      // Alternating between being compatible and incompatible with 7.x-2.4.
+      // Alternating between being compatible and incompatible with 7.x-2.4-beta3.
       // The first is always a compatible.
       'common_test',
       // Branch incompatibility.
@@ -236,9 +236,9 @@ class ModuleVersionTestCase extends Modu
       // Nonsense, misses a dash. Incompatible with everything.
       'common_test (=7.x2.x, >=2.4)',
       // Core version is optional. Compatible.
-      'common_test (=7.x-2.x, >=2.4)',
+      'common_test (=7.x-2.x, >=2.4-alpha2)',
       // Test !=, explicitly incompatible.
-      'common_test (=2.x, !=2.4)',
+      'common_test (=2.x, !=2.4-beta3)',
       // Three operations. Compatible.
       'common_test (=2.x, !=2.3, <2.5)',
     );

