diff --git a/webtools/bonsai/cvsquery.cgi b/webtools/bonsai/cvsquery.cgi index 2f26ac087ac6..a6892d2395d0 100755 --- a/webtools/bonsai/cvsquery.cgi +++ b/webtools/bonsai/cvsquery.cgi @@ -177,6 +177,10 @@ if (!defined $::query_branch) { } $::query_branchtype = $::FORM{'branchtype'}; +if ($::query_branch eq 'HEAD' && + ($::query_branchtype eq 'match' || $::query_branchtype eq 'regexp')) { + $::query_branch_head = 1 ; +} # # tags @@ -623,12 +627,22 @@ sub query_to_english { $english .= "to file " . html_quote($::query_file) . " "; } - if( ! ($::query_branch =~ /^[ ]*HEAD[ ]*$/i) ){ - if($::query_branch eq '' ){ + if (!$::query_branch_head) { + if ($::query_branch eq '') { $english .= "on all branches "; - } - else { - $english .= "on branch " . html_quote($::query_branch) . " "; + } else { + if ($::query_branchtype eq 'notregexp') { + if ($::query_branch eq 'HEAD') { + $english .= "not on "; + } else { + $english .= "not like "; + } + } elsif ($::query_branchtype eq 'regexp') { + $english .= "like "; + } else { + $english .= "on "; + } + $english .= "branch " . html_quote($::query_branch) . " "; } } diff --git a/webtools/bonsai/cvsquery.pl b/webtools/bonsai/cvsquery.pl index 7d0ebc58956d..db409bb8f11e 100755 --- a/webtools/bonsai/cvsquery.pl +++ b/webtools/bonsai/cvsquery.pl @@ -107,10 +107,6 @@ sub query_checkins { $mod_map{$i} = $NOT_LOCAL; } - if( $::query_branch =~ /^[ ]*HEAD[ ]*$/i ){ - $::query_branch_head = 1; - } - $begin_tag = ""; $end_tag = ""; @@ -149,8 +145,11 @@ sub query_checkins { $qstring .= " and branches.branch regexp $q"; } elsif ($::query_branchtype eq 'notregexp') { - $qstring .= - " and not (branches.branch regexp $q) "; + if ($::query_branch eq 'HEAD') { + $qstring .= " and branches.branch != ''"; + } else { + $qstring .= " and not (branches.branch regexp $q) "; + } } else { $qstring .= " and (branches.branch = $q or branches.branch = ";