I'm writing a script in Perl using the TWiki modules. I'm able to do everything as described in the documentation, however I can't seem to get the version of the document to increase as I edit.
Here's a general flow of how I edit the document:
- Check for an edit lock using TWiki::Func::checkTopicEditLock
- Lock the document using TWiki::Func::setTopicEditLock
- Read the text using TWiki::Func::readTopicText (not passing a revision parameter so that it assumes the top-level revision)
- Modify the text in various ways, including updating the meta-data with an incremented version number (using TWiki::Func::getRevisionInfo to get the current revision)
- Write back the updated text using TWiki::Func::saveTopicText
After this procedure, the twiki is definitely updated, however the revision stays the same. If the initial revision is 1.5, and I update the meta-data to 1.6, the revised page still appears as version 1.5 when viewing it on the web. The next time I do a TWiki::Func::getRevisionInfo, the revision is returned as 1.5 again.
I think I must be missing something...is there something extra that has to be done to make TWiki do a diff and update the revision?
--
PaulKrizak - 20 Apr 2004
Paul,
the easy answer is to set your $TWiki::doKeepRevIfEditLock to "0" in the
TWikiDotCfg file. This will affect all your users however. Otherwise, we'd need to add yet another parameter to the save functions (I think) - which will take a bit of mucking about
--
SvenDowideit - 21 Apr 2004
So this is a known limitation of the TWiki:: perl modules? If so, then that's fine; I just wanted to make sure I was doing everything "right"
--
PaulKrizak - 22 Apr 2004 - 14:47
- Y, its supposedly a feature but many of us turn it off on the grounds that it is counter-intuitive. --
MartinCleaver - 22 Apr 2004 - 16:33