Bug 333369: Allow for non-recursive directory queries, r=timeless

This commit is contained in:
ajschult%verizon.net 2006-05-01 03:54:54 +00:00
parent f9a8a7c8e2
commit 2bca36fe33
2 changed files with 11 additions and 2 deletions

View File

@ -33,6 +33,7 @@ sub sillyness {
$zz = $::lines_removed;
$zz = $::query_begin_tag;
$zz = $::query_branchtype;
$zz = $::query_dirtype;
$zz = $::query_date_max;
$zz = $::query_debug;
$zz = $::query_end_tag;
@ -181,6 +182,8 @@ $::query_branch = $::FORM{'branch'};
$::query_branch = 'HEAD' if !defined($::query_branch);
$::query_branch = &SanitizeRevision($::query_branch);
$::query_branchtype = &ExpectMatchtype($::FORM{'branchtype'});
$::query_dirtype = $::FORM{'dirtype'};
$::query_dirtype = 'recurse' if !defined ($::query_dirtype);
if ($::query_branch eq 'HEAD' && $::query_branchtype ne 'notregexp') {
$::query_branch_head = 1 ;

View File

@ -169,8 +169,14 @@ sub query_checkins {
if (0 < @::query_dirs) {
my @list;
foreach my $i (@::query_dirs) {
push(@list, "dirs.dir LIKE ?");
push(@bind_values, "$i%");
if ($::query_dirtype eq 'recurse') {
push(@list, "dirs.dir LIKE ?");
push(@bind_values, "$i%");
}
else {
push(@list, "dirs.dir = ?");
push(@bind_values, "$i");
}
}
$qstring .= "AND (" . join(" OR ", @list) . ")";
}