Fix the regexp & notregexp query cases when given the branch name HEAD.

Bug #237525 r=timeless
This commit is contained in:
cls%seawood.org 2004-10-11 20:28:48 +00:00
Родитель 2e90f7c3c6
Коммит 1953bdd78f
2 изменённых файлов: 24 добавлений и 11 удалений

Просмотреть файл

@ -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 <i>" . html_quote($::query_branch) . "</i> ";
} 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 <i>" . html_quote($::query_branch) . "</i> ";
}
}

Просмотреть файл

@ -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 = ";