Index: modules/node/node.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.install,v
retrieving revision 1.40
diff -u -r1.40 node.install
--- modules/node/node.install	14 Jan 2010 02:29:37 -0000	1.40
+++ modules/node/node.install	16 Jan 2010 00:06:23 -0000
@@ -473,15 +473,16 @@
     $found = FALSE;
     if ($context['total']) {
       // Operate on every revision of every node (whee!), in batches.
-      $batch_size = 50;
-      $query = db_select('node', 'n');
-      $nr = $query->innerJoin('node_revision', 'nr', 'n.vid = nr.vid');
-      $revisions = $query
+      $batch_size = 200;
+      $query = db_select('node_revision', 'nr');
+      $query->innerJoin('node', 'n', 'n.vid = nr.vid');
+      $query
+        ->fields('nr', array('body', 'teaser', 'format'))
         ->fields('n', array('type', 'status', 'comment', 'promote', 'sticky'))
-        ->fields($nr)
         ->condition('nr.vid', $context['last'], '>')
         ->orderBy('nr.vid', 'ASC')
-        ->execute();
+        ->range(0, $batch_size);
+      $revisions = $query->execute();
 
       // Load each reversion of each node, set up 'body'
       // appropriately, and save the node's field data.  Note that
@@ -532,10 +533,6 @@
 
         $context['last'] = $revision->vid;
         $context['count'] += 1;
-
-        if (--$batch_size == 0) {
-          break;
-        }
       }
 
       $context['#finished'] = min(0.99, $context['count'] / $context['total']);
