*** lib/TWiki/Store.pm.orig Tue Jan 4 16:26:06 2005 --- lib/TWiki/Store.pm Tue Jan 4 17:53:53 2005 *************** *** 853,873 **** $topicHandler->setLock( ! $doUnlock ); ! if( ! $dontNotify ) { ! # update .changes ! my( $fdate, $fuser, $frev ) = getRevisionInfo( $web, $topic, "", $attachment, $topicHandler ); ! $fdate = ""; # suppress warning ! $fuser = ""; # suppress warning ! ! my @foo = split( /\n/, &readFile( "$TWiki::dataDir/$TWiki::webName/.changes" ) ); ! if( $#foo > 100 ) { ! shift( @foo); ! } ! push( @foo, "$topic\t$TWiki::userName\t$time\t$frev" ); ! open( FILE, ">$TWiki::dataDir/$TWiki::webName/.changes" ); ! print FILE join( "\n", @foo )."\n"; ! close(FILE); ! } if( ( $TWiki::doLogTopicSave ) && ! ( $dontLogSave ) ) { # write log entry --- 853,859 ---- $topicHandler->setLock( ! $doUnlock ); ! writeChanges( $web, $topic, $attachment, $topicHandler, $dontNotify, $time ); if( ( $TWiki::doLogTopicSave ) && ! ( $dontLogSave ) ) { # write log entry *************** *** 880,886 **** #### 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 # FIXME why should date be the same if same user replacing with editLockTime? --- 866,872 ---- #### Replace Revision Save if( $saveCmd eq "repRev" ) { ! # fix topic by replacing last revision # save topic with same userName and date # FIXME why should date be the same if same user replacing with editLockTime? *************** *** 896,901 **** --- 882,888 ---- return $dataError if( $dataError ); $topicHandler->setLock( ! $doUnlock ); + writeChanges( $web, $topic, $attachment, $topicHandler, $dontNotify, $time ); if( ( $TWiki::doLogTopicSave ) && ! ( $dontLogSave ) ) { # write log entry my $extra = "repRev $rev "; *************** *** 932,937 **** --- 919,952 ---- } } return ""; # all is well + } + + =pod + + ---++ sub writeChanges ( $web, $topic, $attachment, $topicHandler, $dontNotify, $time ) + + Not yet documented. + + =cut + + sub writeChanges + { + my( $web, $topic, $attachment, $topicHandler, $dontNotify, $time ) = @_; + if( ! $dontNotify ) { + # update .changes + my( $fdate, $fuser, $frev ) = getRevisionInfo( $web, $topic, "", "", $attachment, $topicHandler ); + $fdate = ""; # suppress warning + $fuser = ""; # suppress warning + + my @foo = split( /\n/, &readFile( "$TWiki::dataDir/$TWiki::webName/.changes" ) ); + if( $#foo > 100 ) { + shift( @foo); + } + push( @foo, "$topic\t$TWiki::userName\t$time\t$frev" ); + open( FILE, ">$TWiki::dataDir/$TWiki::webName/.changes" ); + print FILE join( "\n", @foo )."\n"; + close(FILE); + } } =pod