Index: pift.cron.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_test/pift.cron.inc,v
retrieving revision 1.42
diff -u -r1.42 pift.cron.inc
--- pift.cron.inc	16 Nov 2009 23:45:08 -0000	1.42
+++ pift.cron.inc	19 Nov 2009 23:12:15 -0000
@@ -245,11 +245,12 @@
  * @param array $branches Branches that must be loaded.
  * @param array $projects List of required projects (pids).
  */
-function pift_cron_queue_batch_build_branches_process(array &$batch, array &$branches, array &$projects) {
+function pift_cron_queue_batch_build_branches_process(array &$batch, array &$branches, array &$projects, $depth = 0) {
   // Relase API version vocabulary.
   $api_vid = _project_release_get_api_vid();
 
   // Include branch data for all dependency branches and those that require review.
+  $branches_implied = array();
   foreach ($branches as $rid => $test) {
     // Load branch release node.
     $branch = node_load($rid);
@@ -282,14 +283,29 @@
     else {
       // Load the Drupal core API release (branch) compatible with this branch.
       $api_release = node_load(pift_core_api_release($api_tid));
-      $item['dependency'] = $api_release->nid;
-      $item['plugin_argument']['modules'] = array(); // TODO Include the list of modules.
+      $item['dependency'] = array($api_release->nid => $api_release->nid);
 
-      // If the core branch has not already been added then add it.
-      if (!isset($branches[$api_release])) {
-        $branches[$api_release->nid] = FALSE;
-        $projects[PIFT_PID] = PIFT_PID;
+      // Cycle through dependencies and add the related branches to the implied
+      // branch list if they are not already being processed.
+      $dependencies = project_info_dependency_list_get($branch->nid);
+      foreach ($dependencies as $dependency) {
+        $item['dependency'][$dependency['rid']] = $dependency['rid'];
       }
+
+      // Check for branches as dependencies that are not in the list of processed branches.
+      foreach ($item['dependency'] as $rid) {
+        // Add branch to implied list for post-processing.
+        if (!isset($branches[$rid])) {
+          $branches_implied[$rid] = FALSE;
+        }
+      }
+
+      // Ensure that not depending on self.
+      unset($item['dependency'][$branch->nid]);
+
+      // Flatten array of dependencies and fill in modules list.
+      $item['dependency'] = implode(',', $item['dependency']);
+      $item['plugin_argument']['modules'] = array_keys(project_info_module_list_get($branch->nid));
     }
 
     // Add item information to the batch.
@@ -298,6 +314,11 @@
     // Add branch's project to list to be laoded.
     $projects[$branch->project_release['pid']] = $branch->project_release['pid'];
   }
+
+  // Post-process any implied branches.
+  if ($branches_implied && $depth == 0) {
+    pift_cron_queue_batch_build_branches_process($batch, $branches_implied, $projects, $depth + 1);
+  }
 }
 
 /**
Index: pift.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_test/pift.info,v
retrieving revision 1.5
diff -u -r1.5 pift.info
--- pift.info	14 Apr 2009 02:29:50 -0000	1.5
+++ pift.info	19 Nov 2009 23:12:15 -0000
@@ -10,6 +10,7 @@
 files[] = pift.project.inc
 files[] = pift.test.inc
 dependencies[] = project
+dependencies[] = project_info
 dependencies[] = project_issue
 dependencies[] = project_release
 dependencies[] = cvs
