--- lib/twiki/store/rcsfile.pm_old Thu Jul 3 20:37:19 2008 +++ lib/twiki/store/rcsfile.pm Thu Jul 3 20:36:06 2008 @@ -61,6 +61,10 @@ my $this = bless( { session => $session }, $class ); $this->{web} = $web; + $this->{rcs_ext} = ',v'; + + # Have to assume the traditional VMS character set, no commas in filenames. + $this->{rcs_ext} = '-v' if ($^O eq 'VMS'); if( $topic ) { my $rcsSubDir = ( $TWiki::cfg{RCS}{useSubDir} ? '/RCS' : '' ); @@ -73,13 +77,13 @@ $this->{file} = $TWiki::cfg{PubDir}.'/'.$web.'/'. $this->{topic}.'/'.$attachment; $this->{rcsFile} = $TWiki::cfg{PubDir}.'/'. - $web.'/'.$topic.$rcsSubDir.'/'.$attachment.',v'; + $web.'/'.$topic.$rcsSubDir.'/'.$attachment.$this->{rcs_ext}; } else { $this->{file} = $TWiki::cfg{DataDir}.'/'.$web.'/'. $topic.'.txt'; $this->{rcsFile} = $TWiki::cfg{DataDir}.'/'. - $web.$rcsSubDir.'/'.$topic.'.txt,v'; + $web.$rcsSubDir.'/'.$topic.'.txt'.$this->{rcs_ext}; } } @@ -444,7 +448,7 @@ my $rev = $this->numRevisions(); my $text = $this->getRevision( $rev ); - # If there is no ,v, create it + # If there is no ,v ($this->{rcs_ext}), create it unless( -e $this->{rcsFile} ) { $this->addRevisionFromText( $text, "restored", $user, time() ); } else { @@ -706,7 +710,7 @@ if (opendir(W, $web)) { foreach my $f (readdir(W)) { if ($f =~ /^(.*)\.lease$/) { - if (! -e "$1.txt,v") { + if (! -e "$1.txt".$this->{rcs_ext}) { unlink($f); } } @@ -1059,7 +1063,7 @@ ---++ ObjectMethod getAttachmentList($web, $topic) returns {} of filename => { key => value, key2 => value } for any given web, topic -Ignores files starting with _ or ending with ,v +Ignores files starting with _ or ending with ,v ($this->{rcs_ext}) =cut @@ -1070,7 +1074,8 @@ opendir DIR, $dir || return ''; my %attachmentList = (); my @files = sort grep { m/^[^\.*_]/ } readdir( DIR ); - @files = grep { !/.*,v/ } @files; + my $rcs_ext = $this->{rcs_ext}; + @files = grep { !/.*$rcs_ext/ } @files; foreach my $attachment ( @files ) { my @stat = stat ($dir."/".$attachment); $attachmentList{$attachment} = _constructAttributesForAutoAttached($attachment, \@stat);