[Bps-public-commit] App-Changeloggr branch, master, updated. 61c7ae1e6dd4d4a93798ae7595e0ce73da164113

sartak at bestpractical.com sartak at bestpractical.com
Thu Jul 30 14:21:08 EDT 2009


The branch, master has been updated
       via  61c7ae1e6dd4d4a93798ae7595e0ce73da164113 (commit)
      from  0d2c85b51328670dcafb08407a9bddd7768ab86b (commit)

Summary of changes:
 bin/flip-changes |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 61c7ae1e6dd4d4a93798ae7595e0ce73da164113
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Jul 30 14:21:04 2009 -0400

    Better output

diff --git a/bin/flip-changes b/bin/flip-changes
index 7912d76..b057486 100644
--- a/bin/flip-changes
+++ b/bin/flip-changes
@@ -5,6 +5,8 @@ use warnings;
 use Jifty;
 BEGIN { Jifty->new }
 
+$| = 1;
+
 my $changelogs = App::Changeloggr::Model::ChangelogCollection->new(
     current_user => App::Changeloggr::CurrentUser->superuser,
 );
@@ -25,8 +27,8 @@ while (my $changelog = <$changelogs>) {
             current_user => App::Changeloggr::CurrentUser->superuser,
         );
         my ($ok, $msg) = $new_change->create(%values);
-        $msg ||= 'ok';
-        print "created $ok - $msg\n";
+        if ($ok) { print '.' }
+        else { print "\nUnable to create change: $msg" }
 
         for my $collection ($change->votes, $change->rewordings, $change->importances) {
             while (my $record = <$collection>) {
@@ -38,8 +40,8 @@ while (my $changelog = <$changelogs>) {
         }
 
         ($ok, $msg) = $change->delete;
-        $msg ||= 'ok';
-        print "deleted $ok - $msg\n";
+        if ($ok) { print '.' }
+        else { print "\nUnable to delete change: $msg" }
     }
 }
 

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



More information about the Bps-public-commit mailing list