Index: rules/rules.export.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rules/rules/Attic/rules.export.inc,v
retrieving revision 1.1.2.11
diff -u -p -r1.1.2.11 rules.export.inc
--- rules/rules.export.inc	5 Aug 2010 14:51:41 -0000	1.1.2.11
+++ rules/rules.export.inc	4 Oct 2010 10:20:00 -0000
@@ -15,8 +15,11 @@
     // Allow item specific adaption before exporting
     foreach ($export[$item_type] as $item_name => $item) {
       rules_item_type_invoke($item_type, 'export', array($item_name, &$export[$item_type][$item_name], &$export, $module));
+      ksort($export[$item_type]);
     }
   }
+  // Sort the elements to avoid problems DIFFing the output between exports.
+  ksort($export);
   return $export;
 }
 
@@ -37,6 +40,10 @@
     $rule_set['categories'][$module] = $module;
     $rule_set['status'] = 'default';
   }
+  // Sort the elements to avoid problems DIFFing the output between exports.
+  if (!empty($rule_set)) {
+    ksort($rule_set);
+  }
 }
 
 
@@ -64,6 +71,19 @@
     // they aren't saved yet.
     $counter++;
 
+    // Sort the elements to avoid problems DIFFing the output between exports.
+    ksort($rule);
+    foreach($rule['#actions'] as $action_index => $action) {
+      ksort($rule['#actions'][$action_index]);
+      ksort($rule['#actions'][$action_index]['#info']);
+      ksort($rule['#actions'][$action_index]['#settings']);
+    }
+    foreach($rule['#conditions'] as $condition_index => $condition) {
+      ksort($rule['#conditions'][$condition_index]);
+      ksort($rule['#conditions'][$condition_index]['#info']);
+      ksort($rule['#conditions'][$condition_index]['#settings']);
+    }
+    
     if (strpos($rule_name, $module) !== 0) {
       // Make sure the name isn't already taken.
       $rules = rules_get_configured_items('rules');
Index: rules/rules.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rules/rules/Attic/rules.module,v
retrieving revision 1.1.2.74
diff -u -p -r1.1.2.74 rules.module
--- rules/rules.module	10 Aug 2010 08:28:00 -0000	1.1.2.74
+++ rules/rules.module	4 Oct 2010 10:20:00 -0000
@@ -1097,3 +1097,24 @@
   }
   return $rule;
 }
+
+/**
+ * Implementation of hook_default_variables().
+ */
+function rules_default_variables() {
+  // Variables provided by this module.
+  $variables = array(
+    // A nicer name for this module's display.
+    '#title' => 'Rules',
+
+    'rules_clean_path',
+    'rules_counter',
+    'rules_debug',
+    'rules_forms_events',
+    'rules_hide_token_message',
+    'rules_inactive_sets',
+    'rules_shows_fixed',
+  );
+  
+  return $variables;
+}
