User: sits    
  Date: 08/06/12 22:55:14

  Modified:    lib/Codestriker/Http DeltaRenderer.pm LxrLineFilter.pm
               .        CHANGELOG
               lib/Codestriker/Repository Subversion.pm
  Log:
  * Added support for LXR 0.9.5, which renamed the database tables to
    contain an lxr_ prefix by default.  Support for older LXR databases
    will still work by default.
  
  
  
  Index: DeltaRenderer.pm
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/lib/Codestriker/Http/DeltaRenderer.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DeltaRenderer.pm  11 Jun 2008 12:00:31 -0000      1.5
  +++ DeltaRenderer.pm  13 Jun 2008 05:55:12 -0000      1.6
  @@ -58,11 +58,11 @@
       
       @{$self->{line_filters}} = ();
       push @{$self->{line_filters}}, 
Codestriker::Http::HtmlEntityLineFilter->new();
  +    push @{$self->{line_filters}}, 
Codestriker::Http::TabToNbspLineFilter->new($tabwidth);
  +    push @{$self->{line_filters}}, 
Codestriker::Http::LineBreakLineFilter->new($brmode);
       if (defined $lxr_config) {
            push @{$self->{line_filters}}, 
Codestriker::Http::LxrLineFilter->new($lxr_config);
       }
  -    push @{$self->{line_filters}}, 
Codestriker::Http::TabToNbspLineFilter->new($tabwidth);
  -    push @{$self->{line_filters}}, 
Codestriker::Http::LineBreakLineFilter->new($brmode);
   
       bless $self, $type;
   }
  @@ -315,7 +315,6 @@
        my ($self, $text) = @_;
   
        # TODO: perform syntax highlighting.
  -     # TODO: perform LXR linking.
        foreach my $line_filter (@{$self->{line_filters}}) {
            $text = $line_filter->filter($text);
        }
  
  
  
  
  
  Index: LxrLineFilter.pm
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/lib/Codestriker/Http/LxrLineFilter.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LxrLineFilter.pm  11 Jun 2008 12:00:31 -0000      1.1
  +++ LxrLineFilter.pm  13 Jun 2008 05:55:13 -0000      1.2
  @@ -16,6 +16,8 @@
   
   @Codestriker::Http::LxrLineFilter::ISA =
       ("Codestriker::Http::LineFilter");
  +    
  +# TODO: close the database handle correctly.    
   
   # Take the LXR configuration as a parameter and create a connection to the 
LXR database
   # for symbol lookup.
  @@ -32,21 +34,25 @@
        $lxr_config->{password} : $lxr_config->{passwd};
        $self->{dbh} = DBI->connect($lxr_config->{db}, $lxr_config->{user},
                                                                $password,
  -                                                             {AutoCommit=>0, 
RaiseError=>1})
  +                                                             {AutoCommit=>0, 
RaiseError=>0, PrintError=>0})
                || die "Couldn't connect to LXR database: " . DBI->errstr;
   
        # Create the appropriate prepared statement for retrieving LXR symbols.
        # Depending on the LXR deployment, the table name is either "symbols"
  -     # or "lxr_symbols".             
  -     eval
  -     {
  -         $self->{select_ids} =
  +     # or "lxr_symbols".  Try to determine this silently.            
  +    $self->{select_ids} =
                        $self->{dbh}->prepare_cached('SELECT count(symname) 
FROM symbols where symname = ?');
  -     };
  -    if ($@) {
  +     my $success = defined $self->{select_ids};
  +     $success &&= $self->{select_ids}->execute('test');
  +     $success &&= $self->{select_ids}->finish;
  +     if (! $success) {
            $self->{select_ids} =
                        $self->{dbh}->prepare_cached('SELECT count(symname) 
FROM lxr_symbols where symname = ?');
  -    }        
  +    }
  +
  +    # Re-enable error reporting again.    
  +    $self->{dbh}->{RaiseError} = 1;  
  +    $self->{dbh}->{PrintError} = 1;  
   
        # Cache for storing which IDs have been found.
        $self->{idhash} = {};
  @@ -79,7 +85,7 @@
   
       # Check if the id has been found in lxr.
       if ($count > 0) {
  -             return '<a href=\"' . $self->{url} . $id . '\" class=\"fid\">' 
. $id . '</a>';
  +             return '<a href="' . $self->{url} . $id . '" class="fid">' . 
$id . '</a>';
       } else {
                return $id;
       }
  @@ -123,6 +129,7 @@
                                $newdata .= $token;
                } elsif ($token eq "nbsp" || $token eq "quot" || $token eq 
"amp" ||
                        $token eq "lt" || $token eq "gt") {
  +                     # TODO: is this still needed?   
                                # HACK - ignore potential HTML entities.  This 
needs to be
                                # done in a smarter fashion later.
                                $newdata .= $token;
  @@ -147,4 +154,15 @@
       return $newdata;
   }
   
  +# Ensure the prepared statements and database connection to LXR is closed.
  +sub DESTROY {
  +     my ($self) = @_;
  +
  +    $self->SUPER::DESTROY if $self->can("SUPER::DESTROY");
  +
  +     $self->{select_ids}->finish;    
  +     $self->{dbh}->disconnect;
  +}
  +
  +
   1;
  
  
  
  
  
  Index: CHANGELOG
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
  retrieving revision 1.226
  retrieving revision 1.227
  diff -u -r1.226 -r1.227
  --- CHANGELOG 11 Jun 2008 07:05:22 -0000      1.226
  +++ CHANGELOG 13 Jun 2008 05:55:13 -0000      1.227
  @@ -33,7 +33,11 @@
     [EMAIL PROTECTED]
     
   * The edit comment page has been updated so that the topic name is
  -  linked back to the associated view topic page. 
  +  linked back to the associated view topic page.
  +  
  +* Added support for LXR 0.9.5, which renamed the database tables to
  +  contain an lxr_ prefix by default.  Support for older LXR databases
  +  will still work by default.   
        
   Version 1.9.4
   
  
  
  
  
  
  Index: Subversion.pm
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/lib/Codestriker/Repository/Subversion.pm,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Subversion.pm     24 Oct 2007 10:09:36 -0000      1.19
  +++ Subversion.pm     13 Jun 2008 05:55:13 -0000      1.20
  @@ -108,7 +108,7 @@
   # Return a string representation of this repository.
   sub toString ($) {
       my ($self) = @_;
  -    return "svn:" . $self->getRoot();
  +    return $self->{repository_string};
   }
   
   # Given a Subversion URL, determine if it refers to a directory or a file.
  
  
  

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Codestriker-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/codestriker-commits

Reply via email to