*** lib/TWiki/Store.pm.orig Fri Apr 4 01:33:40 2003 --- lib/TWiki/Store.pm Fri Apr 4 01:45:44 2003 *************** *** 567,587 **** $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 --- 567,573 ---- $topicHandler->setLock( ! $doUnlock ); ! writeChanges( $web, $topic, $attachment, $topicHandler, $dontNotify, $time ); if( ( $TWiki::doLogTopicSave ) && ! ( $dontLogSave ) ) { # write log entry *************** *** 592,598 **** #### 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? --- 578,584 ---- #### 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? *************** *** 609,614 **** --- 595,601 ---- return $dataError if( $dataError ); $topicHandler->setLock( ! $doUnlock ); + writeChanges( $web, $topic, $attachment, $topicHandler, $dontNotify, $time ); if( ( $TWiki::doLogTopicSave ) && ! ( $dontLogSave ) ) { # write log entry $tmp = &TWiki::userToWikiName( $user ); *************** *** 641,646 **** --- 628,654 ---- } } return ""; # all is well + } + + # ========================= + 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); + } } # =========================