[Bps-public-commit] smokingit branch, master, updated. a41d3439b06b21eed5e7bc442928b6ae6efb0ff5

Alex Vandiver alexmv at bestpractical.com
Fri Feb 11 19:30:18 EST 2011


The branch, master has been updated
       via  a41d3439b06b21eed5e7bc442928b6ae6efb0ff5 (commit)
       via  386647d9933c0502272fced98e5ce5e529a2ad62 (commit)
      from  f9b1d136fca9283063a12ed50b965fa674b25e65 (commit)

Summary of changes:
 lib/Smokingit/Action/UpdateBranch.pm |    2 +-
 lib/Smokingit/Model/Branch.pm        |    7 ++++++-
 lib/Smokingit/Model/Project.pm       |    8 ++++++++
 lib/Smokingit/View/Project.pm        |   29 ++++++++++-------------------
 share/web/static/css/app-late.css    |    8 ++++++++
 5 files changed, 33 insertions(+), 21 deletions(-)

- Log -----------------------------------------------------------------
commit 386647d9933c0502272fced98e5ce5e529a2ad62
Author: Alex Vandiver <alex at chmrr.net>
Date:   Fri Feb 11 19:27:51 2011 -0500

    Show branch test status on project page

diff --git a/lib/Smokingit/Model/Branch.pm b/lib/Smokingit/Model/Branch.pm
index 3fcfa69..f8448f0 100644
--- a/lib/Smokingit/Model/Branch.pm
+++ b/lib/Smokingit/Model/Branch.pm
@@ -183,5 +183,10 @@ sub branchpoint {
     return $commit->id ? $commit : undef;
 }
 
+sub test_status {
+    my $self = shift;
+    return $self->current_commit->status;
+}
+
 1;
 
diff --git a/lib/Smokingit/View/Project.pm b/lib/Smokingit/View/Project.pm
index 60e37ab..83e1319 100644
--- a/lib/Smokingit/View/Project.pm
+++ b/lib/Smokingit/View/Project.pm
@@ -118,43 +118,32 @@ template '/fragments/project/branch-list' => sub {
         }
 
         $branches->limit( column => "status", value => "master" );
-        $branches->order_by( column => "name" );
-        ul {
-            while (my $b = $branches->next) {
-                li {
-                    hyperlink(
-                        label => $b->name,
-                        url => "branch/" . $b->name,
-                    );
-                    branchlist($b->branches);
-                };
-            }
-        };
+        branchlist($branches, recurse => 1);
 
         $branches->unlimit;
         $branches->limit( column => "project_id", value => get('project_id') );
         $branches->limit( column => "to_merge_into", operator => "IS", value => "NULL" );
         $branches->limit( column => "status", operator => "!=", value => "ignore", entry_aggregator => "AND" );
         $branches->limit( column => "status", operator => "!=", value => "master", entry_aggregator => "AND" );
-        branchlist($branches, 1);
+        branchlist($branches, hline => 1);
 
         $branches->unlimit;
         $branches->limit( column => "project_id", value => get('project_id') );
         $branches->limit( column => "status", operator => "=", value => "ignore" );
