Index: devel.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/devel/devel.module,v
retrieving revision 1.106.4.65
diff -u -r1.106.4.65 devel.module
--- devel.module	21 Oct 2007 01:06:35 -0000	1.106.4.65
+++ devel.module	24 Oct 2007 10:31:29 -0000
@@ -213,8 +213,8 @@
  * Implementation of hook_init(). Avoids custom error handling for better
  * behavior when stepping though in a debugger.
  */
-function devel_init() {    
-  if (strstr($_SERVER['PHP_SELF'], 'update.php') || strstr($_GET['q'], 'autocomplete') || $_GET['q'] == 'upload/js') {
+function devel_init() {
+  if (strstr($_GET['q'], 'autocomplete') || $_GET['q'] == 'upload/js') {
     // update.php relies on standard error handler. avoid breaking a few other pages.
   }
   else {
@@ -465,6 +465,20 @@
 
   $output = '';
 
+  // Surpress query log on intermediate update pages.
+  // On the final update page, pull the saved queries
+  // out of the $_SESSION to display them all.
+  if (strstr($_SERVER['PHP_SELF'], 'update.php')) {
+    if ($_REQUEST['op'] == 'finished') {
+      $GLOBALS['devel_shutdown'] = TRUE;
+      $queries = array_merge($_SESSION['devel_queries'], $queries);
+      unset($_SESSION['devel_queries']);
+    }
+    else {
+      $GLOBALS['devel_shutdown'] = FALSE;
+    }
+  }
+
   // use $GLOBALS['devel_shutdown'] = FALSE in order to supress devel footer for a page. not necessary if your page
   // outputs a text/javascript or text/xml Content-type http header. Thats advised where applicable.
   if ($GLOBALS['devel_shutdown'] !== FALSE) {
@@ -518,21 +532,27 @@
         }
         $output .= '<div class="dev-memory-usage"><h3>'. 'Memory usage:' .'</h3>'. theme('item_list', $list) .'</div>';
       }
-      // TODO: gzip this text if we are sending a gzip page. see drupal_page_header(). 
-    
-    
+      // TODO: gzip this text if we are sending a gzip page. see drupal_page_header().
+
+
       if ($output) {
         print $output;
       }
     }
-  }           
+  }
 
   devel_store_queries();
 }
 
 function devel_store_queries() {
+  global $active_db, $queries;
+
+  // In update.php, store queries to the $_SESSION until the update is complete.
+  if (strstr($_SERVER['PHP_SELF'], 'update.php')) {
+    $_SESSION['devel_queries'] = array_merge((array) $_SESSION['devel_queries'], $queries);
+  }
+
   if (variable_get('devel_store_queries', 0) && rand(1, variable_get('devel_store_random', 1)) == 1) {
-    global $active_db, $queries;
     $qids = array();
     $values = array();
     $fields = array();
