From: Peter T. <pet...@us...> - 2001-11-30 08:43:51
|
Update of /cvsroot/twiki/twiki/lib/TWiki In directory usw-pr-cvs1:/tmp/cvs-serv6318/TWiki Modified Files: Store.pm Log Message: Codev.FixingTopicChangesUser fix Index: Store.pm =================================================================== RCS file: /cvsroot/twiki/twiki/lib/TWiki/Store.pm,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -r1.43 -r1.44 *** Store.pm 2001/11/01 10:26:54 1.43 --- Store.pm 2001/11/30 08:43:48 1.44 *************** *** 484,488 **** my( $theWebName, $theTopic, $attachment ) = @_; my $ret = getRevisionNumberX( $theWebName, $theTopic, $attachment ); ! TWiki::writeDebug( "Store: rev = $ret" ); if( ! $ret ) { $ret = "1.1"; # Temporary --- 484,488 ---- my( $theWebName, $theTopic, $attachment ) = @_; my $ret = getRevisionNumberX( $theWebName, $theTopic, $attachment ); ! ##TWiki::writeDebug( "Store: rev = $ret" ); if( ! $ret ) { $ret = "1.1"; # Temporary *************** *** 558,562 **** $tmp =~ s/[<>]\s*%META:TOPICINFO{[^}]*}%\s*//go; ! TWiki::writeDebug( "and now $tmp" ); } return "$tmp"; --- 558,562 ---- $tmp =~ s/[<>]\s*%META:TOPICINFO{[^}]*}%\s*//go; ! ##TWiki::writeDebug( "and now $tmp" ); } return "$tmp"; *************** *** 692,706 **** sub metaAddTopicData { ! my( $web, $topic, $rev, $meta, $forceDate ) = @_; ! ! my $time; ! if( $forceDate ) { ! $time = $forceDate; ! } else { ! $time = time(); ! } ! ! my $user = $TWiki::userName; ! my @args = ( "version" => "$rev", --- 692,700 ---- sub metaAddTopicData { ! my( $web, $topic, $rev, $meta, $forceDate, $forceUser ) = @_; ! ! my $time = $forceDate || time(); ! my $user = $forceUser || $TWiki::userName; ! my @args = ( "version" => "$rev", *************** *** 808,812 **** sub _saveWithMeta { ! my( $web, $topic, $text, $attachment, $doUnlock, $nextRev, $meta, $forceDate ) = @_; if( ! $attachment ) { --- 802,806 ---- sub _saveWithMeta { ! my( $web, $topic, $text, $attachment, $doUnlock, $nextRev, $meta, $forceDate, $forceUser ) = @_; if( ! $attachment ) { *************** *** 817,821 **** } ! metaAddTopicData( $web, $topic, $nextRev, $meta, $forceDate ); $text = $meta->write( $text ); --- 811,815 ---- } ! metaAddTopicData( $web, $topic, $nextRev, $meta, $forceDate, $forceUser ); $text = $meta->write( $text ); *************** *** 1000,1011 **** #### Replace Revision Save if( $saveCmd eq "repRev" ) { ! # fix topic by replacing last revision ! ! $nextRev = $currentRev; ! $text = _saveWithMeta( $web, $topic, $text, $attachment, $doUnlock, $nextRev, $meta ); ! # update repository with same userName and date, but do not update .changes ! my $rev = getRevisionNumber( $web, $topic, $attachment ); ! my( $date, $user ) = getRevisionInfo( $web, $topic, $rev, "", $attachment ); if( $rev eq "1.1" ) { # initial revision, so delete repository file and start again --- 994,1009 ---- #### Replace Revision Save if( $saveCmd eq "repRev" ) { ! # fix topic by replacing last revision, but do not update .changes ! ! # save topic with same userName and date ! my( $date, $user, $rev ) = getRevisionInfo( $web, $topic, "", 1, $attachment ); ! $rev = "1.$rev"; ! # Add two minutes (make small difference, but not too big for notification) ! my $epochSec = &TWiki::revDate2EpSecs( $date ) + 120; ! $date = &TWiki::formatGmTime( $epochSec, "rcs" ); ! $text = _saveWithMeta( $web, $topic, $text, $attachment, $doUnlock, $rev, ! $meta, $epochSec, $user ); ! # update repository with same userName and date if( $rev eq "1.1" ) { # initial revision, so delete repository file and start again |