[Bps-public-commit] Prophet branch, master, updated. 1a2702ae97415fb7eec7eee641eb374bc828311e

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Jun 1 04:54:59 EDT 2009


The branch, master has been updated
       via  1a2702ae97415fb7eec7eee641eb374bc828311e (commit)
       via  487b04aa6227285d49fbe5f0c5c5756d66c50ba4 (commit)
      from  e4f226330dfa458f24e67fc2d66c3ac0da96effa (commit)

Summary of changes:
 lib/Prophet/CLI/Command/Clone.pm |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 487b04aa6227285d49fbe5f0c5c5756d66c50ba4
Author: sunnavy <sunnavy at gmail.com>
Date:   Mon Jun 1 16:37:36 2009 +0800

    mirror remote database settings when cloning

diff --git a/lib/Prophet/CLI/Command/Clone.pm b/lib/Prophet/CLI/Command/Clone.pm
index feff57f..f729b64 100644
--- a/lib/Prophet/CLI/Command/Clone.pm
+++ b/lib/Prophet/CLI/Command/Clone.pm
@@ -45,6 +45,17 @@ sub run {
     $self->app_handle->config->set( _sources => { $self->arg('from') => $self->arg('from') });
     $self->app_handle->config->save;
 
+    if ( $source->can('database_settings') ) {
+        my $remote_db_settings = $source->database_settings;
+        my $default_settings   = $self->app_handle->database_settings;
+        for my $name ( keys %$remote_db_settings ) {
+            my $uuid = $default_settings->{$name}[0];
+            die $name unless $uuid;
+            my $s = $self->app_handle->setting( uuid => $uuid );
+            $s->set( $remote_db_settings->{$name} );
+        }
+    }
+
     $self->SUPER::run();
 }
 

commit 1a2702ae97415fb7eec7eee641eb374bc828311e
Merge: 487b04a... e4f2263...
Author: sunnavy <sunnavy at gmail.com>
Date:   Mon Jun 1 16:54:45 2009 +0800

    Merge branch 'master' of code.bestpractical.com:/git/prophet


-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list