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

spang at bestpractical.com spang at bestpractical.com
Wed Aug 12 05:28:52 EDT 2009


The branch, master has been updated
       via  fa5eaa4a64739638fb8aa61f0867434f7ca004c4 (commit)
       via  43236e55304938dea2117278c11600fe329a65fe (commit)
       via  098433fad15a07fa00da0c2fbaf3241e2f246699 (commit)
       via  165807df7faf690d9409d17d76a82f74c79daac7 (commit)
       via  7b8438c0348159daea7d81328e2ca1247926f038 (commit)
      from  50a4ff823c7c1761905e4a44d9f5b4533d0d366f (commit)

Summary of changes:
 MANIFEST                                |    4 ++
 Makefile.PL                             |    1 -
 lib/Prophet/CLI/Command/Clone.pm        |    3 +-
 lib/Prophet/Test.pm                     |    7 +++
 lib/Prophet/UUIDGenerator.pm            |   30 ++++++------
 t/Settings/lib/App/Settings/Test.pm     |    1 +
 t/Settings/t/database-settings-editor.t |   78 ++++++++++++++++---------------
 t/aliases.t                             |   38 ++++++++--------
 t/data/settings-first.tmpl              |    2 -
 t/data/settings-second.tmpl             |    2 -
 t/data/settings-third.tmpl              |    2 -
 t/malformed-url.t                       |   26 ++++------
 t/publish-pull.t                        |   33 ++++---------
 t/scripts/aliases-editor.pl             |   23 ---------
 t/scripts/settings-editor.pl            |   51 --------------------
 15 files changed, 108 insertions(+), 193 deletions(-)
 delete mode 100755 t/scripts/aliases-editor.pl
 delete mode 100755 t/scripts/settings-editor.pl

- Log -----------------------------------------------------------------
commit 7b8438c0348159daea7d81328e2ca1247926f038
Author: Christine Spang <spang at bestpractical.com>
Date:   Tue Aug 11 17:41:16 2009 +0100

    Make Prophet::Test::as_$user set $ENV{PROPHET_APP_CONFIG}

diff --git a/lib/Prophet/Test.pm b/lib/Prophet/Test.pm
index 2d797c8..5e4c81e 100644
--- a/lib/Prophet/Test.pm
+++ b/lib/Prophet/Test.pm
@@ -131,6 +131,12 @@ sub repo_path_for {
     return File::Spec->catdir($REPO_BASE => $username);
 }
 
+sub config_file_for {
+    my $username = shift;
+
+    return File::Spec->catdir($REPO_BASE, $username, 'config');
+}
+
 =head2 repo_uri_for($username)
 
 Returns a file:// URI for $USERNAME'S replica (with the correct replica
