Tags:
create new tag
, view all tags
when you use RcsLite it complains that month should not be -1 and therefore does not save the file

in RscLite::addRevision()

time() is returning : 70.01.01.00.32.50

John - I need help!!!! should the signature of addRevision be different between RcsWrap and RcsLite???

-- SvenDowideit - 26 Jan 2003

Hope you don't mind me breaking your lock to respond quickly. The signature is different in that RcsLite has an optional extra parameter, this is because it can also do replaceRevision. Could you please give more details of your bug - e.g. line numbers and what you were trying to do? I think I may have seen something like this from corrupt topics that have an invalid date in them.

Also you might like to try tools/test/rcslitetest

-- JohnTalintyre - 26 Jan 2003

excellent, thanks

in RcsLite::addRevision line 448 $date seems to be a string, while _epochToRcsDateTime wants a tm_time struct.. sometimes the format of $date is text such as - Sat Jan 25 23:42:22 2003 which is completely unexpected..

mmm the rcslitetest script doesn't complain running as root, running it through the browser as a cgi script maxes out my cpu, and spins the disk but does noting good (and then i killed it)

-- SvenDowideit - 26 Jan 2003

The rcslisttest scripts is not a cgi scripts and should be run as such. It will clearly report any errors.

_epochToRcsDateTime takes in a single parameter as can be seen below. The manual page states that gmtime takes a single parameter and returns the C struct as several parameters.

sub _epochToRcsDateTime
{
   my( $dateTime ) = @_;
   # TODO: should this be gmtime or local time?
   my( $sec,$min,$hour,$mday,$mon,$year,$wday,$yday ) = gmtime( $dateTime );
   $year += 1900 if( $year > 99 );
   my $rcsDateTime = sprintf "%d.%02d.%02d.%02d.%02d.%02d", ( $year, $mon, $mday, $hour, $min, $sec );
   return $rcsDateTime;
}

It would be the unexpected date format that is really the issue - what where you doing when this error occured? If you were viewing a topic, could you please attach it (the full topic) to this one.

-- JohnTalintyre - 26 Jan 2003

i just installed the last beta topics with the code from the 20030201 apha and set RcsLite on. then i tried to save (from preview) a change to the TWikiGroups topic.

that returned the -1 error.

the following change in RcsLite.pm makes topic saves work on my system


# ======================
sub addRevision
{
    my( $self, $text, $log, $author, $date ) = @_;
    $self->_ensureProcessed();

    $self->_save( $self->file(), \$text );
    $text = $self->_readFile( $self->{file} ) if( $self->{attachment} );
    my $head = $self->numRevisions();
    if( $head ) {
        my $delta = _diffText( \$text, \$self->delta($head) );
        ${$self->{"delta"}}[$head] = $delta;
    }
    $head++;
    ${$self->{"delta"}}[$head] = $text;
    $self->{"head"} = $head;
    ${$self->{"log"}}[$head] = $log;
    ${$self->{"author"}}[$head] = $author;
#    $date = time() if( ! $date );
#    ${$self->{"date"}}[$head] = TWiki::Store::RcsFile::_epochToRcsDateTime( $date );


   my( $sec,$min,$hour,$mday,$mon,$year,$wday,$yday ) = gmtime();
   $year += 1900 if( $year > 99 );
   $mon += 1;   # SvenDowideit - off by one :)
   my $rcsDateTime = sprintf "%d.%02d.%02d.%02d.%02d.%02d", ( $year, $mon, $mday, $hour, $min, $sec );
   ${$self->{"date"}}[$head] = $rcsDateTime;

    warn "Sven $date\n";
    warn "Sven ".${$self->{"date"}}[$head]."\n";

    return $self->_writeMe();
}

this is on linux (debian unstable) with perl 5.8.0

-- SvenDowideit - 26 Jan 2003

see also MonthOutOfRangeWithRcsLite , I got Twiki with RCSLite running on my page with these fixes

-- SvenTissot - 27 Jan 2003

A comment about RcsLite. The RcsLite functionality for the rdiff script seems much slower than the RcsWrap impliementation. When I instealled RcsLite with mod_perl some googlebot queries caused the server to fall over. Meanwhile, these seem to work better with RcsWrap.

-- JosephWang - 10 Jun 2003

RcsLite will be slower than RCS as RCS uses optimised code written in C, the Perl code is, I think, not so well optimised, plus Perl is inherantly slower. I'm more concerned about the server falling over. For starters, where Robot exclusions set for the diffs? Certainly worth doing. Any chance you can re-create this situation?

-- JohnTalintyre - 10 Jun 2003

I'm killing this BugReport as RcsLite has changed a bit since then (and I think I've ironed out these issues -- SD

Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 2004-04-21 - SvenDowideit
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.