[Lxr-commits] CVS: lxr/lib/LXR Common.pm,1.53,1.54 Files.pm,1.8,1.9
Brought to you by:
ajlittoz
From: Malcolm B. <mb...@us...> - 2005-11-02 23:40:03
|
Update of /cvsroot/lxr/lxr/lib/LXR In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15203/lib/LXR Modified Files: Common.pm Files.pm Log Message: Merge of the BK support from bk-dev-branch. This merge closes the bk-dev-branch. Adds support for BK repositories (somewhat incomplete). As BK is no longer free, this is untestable by the maintainer and will therefore not be maintained. It is released here to allow others to take it forward if they want. Also updates and add new testcases. Index: Common.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Common.pm,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- Common.pm 9 Sep 2005 22:06:18 -0000 1.53 +++ Common.pm 2 Nov 2005 23:39:55 -0000 1.54 @@ -493,7 +493,7 @@ $config = new LXR::Config($HTTP->{'this_url'}); die "Can't find config for " . $HTTP->{'this_url'} if !defined($config); - $files = new LXR::Files($config->sourceroot); + $files = new LXR::Files($config->sourceroot, $config->sourceparams); die "Can't create Files for " . $config->sourceroot if !defined($files); $index = new LXR::Index($config->dbname); die "Can't create Index for " . $config->dbname if !defined($index); Index: Files.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Files.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Files.pm 21 Jul 2004 20:44:30 -0000 1.8 +++ Files.pm 2 Nov 2005 23:39:55 -0000 1.9 @@ -23,18 +23,88 @@ use strict; sub new { - my ($self, $srcroot) = @_; + my ( $self, $srcroot, $params ) = @_; my $files; - if ($srcroot =~ /^CVS:(.*)/i) { + if ( $srcroot =~ /^CVS:(.*)/i ) { require LXR::Files::CVS; $srcroot = $1; $files = new LXR::Files::CVS($srcroot); - } else { + } + elsif ( $srcroot =~ /^bk:(.*)/i ) { + require LXR::Files::BK; + $srcroot = $1; + $files = new LXR::Files::BK($srcroot, $params); + } + else { require LXR::Files::Plain; $files = new LXR::Files::Plain($srcroot); } return $files; } +# Stub implementations of the Files interface + +sub getdir { + my $self = shift; + warn "::getdir not implemented. Parameters @_"; +} + +sub getfile { + my $self = shift; + warn "::getfile not implemented. Parameters @_"; +} + +sub getannotations { + my $self = shift; + warn "::getannotations not implemented. Parameters @_"; +} + +sub getauthor { + my $self = shift; + warn "::getauthor not implemented. Parameters @_"; +} + +sub filerev { + my $self = shift; + warn "::filerev not implemented. Parameters @_"; +} + +sub getfilehandle { + my $self = shift; + warn "::getfilehandle not implemented. Parameters @_"; +} + +sub getfilesize { + my $self = shift; + warn "::getfilesize not implemented. Parameters @_"; +} + +sub getfiletime { + my $self = shift; + warn "::getfiletime not implemented. Parameters @_"; +} + +sub getindex { + my $self = shift; + warn "::getindex not implemented. Parameters @_"; +} + +sub isdir { + my $self = shift; + warn "::isdir not implemented. Parameters: @_"; +} + +sub isfile { + my $self = shift; + warn "::isfile not implemented. Parameters: @_"; +} + +sub toreal { + # FIXME: this function should probably not exist, since it doesn't make sense for + # all file access methods + warn "toreal called - obsolete"; + return undef; +} + 1; |