From 92e181981d07955e35db7da4b68132029dfd7f0b Mon Sep 17 00:00:00 2001 From: "cls%seawood.org" Date: Wed, 29 Aug 2007 06:08:56 +0000 Subject: [PATCH] Implement IsHidden() for bonsai git-svn-id: svn://10.0.0.236/trunk@233287 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/tinderbox/cvsquery.pl | 32 ++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/mozilla/webtools/tinderbox/cvsquery.pl b/mozilla/webtools/tinderbox/cvsquery.pl index d9872f3c755..631e1f5d959 100755 --- a/mozilla/webtools/tinderbox/cvsquery.pl +++ b/mozilla/webtools/tinderbox/cvsquery.pl @@ -217,7 +217,7 @@ sub query_checkins_bonsai { my $key = "$ci->[$::CI_DIR]/$ci->[$::CI_FILE]"; - if (IsHidden("$ci->[$::CI_REPOSITORY]/$key")) { + if (IsHidden($tree, "$ci->[$::CI_REPOSITORY]/$key")) { next; } @@ -495,7 +495,35 @@ print "
Added ($file,$version) for tag $tagname
\n"; return $result; } -# Common helper functions +# Returns true if the given directory or filename is one of the hidden ones +# that we don't want to show users. +sub IsHidden { + my ($tree, $name) = (@_); + my $bonsai_dir = $::global_treedata->{$tree}->{bonsai_dir}; + + $name =~ s:///*:/:g; # Remove any multiple slashes. + if (!defined @::HideList) { + if (open(HIDE, "<${bonsai_dir}/data/hidelist")) { + while () { + chop; + $_ = trim($_); + s/\#.*//; + next if (/^$/); + + push(@::HideList, $_); + } + close HIDE; + } else { + @::HideList = (); + } + } + foreach my $item (@::HideList) { + if ($name =~ m/$item/) { + return 1; + } + } + return 0; +} sub rev_is_after { my $r1 = shift @_;