-        branchlist($branches, 1);
+        branchlist($branches, hline => 1);
     };
 };
 
 sub branchlist {
-    my ($branches, $hline) = @_;
+    my ($branches, %args) = @_;
     $branches->order_by( column => "name" );
     if ($branches->count) {
-        if ($hline) {
-            div { { class is "hline" } }
-        }
+        div { class is "hline"; }
+            if $args{hline};
         ul {
             while (my $b = $branches->next) {
                 li {
+                    { class is $b->test_status; }
                     hyperlink(
                         label => $b->name,
                         url => "branch/" . $b->name,
diff --git a/share/web/static/css/app-late.css b/share/web/static/css/app-late.css
index 6978b8d..883451e 100644
--- a/share/web/static/css/app-late.css
+++ b/share/web/static/css/app-late.css
@@ -115,6 +115,14 @@ li {
     font-style: italic;
     text-decoration: none;
 }
+#branch-list li.passing   { list-style-image: url('/static/images/silk/tick.png');            }
+#branch-list li.todo      { list-style-image: url('/static/images/silk/asterisk_orange.png'); }
+#branch-list li.failing   { list-style-image: url('/static/images/silk/cross.png');           }
+#branch-list li.parsefail { list-style-image: url('/static/images/silk/exclamation.png');     }
+#branch-list li.errors    { list-style-image: url('/static/images/silk/error.png');           }
+#branch-list li.testing   { list-style-image: url('/static/images/silk/cog.png');             }
+#branch-list li.queued    { list-style-image: url('/static/images/silk/hourglass.png');       }
+#branch-list li.broken    { list-style-image: url('/static/images/silk/server_error.png');    }
 #right-bar {
   margin-top: 1em;
   border-left: 1px dotted #779;

commit a41d3439b06b21eed5e7bc442928b6ae6efb0ff5
Author: Alex Vandiver <alex at chmrr.net>
Date:   Fri Feb 11 19:28:27 2011 -0500

    Allow releng branches to be valid merge-into targets

diff --git a/lib/Smokingit/Action/UpdateBranch.pm b/lib/Smokingit/Action/UpdateBranch.pm
index 016da30..346a4fe 100644
--- a/lib/Smokingit/Action/UpdateBranch.pm
+++ b/lib/Smokingit/Action/UpdateBranch.pm
@@ -17,7 +17,7 @@ sub arguments {
 
     my $args = $self->SUPER::arguments;
 
-    my $branches = $self->record->project->trunks;
+    my $branches = $self->record->project->trunk_or_relengs;
 
     $args->{to_merge_into}{valid_values} = [
         {
diff --git a/lib/Smokingit/Model/Branch.pm b/lib/Smokingit/Model/Branch.pm
index f8448f0..b87adf0 100644
--- a/lib/Smokingit/Model/Branch.pm
+++ b/lib/Smokingit/Model/Branch.pm
@@ -81,7 +81,7 @@ sub create {
 sub branches {
     my $self = shift;
     my $branches = Smokingit::Model::BranchCollection->new;
-    return $branches unless $self->status eq "master";
+    return $branches unless $self->status eq "master" or $self->status eq "releng";
     $branches->limit( column => "project_id", value => $self->project->id );
     $branches->limit( column => "status", operator => "!=", value => "ignore", entry_aggregator => "AND");
     $branches->limit( column => "status", operator => "!=", value => "master", entry_aggregator => "AND");
diff --git a/lib/Smokingit/Model/Project.pm b/lib/Smokingit/Model/Project.pm
index 05c063d..c84ecbc 100644
--- a/lib/Smokingit/Model/Project.pm
+++ b/lib/Smokingit/Model/Project.pm
@@ -93,6 +93,14 @@ sub trunks {
     return $trunks;
 }
 
+sub trunk_or_relengs {
+    my $self = shift;
+    my $branches = $self->branches;
+    $branches->limit( column => "status", value => "master", entry_aggregator => "or" );
+    $branches->limit( column => "status", value => "releng", entry_aggregator => "or" );
+    return $branches;
+}
+
 sub planned_tests {
     my $self = shift;
     my $tests = Smokingit::Model::SmokeResultCollection->new;
diff --git a/lib/Smokingit/View/Project.pm b/lib/Smokingit/View/Project.pm
index 83e1319..9c875e7 100644
--- a/lib/Smokingit/View/Project.pm
+++ b/lib/Smokingit/View/Project.pm
@@ -148,7 +148,9 @@ sub branchlist {
                         label => $b->name,
                         url => "branch/" . $b->name,
                     );
-                }
+                    branchlist($b->branches, %args)
+                        if $args{recurse};
+                };
             }
         }
     }

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



More information about the Bps-public-commit mailing list