--- dbscripts.module 2010-02-24 15:49:17.000000000 -0600 +++ dbscripts_paranoia_patch.module 2010-02-24 16:02:17.000000000 -0600 @@ -14,8 +14,10 @@ function dbscripts_locked($in_locked = N * * @param $options * An array containing various options for the merge. Most contain a configure_file, filter_option, branch_primary, branch_last_merge, branch_production + * @param $paranoid_dump + * Boolean determining whether or not this is a 'paranoid' dump being executed during a restore of the database. $paranoid_dump is TRUE, then the dump will place dump files in $dump_path/paranoid_dump/ */ -function dbscripts_dump($options) { +function dbscripts_dump($options, $paranoid_dump=FALSE) { $options = _dbscripts_get_options($options,'dump'); require($options['configure_file']); extract($options); // any options should override ones set in configure files @@ -34,7 +36,8 @@ function dbscripts_dump($options) { } // Define paths - $dump_location = "$dump_path/$branch_primary"; + $dump_location = ($paranoid_dump) ? "$dump_path/paranoid_dump" : "$dump_path/$branch_primary"; + //If $paranoid_dump = TRUE, we place the dump files in $dump_path/paranoid_dump so we don't override previously dumped files in $branch_primary (see http://drupal.org/node/399798#comment-2642206) $lastmerge_location = "$dump_path/$branch_last_merge"; $temp_branch = "tmp"; $temp_location = "$dump_path/$temp_branch"; @@ -445,7 +448,7 @@ function dbscripts_restore($options) { //create a pre-restore dump based on option from command line or setting in cofiguration file if (($options['paranoia'] || $paranoia ) && !$options['not_paranoid']) { $fake_options[1] = $options['paranoia']? $options['paranoia'] : $paranoia ; - dbscripts_dump($fake_options); + dbscripts_dump($fake_options, TRUE); } // Ensure required files are loaded @@ -1964,7 +1967,7 @@ function _dbscripts_process_tables($bran foreach ($tables_match as $key => $table) { unset($tables[$key]); } - + if ($remove_match) { return $tables; } else {