Motivation
In
VarCachePlugin, the following code is there.
# CODE_SMELL: Assume file system for topics
$filename = TWiki::Func::getDataDir() . "/$theWeb/$theTopic.txt";
my $topicTime = (stat $filename)[9] || 10000000000;
Description and Documentation
TWiki::Func::getTopicLatestRevTime() calling TWiki::Store::getTopicLatestRevTime() would make the code above as follows.
my $topicTime = TWiki::Func::getTopicLatestRevTime($theWeb, $theTopic) || 10000000000;
Examples
Impact
Implementation
--
Contributors:
Hideyo Imazu - 2020-01-22
Discussion
This is one possible way. Here is another option: Ther is already a
TWiki::getRevisionInfo(). It could be enhanced to return one more item, a
$revTime.
For performance in
TWiki::getRevisionInfo(), if input
$rev is missing, the top rev is assumed, and info taken from topic, not rcs file.
What do you think?
--
Peter Thoeny - 2020-01-22
TWiki::Func::getRevisionInfo() returns
( $date, $user, $rev, $comment ) and
$date is the value what we want here. In terms of efficiency, now I think
getRevisionInfo() not taking
$meta as an argument is an issue. Because of that, to return
$user,
getRevisionInfo() has no option but read and parse the topic data. I'm abandoning this proposal and make a new proposal
TWikiFuncGetRevisionInfoTakingMeta to enhance
TWiki::Func::getRevsionInfo() so that it takes
$meta as an argument and makes use of
$meta. Once the new proposal is accepted, I will make this rejected.
--
Hideyo Imazu - 2020-01-24
The new
TWikiFuncGetRevisionInfoTakingMeta proposal looks good.
--
Peter Thoeny - 2020-01-26