[FFmpeg-cvslog] [ffmpeg-fateserver] branch master updated. 7f53161 index: lsort(): add support for sorting with '//'

gitolite ffmpeg-cvslog at ffmpeg.org
Mon Jun 16 17:19:19 CEST 2014


The branch, master has been updated
       via  7f531611a586674c4f701522eb55077195cd0b2d (commit)
       via  51c576e21cb6ce3f93d93230718b5e65d7f12b80 (commit)
       via  3f9860b54ab037b54e2414d569fc4714fcb2de37 (commit)
       via  b845a44cc63c785fd90905a45f6fd66ce50cd718 (commit)
       via  e8f124d9e560e48820327b929ad733718ba07bb8 (commit)
       via  7eebe37d0fd420f61a08199f606398738a34ed20 (commit)
       via  db84538de6aca94a9cb8b23b1daaef1b284ae813 (commit)
       via  4ab60683909440ac908f8f1fe9da973a3f725c04 (commit)
      from  83c7a97760f260de673544edc22f522823628e35 (commit)


- Log -----------------------------------------------------------------
commit 7f531611a586674c4f701522eb55077195cd0b2d
Author:     Timothy Gu <timothygu99 at gmail.com>
AuthorDate: Tue Jun 10 18:07:53 2014 -0700
Commit:     Michael Niedermayer <michaelni at gmx.at>
CommitDate: Mon Jun 16 17:11:14 2014 +0200

    index: lsort(): add support for sorting with '//'
    
    Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
    Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