@@ -199,6 +205,7 @@ sub as_user {
     my $coderef  = shift;
     local $ENV{'PROPHET_REPO'} = repo_path_for($username);
     local $ENV{'PROPHET_EMAIL'}        = $username . '@example.com';
+    local $ENV{'PROPHET_APP_CONFIG'} = config_file_for($username);
 
     my $ret = $coderef->();
 
diff --git a/t/publish-pull.t b/t/publish-pull.t
index 734c40f..dace3b4 100644
--- a/t/publish-pull.t
+++ b/t/publish-pull.t
@@ -10,22 +10,16 @@ my ($bug_uuid, $pullall_uuid);
 
 my $alice_published = tempdir(CLEANUP => ! $ENV{PROPHET_DEBUG});
 
-(undef, my $alice_config) = tempfile( CLEANUP => ! $ENV{PROPHET_DEBUG} );
-(undef, my $bob_config) = tempfile( CLEANUP => ! $ENV{PROPHET_DEBUG} );
-diag "Alice's config file is located at $alice_config";
-diag "Bob's config file is located at $bob_config";
-
 as_alice {
-    $ENV{PROPHET_APP_CONFIG} = $alice_config;
     ok( run_command( qw(init) ), 'replica init' );
 
     # check that new config section has been created with uuid variable
     my $config_contents = Prophet::Util->slurp($ENV{PROPHET_APP_CONFIG});
-    like($config_contents, qr/
-\[core\]
+    my $replica_uuid = replica_uuid();
+    like($config_contents, qr/\[core\]
 	config-format-version = \d+
 \[replica ".*?"\]
-	uuid = $Prophet::CLIContext::ID_REGEX
+	uuid = \Q$replica_uuid\E
 /, 'replica section created in config file after init');
 
     my $output
@@ -44,11 +38,10 @@ as_alice {
 
     # check that publish-url config key has been created correctly
     $config_contents = Prophet::Util->slurp($ENV{PROPHET_APP_CONFIG});
-    like($config_contents, qr/
-\[core\]
+    like($config_contents, qr/\[core\]
 	config-format-version = \d+
 \[replica "(.*?)"\]
-	uuid = $Prophet::CLIContext::ID_REGEX
+	uuid = \Q$replica_uuid\E
 	publish-url = \Q$alice_published\E
 /, 'publish-url variable created correctly in config');
     my ($replica_name) = ($config_contents =~ /\[replica "(.*?)"\]/);
@@ -69,11 +62,10 @@ as_alice {
     # make sure the subsection name was changed and the publish-url
     # was updated, rather than a new section being created
     $config_contents = Prophet::Util->slurp($ENV{PROPHET_APP_CONFIG});
-    like($config_contents, qr/
-\[core\]
+    like($config_contents, qr/\[core\]
 	config-format-version = \d+
 \[replica "alice"\]
-	uuid = $Prophet::CLIContext::ID_REGEX
+	uuid = \Q$replica_uuid\E
 	publish-url = \Q$new_published\E
 /, 'publish-url variable changed correctly in config');
 
@@ -102,17 +94,16 @@ EOF
 my $path = $alice_published;
 
 as_bob {
-    $ENV{PROPHET_APP_CONFIG} = $bob_config;
     ok( run_command( 'clone', '--from', "file://$path" ),
         'clone as bob',
     );
     my $config_contents = Prophet::Util->slurp($ENV{PROPHET_APP_CONFIG});
-    like($config_contents, qr|
-\[core\]
+    my $replica_uuid = replica_uuid();
+    like($config_contents, qr|\[core\]
 	config-format-version = \d+
 \[replica "file://\Q$path\E"\]
 	url = file://\Q$path\E
-	uuid = $Prophet::CLIContext::ID_REGEX
+	uuid = \Q$replica_uuid\E
 |, 'replica section created in config file after clone');
 
     my $output = run_command( qw(search --type Bug --regex .));
@@ -121,7 +112,6 @@ as_bob {
 };
 
 as_alice {
-    $ENV{PROPHET_APP_CONFIG} = $alice_config;
     my $output
         = run_command( qw(create --type Pullall -- --status new --from alice ));
     my $expected = qr/Created Pullall \d+ \((\S+)\)(?{ $pullall_uuid = $1 })/;
@@ -134,8 +124,6 @@ as_alice {
 };
 
 as_bob {
-    $ENV{PROPHET_APP_CONFIG} = $bob_config;
-
     # change name in config
     my $config_contents = Prophet::Util->slurp($ENV{PROPHET_APP_CONFIG});
     my ($replica_name) = ( $config_contents =~ /\[replica "(.*?)"\]/ );
@@ -171,7 +159,6 @@ as_bob {
 
 
 as_charlie {
-    (undef, $ENV{PROPHET_APP_CONFIG}) = tempfile( CLEANUP => ! $ENV{PROPHET_DEBUG} );
     ok( run_command( 'clone', '--from', "file://$path" ),
         'clone as charlie',
     );

commit 165807df7faf690d9409d17d76a82f74c79daac7
Author: Christine Spang <spang at bestpractical.com>
Date:   Wed Aug 12 10:03:27 2009 +0100

    Bad Prophet, don't call exit.

diff --git a/lib/Prophet/CLI/Command/Clone.pm b/lib/Prophet/CLI/Command/Clone.pm
index 3258775..9e27331 100644
--- a/lib/Prophet/CLI/Command/Clone.pm
+++ b/lib/Prophet/CLI/Command/Clone.pm
@@ -48,8 +48,7 @@ sub run {
     }
 
     unless ($source->replica_exists) {
-        print "The source replica '@{[$source->url]}' doesn't exist or is unreadable.";
-        exit 1;
+        die "The source replica '@{[$source->url]}' doesn't exist or is unreadable.\n";
     }
 
     $target->initialize(%init_args);

commit 098433fad15a07fa00da0c2fbaf3241e2f246699
Author: Christine Spang <spang at bestpractical.com>
Date:   Wed Aug 12 10:04:46 2009 +0100

    Finish ripping Test::Script::Run out of Prophet tests and drop the dep.

diff --git a/Makefile.PL b/Makefile.PL
index d82f6a7..f318aa2 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -24,7 +24,6 @@ requires('Config::GitLike' => '1.0');
 requires('MIME::Base64::URLSafe');
 
 build_requires( 'Test::Exception' => '0.26' );
-build_requires( 'Test::Script::Run' => '0.02' );
 
 use Term::ReadLine;                          # if we don't do this, ::Perl fails
 feature 'Improved interactive shell' => -default => 1,
diff --git a/t/Settings/lib/App/Settings/Test.pm b/t/Settings/lib/App/Settings/Test.pm
index d221bd8..66ae7d6 100644
--- a/t/Settings/lib/App/Settings/Test.pm
+++ b/t/Settings/lib/App/Settings/Test.pm
@@ -1,4 +1,5 @@
 package App::Settings::Test;
+use Prophet::Util;
 use warnings;
 use strict;
 
diff --git a/t/Settings/t/database-settings-editor.t b/t/Settings/t/database-settings-editor.t
index ccd7896..acedaa1 100644
--- a/t/Settings/t/database-settings-editor.t
+++ b/t/Settings/t/database-settings-editor.t
@@ -7,7 +7,6 @@ use lib 't/Settings/lib';
 use App::Settings::Test tests => 9;
 use Prophet::Util;
 use File::Spec;
-use Test::Script::Run;
 no warnings 'once';
 
 # test the CLI and interactive UIs for showing and updating settings
@@ -34,62 +33,67 @@ is( $out, $expected, "settings set went ok" );
 my $valid_settings_output = Prophet::Util->slurp('t/data/settings-first.tmpl');
 
 $out = run_command( qw/settings/ );
-is( $out, $valid_settings_output, "changed settings output matches" );
+like( $out, qr/\Q$valid_settings_output\E/, "changed settings output matches" );
 
 # test settings (interactive editing)
 
-my $filename = File::Temp->new(
-    TEMPLATE => File::Spec->catfile(File::Spec->tmpdir(), '/statusXXXXX') )->filename;
-diag ("interactive template status will be found in $filename");
+my $template;
+
 # first set the editor to an editor script
-Prophet::Test->set_editor_script("settings-editor.pl --first $filename");
+Prophet::Test::set_editor( sub {
+    my $content = shift;
+
+    $template = $content;
+
+    $content =~ s/(?<=^default_status: \[")new(?="\])/open/m; # valid json change
+    $content =~ s/^default_milestone(?=: \["alpha"\])$/invalid_setting/m; # changes setting name
+    $content =~ s/(?<=uuid: 6)C(?=BD84A1)/F/m; # changes a UUID to an invalid one
+    $content =~ s/^project_name//m; # deletes setting
+
+    return $content;
+} );
 
 # then edit the settings
 # (can't use run_command with editor scripts because they don't play nicely
 # with output redirection)
-run_output_matches( 'settings', [ 'settings', 'edit' ],
-    [
-        'Changed default_status from ["new"] to ["open"].',
-        'Setting with uuid "6FBD84A1-4568-48E7-B90C-F1A5B7BD8ECD" does not exist.',
-    ], [], "interactive settings set went ok",);
-
+$out = run_command( 'settings', 'edit' );
+is( $out, <<'END_OUTPUT', 'interactive settings edit' );
+Changed default_status from ["new"] to ["open"].
+Setting with uuid "6FBD84A1-4568-48E7-B90C-F1A5B7BD8ECD" does not exist.
+END_OUTPUT
 
-# check the tempfile to see if the template presented to the editor was correct
-chomp(my $template_ok = Prophet::Util->slurp($filename));
-is($template_ok, 'ok!', "interactive template was correct");
+my $valid_template = Prophet::Util->slurp('t/data/settings-first.tmpl');
+like( $template, qr/\Q$valid_template\E/,
+        'interactive template was correct' );
 
 # check the settings with settings --show
 $valid_settings_output = Prophet::Util->slurp('t/data/settings-second.tmpl');
 
-# look up db uuid and clear the prop cache, since we've modified the
-# on-disk props via another process
-my ($replica_uuid) = replica_uuid();
-Prophet::Replica::sqlite::clear_prop_cache( $replica_uuid );
-
 $out = run_command( qw/settings show/ );
-is( $out, $valid_settings_output, "changed settings output matches" );
+like( $out, qr/\Q$valid_settings_output\E/, "changed settings output matches" );
 
 # test setting to invalid json
-my $second_filename = File::Temp->new(
-    TEMPLATE => File::Spec->catfile(File::Spec->tmpdir(), '/statusXXXXX') )->filename;
-diag ("interactive template status will be found in $second_filename");
-Prophet::Test->set_editor_script("settings-editor.pl --second $second_filename");
-run_output_matches( 'settings', [ 'settings', 'edit' ],
-    [
-        qr/^An error occured setting default_milestone to \["alpha":/,
-        'Changed default_component from ["core"] to ["ui"].',
-    ], [], "interactive settings set with JSON error went ok",
-);
+Prophet::Test::set_editor( sub {
+    my $content = shift;
+
+    $template = $content;
+
+    $content =~ s/(?<=^default_component: \[")core(?="\])/ui/m; # valid json change
+    $content =~ s/(?<=^default_milestone: \["alpha")]$//m; # invalid json
+
+    return $content;
+} );
 
-Prophet::Replica::sqlite::clear_prop_cache( $replica_uuid );
+$out = run_command( 'settings', 'edit' );
+like( $out, qr/^An error occured setting default_milestone to \["alpha":.*?
+Changed default_component from \["core"\] to \["ui"\]./m,
+    'interactive settings edit with JSON error' );
 
-# check the tempfile to see if the template presented to the editor was correct
-chomp($template_ok = Prophet::Util->slurp($filename));
-is($template_ok, 'ok!', "interactive template was correct");
+$valid_template = Prophet::Util->slurp('t/data/settings-second.tmpl');
+like( $template, qr/\Q$valid_template\E/, 'interactive template was correct');
 
 # check the settings with settings show
 $valid_settings_output = Prophet::Util->slurp('t/data/settings-third.tmpl');
 
-# run_command( 'settings' );
 $out = run_command( qw/settings show/ );
-is( $out, $valid_settings_output, 'changed settings output matches' );
+like( $out, qr/\Q$valid_settings_output\E/, 'changed settings output matches' );
diff --git a/t/aliases.t b/t/aliases.t
index b11429c..c99a475 100644
--- a/t/aliases.t
+++ b/t/aliases.t
@@ -4,7 +4,6 @@ use warnings;
 use strict;
 use Prophet::Test tests => 68;
 use File::Temp qw/tempfile/;
-use Test::Script::Run;
 
 ( my $_fh, $ENV{'PROPHET_APP_CONFIG'} ) = tempfile(UNLINK => !$ENV{PROPHET_DEBUG});
 close $_fh; # or windows will cry :/
@@ -196,9 +195,7 @@ is_deeply(
 );
 
 # check content in config
-my $content;
-open my $fh, '<', $ENV{'PROPHET_APP_CONFIG'} or die "failed to open $ENV{'PROPHET_APP_CONFIG'}: $!";
-{ local $/; $content = <$fh>; }
+my $content = Prophet::Util->slurp($ENV{PROPHET_APP_CONFIG});
 is( $content, <<EOF, 'content in config' );
 
 [core]
@@ -211,21 +208,24 @@ is( $content, <<EOF, 'content in config' );
 	pull --from http://www.example.com/ = pfe
 EOF
 
-# tests for interactive alias editing
-my $filename = File::Temp->new(
-    TEMPLATE => File::Spec->catfile(File::Spec->tmpdir(), '/statusXXXXX') )->filename;
-diag ("interactive template status will be found in $filename");
-Prophet::Test->set_editor_script("aliases-editor.pl --first $filename");
-
-# can't run this with run_command because STDOUT redirection will
-# screw up piping to the script
-run_output_matches( 'prophet', [ 'aliases', 'edit' ],
-    [
-        "Added alias 'something different' = 'pull --local'",
-        "Changed alias 'foo' from 'bar baz'to 'sigh'",
-        "Deleted alias 'pull -l'",
-    ], [], 'aliases edit went ok',
-);
+my $template;
+Prophet::Test::set_editor( sub {
+    my $content = shift;
+
+    $template = $content;
+
+    $content =~ s/^pull -l/something different/m; # both an add and a delete
+    $content =~ s/(?<=foo = )bar baz/sigh/m; # just change a value
+
+    return $content;
+} );
+
+my $output = run_command( 'aliases', 'edit' );
+is( $output, <<'END_OUTPUT', 'aliases edit' );
+Added alias 'something different' = 'pull --local'
+Changed alias 'foo' from 'bar baz'to 'sigh'
+Deleted alias 'pull -l'
+END_OUTPUT
 
 # check with alias show
 my $valid_settings_output = Prophet::Util->slurp('t/data/aliases.tmpl');
diff --git a/t/data/settings-first.tmpl b/t/data/settings-first.tmpl
index 57cc516..1429cd0 100644
--- a/t/data/settings-first.tmpl
+++ b/t/data/settings-first.tmpl
@@ -15,5 +15,3 @@ default_status: ["new"]
 
 # uuid: 24183C4D-EFD0-4B16-A207-ED7598E875E6
 statuses: ["new","open","stalled"]
-
-
diff --git a/t/data/settings-second.tmpl b/t/data/settings-second.tmpl
index 1cc5abc..1a01edc 100644
--- a/t/data/settings-second.tmpl
+++ b/t/data/settings-second.tmpl
@@ -15,5 +15,3 @@ default_status: ["open"]
 
 # uuid: 24183C4D-EFD0-4B16-A207-ED7598E875E6
 statuses: ["new","open","stalled"]
-
-
diff --git a/t/data/settings-third.tmpl b/t/data/settings-third.tmpl
index 74dd857..b1b5ea4 100644
--- a/t/data/settings-third.tmpl
+++ b/t/data/settings-third.tmpl
@@ -15,5 +15,3 @@ default_status: ["open"]
 
 # uuid: 24183C4D-EFD0-4B16-A207-ED7598E875E6
 statuses: ["new","open","stalled"]
-
-
diff --git a/t/malformed-url.t b/t/malformed-url.t
index 212b729..a54b295 100644
--- a/t/malformed-url.t
+++ b/t/malformed-url.t
@@ -1,15 +1,14 @@
 use warnings;
 use strict;
 
-use Test::More tests => 5;
+use Prophet::Test tests => 5;
 use File::Temp qw(tempdir);
-use Test::Script::Run qw(run_script);
 
 $ENV{'PROPHET_REPO'} = tempdir( CLEANUP => ! $ENV{PROPHET_DEBUG}  ) . '/repo-' . $$;
 
 # try to make prophet clone explode by feeding it bogus URLs
 
-(undef, undef, my $error) = run_script( 'prophet', ['clone', '--from', 'malformed-url'] );
+(undef, my $error) = run_command( 'clone', '--from', 'malformed-url' );
 is( $error, <<EOM
 I don't know how to handle the replica URL you provided - 'malformed-url'.
 Is your syntax correct?
@@ -17,8 +16,7 @@ EOM
 , 'malformed url errors out' );
 
 $ENV{'PROPHET_REPO'} = tempdir( CLEANUP => ! $ENV{PROPHET_DEBUG}  ) . '/repo-' . $$;
-(undef, undef, $error)
-    = run_script( 'prophet', ['clone', '--from', 'sqlite:foo'] );
+(undef, $error) = run_command( 'clone', '--from', 'sqlite:foo' );
 is( $error, <<EOM
 I couldn't determine a filesystem root from the given URL.
 Correct syntax is (sqlite:)file:///replica/root .
@@ -26,8 +24,7 @@ EOM
 , 'sqlite:foo errors out' );
 
 $ENV{'PROPHET_REPO'} = tempdir( CLEANUP => ! $ENV{PROPHET_DEBUG}  ) . '/repo-' . $$;
-(undef, undef, $error)
-    = run_script( 'prophet', ['clone', '--from', 'sqlite://file://foo'] );
+(undef, $error) = run_command( 'clone', '--from', 'sqlite://file://foo' );
 is( $error, <<EOM
 I couldn't determine a filesystem root from the given URL.
 Correct syntax is (sqlite:)file:///replica/root .
@@ -35,9 +32,8 @@ EOM
 , 'sqlite://file://foo errors out' );
 
 $ENV{'PROPHET_REPO'} = tempdir( CLEANUP => ! $ENV{PROPHET_DEBUG}  ) . '/repo-' . $$;
-(undef, undef, $error)
-    = run_script( 'prophet',
-        ['clone', '--from', 'sqlite:http://www.example.com/sd'] );
+(undef, $error)
+    = run_command( 'clone', '--from', 'sqlite:http://www.example.com/sd' );
 is( $error, <<EOM
 I couldn't determine a filesystem root from the given URL.
 Correct syntax is (sqlite:)file:///replica/root .
@@ -45,13 +41,11 @@ EOM
 , 'SQLite replicas can\'t be via http' );
 
 $ENV{'PROPHET_REPO'} = tempdir( CLEANUP => ! $ENV{PROPHET_DEBUG}  ) . '/repo-' . $$;
-(undef, my $out, undef)
-    = run_script( 'prophet',
-        ['clone', '--from',
-        'prophet:http://web.mit.edu/spang/Public/tmp/bogus-sd'] );
+(undef, $error) = run_command( 'clone',
+        '--from', 'prophet:http://web.mit.edu/spang/Public/tmp/bogus-sd' );
 # Don't test fetch errors because the user running these tests may or may not
 # have network, so they won't always be the same.
-is( $out,
-    "The source replica 'http://web.mit.edu/spang/Public/tmp/bogus-sd' doesn't exist or is unreadable.",
+like( $error,
+    qr|The source replica 'http://web.mit.edu/spang/Public/tmp/bogus-sd' doesn't exist or is unreadable.|,
     'prophet replicas *can* be via http',
 );
diff --git a/t/scripts/aliases-editor.pl b/t/scripts/aliases-editor.pl
deleted file mode 100755
index d75719b..0000000
--- a/t/scripts/aliases-editor.pl
+++ /dev/null
@@ -1,23 +0,0 @@
-#!perl -i
-use strict;
-use warnings;
-use Prophet::Test::Editor;
-
-# perl script to trick Proc::InvokeEditor with for the settings command
-
-my %tmpl_files = ( '--first' => 'aliases.tmpl' );
-
-Prophet::Test::Editor::edit(
-    tmpl_files => \%tmpl_files,
-    edit_callback => sub {
-        my %args = @_;
-        my $option = $args{option};
-
-        if ($option eq '--first') {
-            s/^pull -l/something different/; # both an add and a delete
-            s/(?<=foo = )bar baz/sigh/; # just change a value
-        }
-        print;
-    },
-    verify_callback => sub { },
-);
diff --git a/t/scripts/settings-editor.pl b/t/scripts/settings-editor.pl
deleted file mode 100755
index ca5bd27..0000000
--- a/t/scripts/settings-editor.pl
+++ /dev/null
@@ -1,51 +0,0 @@
-#!perl -i
-use strict;
-use warnings;
-use Prophet::Test::Editor;
-
-# perl script to trick Proc::InvokeEditor with for the settings command
-
-my %tmpl_files = ( '--first' => 'settings-first.tmpl',
-                   '--second' => 'settings-second.tmpl',
-);
-
-Prophet::Test::Editor::edit(
-    tmpl_files => \%tmpl_files,
-    edit_callback => sub {
-        my %args = @_;
-        my $option = $args{option};
-
-        if ($option eq '--first') {
-            s/(?<=^default_status: \[")new(?="\])/open/; # valid json change
-            s/^default_milestone(?=: \["alpha"\])$/invalid_setting/; # changes setting name
-            s/(?<=uuid: 6)C(?=BD84A1)/F/; # changes a UUID to an invalid one
-            s/^project_name//; # deletes setting
-        } elsif ($option eq '--second') {
-            s/(?<=^default_component: \[")core(?="\])/ui/; # valid json change
-            s/(?<=^default_milestone: \["alpha")]$//; # invalid json
-        }
-        print;
-    },
-    verify_callback => sub {
-        my %args = @_;
-
-        my $ok = 1;
-
-        my %seen;     # lookup table
-        my @vonly;    # answer
-
-        # build lookup table
-        @seen{@{$args{template}}} = ( );
-
-        for my $line (@{$args{valid_template}}) {
-            push(@vonly, $line) unless exists $seen{$line};
-        }
-
-        # if anything is only in the valid template, we don't match
-        $ok = 0 if scalar @vonly;
-
-        open STATUSFILE, '>', $args{status_file};
-        $ok ? print STATUSFILE "ok!" : print STATUSFILE "not ok!";
-        close STATUSFILE;
-    }
-);

commit 43236e55304938dea2117278c11600fe329a65fe
Author: Christine Spang <spang at bestpractical.com>
Date:   Wed Aug 12 10:27:36 2009 +0100

    Don't mix tabs and spaces :(

diff --git a/lib/Prophet/UUIDGenerator.pm b/lib/Prophet/UUIDGenerator.pm
index 4c03d63..4cf16eb 100644
--- a/lib/Prophet/UUIDGenerator.pm
+++ b/lib/Prophet/UUIDGenerator.pm
@@ -5,34 +5,34 @@ use MIME::Base64::URLSafe;
 use UUID::Tiny;
 
 # uuid_scheme: 1 - v1 and v3 uuids.
-#			   2 - v4 and v5 uuids.
+#              2 - v4 and v5 uuids.
 
 has uuid_scheme => (
-	isa => 'Int',
-	is  => 'rw'
+    isa => 'Int',
+    is  => 'rw'
 );
 
 
 sub create_str {
     my $self = shift;
-	if ($self->uuid_scheme == 1 ){
-		return create_UUID_as_string(UUID_V1);
-	} elsif ($self->uuid_scheme == 2) {
-		return create_UUID_as_string(UUID_V4);
-	}
+    if ($self->uuid_scheme == 1 ){
+        return create_UUID_as_string(UUID_V1);
+    } elsif ($self->uuid_scheme == 2) {
+        return create_UUID_as_string(UUID_V4);
+    }
 }
 
 sub create_string_from_url {
     my $self = shift;
     my $url = shift;
     local $!;
-	if ($self->uuid_scheme == 1 ){
-		# Yes, DNS, not URL. We screwed up when we first defined it
-		# and it can't be safely changed once defined.
-		create_UUID_as_string(UUID_V3, UUID_NS_DNS, $url);
-	} elsif ($self->uuid_scheme == 2) {
-		create_UUID_as_string(UUID_V5, UUID_NS_URL, $url);
-	}
+    if ($self->uuid_scheme == 1 ){
+        # Yes, DNS, not URL. We screwed up when we first defined it
+        # and it can't be safely changed once defined.
+        create_UUID_as_string(UUID_V3, UUID_NS_DNS, $url);
+    } elsif ($self->uuid_scheme == 2) {
+        create_UUID_as_string(UUID_V5, UUID_NS_URL, $url);
+    }
 }
 
 sub from_string {

commit fa5eaa4a64739638fb8aa61f0867434f7ca004c4
Author: Christine Spang <spang at bestpractical.com>
Date:   Wed Aug 12 10:27:57 2009 +0100

    Update MANIFEST

diff --git a/MANIFEST b/MANIFEST
index a4d8b2d..8160d02 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -42,6 +42,7 @@ lib/Prophet/CLI/Command/Merge.pm
 lib/Prophet/CLI/Command/Mirror.pm
 lib/Prophet/CLI/Command/Publish.pm
 lib/Prophet/CLI/Command/Pull.pm
+lib/Prophet/CLI/Command/Push.pm
 lib/Prophet/CLI/Command/Search.pm
 lib/Prophet/CLI/Command/Server.pm
 lib/Prophet/CLI/Command/Settings.pm
@@ -135,6 +136,7 @@ t/lib/TestApp/Bugs.pm
 t/lib/TestApp/ButterflyNet.pm
 t/log.t
 t/luid.t
+t/malformed-url.t
 t/non-conflicting-merge.t
 t/publish-pull.t
 t/real-conflicting-merge.t
@@ -147,6 +149,7 @@ t/search.t
 t/Settings/lib/App/Settings.pm
 t/Settings/lib/App/Settings/Bug.pm
 t/Settings/lib/App/Settings/CLI.pm
+t/Settings/lib/App/Settings/Test.pm
 t/Settings/t/database-settings-editor.t
 t/Settings/t/sync-database-settings.t
 t/simple-conflicting-merge.t
@@ -157,6 +160,7 @@ t/sync-ticket.t
 t/sync_3party.t
 t/test_app.conf
 t/testing.conf
+t/usage.t
 t/use.t
 t/validate.t
 t/validation.t

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



More information about the Bps-public-commit mailing list