diff --git a/index.cgi b/index.cgi
index 6603fda..7204591 100755
--- a/index.cgi
+++ b/index.cgi
@@ -111,14 +111,23 @@ sub lsort {
     $params .= '&' if $params;
     my ($text, $key) = @_;
 
-    if ($sort eq $key) {                           # $sort = $key
-        if ($key =~ /^desc/) {                     # $sort = desc*
-            $key =~ s/^desc//;
-        } else {                                   # $sort = *
-            $key = "desc$key";
+    my $newkey = '';
+    if ($sort eq $key) {                           # $key     = $sort
+        for my $thiskey (split /\/\//, $key) {
+            if ($thiskey =~ /^desc/) {             # $thiskey = desc*
+                $thiskey =~ s/^desc//;
+            } else {                               # $thiskey = *
+                $thiskey = "desc$thiskey";
+            }
+            if ($newkey eq '') {
+                $newkey = $thiskey;
+            } else {
+                $newkey .= "//$thiskey";
+            }
         }
     }
 
+    $key = $newkey if $newkey ne '';
     anchor $text, href => "$uri?${params}sort=$key";
 }
 

commit 51c576e21cb6ce3f93d93230718b5e65d7f12b80
Author:     Timothy Gu <timothygu99 at gmail.com>
AuthorDate: Tue Jun 10 18:07:52 2014 -0700
Commit:     Michael Niedermayer <michaelni at gmx.at>
CommitDate: Mon Jun 16 17:10:58 2014 +0200

    index: allow multiple sorting criteria
    
    Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
    Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

diff --git a/index.cgi b/index.cgi
index 9a59370..6603fda 100755
--- a/index.cgi
+++ b/index.cgi
@@ -81,7 +81,7 @@ my $warn = 100 - $allpass - $allfail;
 
 my @sort = ('subarch', 'os', 'cc', 'comment', 'slot');
 my $sdir = 1; # default to ascending sorting
-defined $sort and unshift @sort, $sort;
+defined $sort and unshift @sort, split /\/\//, $sort;
 $sort ||= $sort[0];
 
 sub nscmp {

commit 3f9860b54ab037b54e2414d569fc4714fcb2de37
Author:     Timothy Gu <timothygu99 at gmail.com>
AuthorDate: Tue Jun 10 18:07:51 2014 -0700
Commit:     Michael Niedermayer <michaelni at gmx.at>
CommitDate: Mon Jun 16 17:10:48 2014 +0200

    Move $nfail calculation to FATE.pm
    
    Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
    Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

diff --git a/FATE.pm b/FATE.pm
index 0992c96..806168d 100644
--- a/FATE.pm
+++ b/FATE.pm
@@ -76,6 +76,7 @@ sub split_stats {
     return {
         ntests => int $st[1],
         npass  => int $st[2],
+        nfail  => int $st[1] - int $st[2],
         nwarn  =>     $st[3],
     };
 }
@@ -115,7 +116,8 @@ sub load_summary {
         $ntests++;
     }
     close R;
-    return { %$hdr, %$conf, ntests => $ntests, npass => $npass };
+    return { %$hdr, %$conf, ntests => $ntests, npass => $npass,
+             nfail => $ntests - $npass };
 }
 
 sub load_report {
diff --git a/index.cgi b/index.cgi
index 9157daa..9a59370 100755
--- a/index.cgi
+++ b/index.cgi
@@ -64,9 +64,8 @@ for my $slot (@slots) {
     }
 
     if (my $prev = load_summary $slot, 'previous') {
-        my $nfail = $$rep{ntests}  - $$rep{npass};
         my $pfail = $$prev{ntests} - $$prev{npass};
-        $$rep{alert} = $$rep{ntests} && $nfail <=> $pfail;
+        $$rep{alert} = $$rep{ntests} && $$rep{nfail} <=> $pfail;
         $$rep{dwarn} = $$rep{nwarn} <=> $$prev{nwarn};
         $$rep{pdate} = $$prev{date};
     }
@@ -309,7 +308,6 @@ for my $rep (sort repcmp @reps) {
     if ($npass < $ntest && $ntest - $npass < 100) {
         my $report = load_report $$rep{slot}, $$rep{date};
         my @fail = grep $$_{status} ne '0', @{$$report{recs}};
-        my $nfail = @fail;
         my $lastpass = load_lastpass $$rep{slot};
 
         start 'tr', id => $slotid, class => 'slotfail';
@@ -317,10 +315,10 @@ for my $rep (sort repcmp @reps) {
         start 'table', class => 'minirep';
         start 'thead';
         start 'tr';
-        if ($nfail eq 1) {
-            th "$nfail failed test";
+        if ($$rep{nfail} eq 1) {
+            th "1 failed test";
         } else {
-            th "$nfail failed tests";
+            th "$$rep{nfail} failed tests";
         }
         th 'Status', class => 'errcode';
         end 'tr';

commit b845a44cc63c785fd90905a45f6fd66ce50cd718
Author:     Timothy Gu <timothygu99 at gmail.com>
AuthorDate: Tue Jun 10 18:07:50 2014 -0700
Commit:     Michael Niedermayer <michaelni at gmx.at>
CommitDate: Mon Jun 16 17:10:40 2014 +0200

    FATE.pm: use $ntests instead of $ntest for consistency
    
    Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
    Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

diff --git a/FATE.pm b/FATE.pm
index bb43516..0992c96 100644
--- a/FATE.pm
+++ b/FATE.pm
@@ -107,15 +107,15 @@ sub load_summary {
     open R, '-|', "unxz -c $repdir/report.xz" or return;
     my $hdr  = split_header scalar <R> or return;
     my $conf = split_config scalar <R> or return;
-    my $ntest = 0;
+    my $ntests = 0;
     my $npass = 0;
     while (<R>) {
         my $rec = split_rec $_;
         $$rec{status} == 0 and $npass++;
-        $ntest++;
+        $ntests++;
     }
     close R;
-    return { %$hdr, %$conf, ntests => $ntest, npass => $npass };
+    return { %$hdr, %$conf, ntests => $ntests, npass => $npass };
 }
 
 sub load_report {

commit e8f124d9e560e48820327b929ad733718ba07bb8
Author:     Timothy Gu <timothygu99 at gmail.com>
AuthorDate: Tue Jun 10 18:07:49 2014 -0700
Commit:     Michael Niedermayer <michaelni at gmx.at>
CommitDate: Mon Jun 16 17:10:25 2014 +0200

    index: move the declaration of $sort to the beginning of the file
    
    Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
    Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

diff --git a/index.cgi b/index.cgi
index 1aa2c00..9157daa 100755
--- a/index.cgi
+++ b/index.cgi
@@ -30,6 +30,9 @@ use URI::Escape;
 # split(/:/, $this_query, 2);
 my @queries = split(/\/\//, uri_unescape param 'query') if (param 'query');
 
+my $sort = param('sort');
+$sort    = $sort eq 'arch' ? 'subarch': $sort;
+
 (my $uri = $ENV{REQUEST_URI}) =~ s/\?.*//;
 
 opendir D, $fatedir or fail 'Server error: $fatedir not found';
@@ -78,9 +81,8 @@ $allfail = 100 * $allfail / @reps;
 my $warn = 100 - $allpass - $allfail;
 
 my @sort = ('subarch', 'os', 'cc', 'comment', 'slot');
-my $sort = param('sort');
 my $sdir = 1; # default to ascending sorting
-defined $sort and unshift @sort, $sort eq 'arch'? 'subarch': $sort;
+defined $sort and unshift @sort, $sort;
 $sort ||= $sort[0];
 
 sub nscmp {

commit 7eebe37d0fd420f61a08199f606398738a34ed20
Author:     Timothy Gu <timothygu99 at gmail.com>
AuthorDate: Tue Jun 10 18:07:48 2014 -0700
Commit:     Michael Niedermayer <michaelni at gmx.at>
CommitDate: Mon Jun 16 03:25:58 2014 +0200

    index: use one parameter "sort" for both ascending and descending sorting
    
    Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
    Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

diff --git a/index.cgi b/index.cgi
index c9021c7..1aa2c00 100755
--- a/index.cgi
+++ b/index.cgi
@@ -78,8 +78,8 @@ $allfail = 100 * $allfail / @reps;
 my $warn = 100 - $allpass - $allfail;
 
 my @sort = ('subarch', 'os', 'cc', 'comment', 'slot');
-my $sort = param('asort') || param('dsort');
-my $sdir = param('dsort') ? -1 : 1;
+my $sort = param('sort');
+my $sdir = 1; # default to ascending sorting
 defined $sort and unshift @sort, $sort eq 'arch'? 'subarch': $sort;
 $sort ||= $sort[0];
 
@@ -91,6 +91,10 @@ sub nscmp {
 sub repcmp {
     my $r;
     for my $s (@sort) {
+        if ($s =~ /^desc/) {
+            $s =~ s/^desc//;
+            $sdir = -1;
+        }
         last if $r = $sdir * nscmp $$a{$s}, $$b{$s};
     }
     return $r;
@@ -104,14 +108,17 @@ sub lsort {
         $params .= "$thisparam=" . param($thisparam);
     }
     $params .= '&' if $params;
-    my ($text, $key, $p) = @_;
-    if ($sort eq $key) {
-        $p = param('asort') ? 'dsort' : 'asort';
-    }
-    if (!$p) {
-        $p = 'asort';
+    my ($text, $key) = @_;
+
+    if ($sort eq $key) {                           # $sort = $key
+        if ($key =~ /^desc/) {                     # $sort = desc*
+            $key =~ s/^desc//;
+        } else {                                   # $sort = *
+            $key = "desc$key";
+        }
     }
-    anchor $text, href => "$uri?$params$p=$key";
+
+    anchor $text, href => "$uri?${params}sort=$key";
 }
 
 sub category {
@@ -213,7 +220,7 @@ span ' ', class => 'fail', style => "width: ${allfail}%" if $allfail;
 end 'td';
 end 'tr';
 start 'tr';
-start 'th'; lsort 'Time',     'date', 'dsort'; end 'th';
+start 'th'; lsort 'Time',     'descdate';      end 'th';
 start 'th'; lsort 'Rev',      'rev';           end 'th';
 start 'th'; lsort 'Arch',     'arch';          end 'th';
 start 'th'; lsort 'OS',       'os';            end 'th';

commit db84538de6aca94a9cb8b23b1daaef1b284ae813
Author:     Timothy Gu <timothygu99 at gmail.com>
AuthorDate: Mon Jun 16 03:14:09 2014 +0200
Commit:     Michael Niedermayer <michaelni at gmx.at>
CommitDate: Mon Jun 16 03:14:09 2014 +0200

    fate.css: wrap long lines in log
    
    Signed-off-by: Timothy Gu <timothygu99 at gmail.com>

diff --git a/fate.css b/fate.css
index a62d4cd..9264d83 100644
--- a/fate.css
+++ b/fate.css
@@ -198,7 +198,7 @@ table.minirep {
 
 .diff {
     font-family: monospace;
-    white-space: pre;
+    white-space: pre-wrap;
     display: none;
 }
 

commit 4ab60683909440ac908f8f1fe9da973a3f725c04
Author:     Timothy Gu <timothygu99 at gmail.com>
AuthorDate: Mon Jun 16 03:11:08 2014 +0200
Commit:     Michael Niedermayer <michaelni at gmx.at>
CommitDate: Mon Jun 16 03:11:08 2014 +0200

    index: fix HTTP parameters when another param is already given
    
    I could have fixed the `map`, but I don't want to continue this
    obfuscation further.
    
    Signed-off-by: Timothy Gu <timothygu99 at gmail.com>

diff --git a/index.cgi b/index.cgi
index 18548a6..c9021c7 100755
--- a/index.cgi
+++ b/index.cgi
@@ -97,7 +97,12 @@ sub repcmp {
 };
 
 sub lsort {
-    my $params = join '&', map param($_), grep $_ !~ 'sort', param;
+    my $params = '';
+    for my $thisparam (param) {
+        next if $thisparam =~ 'sort';
+        $params .= '&' if $params ne '';
+        $params .= "$thisparam=" . param($thisparam);
+    }
     $params .= '&' if $params;
     my ($text, $key, $p) = @_;
     if ($sort eq $key) {
@@ -113,10 +118,14 @@ sub category {
     my ($category, $rep) = @_;
     my $head_printed = 0;
 
-    # $params contains parameters else than query.
-    my $params = map param($_), grep $_ !~ 'query', param;
-    $params = $params ? $params : '';  # Prevents $params eq 0
-    my $head = $params ? '&' : '' . 'query=';
+    # $params will contain parameters else than query, if any, in HTTP format.
+    my $params = '';
+    for my $thisparam (param) {
+        next if $thisparam eq 'query';
+        $params .= '&' if $params ne '';
+        $params .= "$thisparam=" . param($thisparam);
+    }
+    my $head = ($params ? '&' : '') . 'query=';
 
     if (@queries) {
         for my $this_query (@queries) {

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

Summary of changes:
 FATE.pm   |    8 ++++--
 fate.css  |    2 +-
 index.cgi |   69 +++++++++++++++++++++++++++++++++++++++++-------------------
 3 files changed, 53 insertions(+), 26 deletions(-)


hooks/post-receive
-- 



More information about the ffmpeg-cvslog mailing list