• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

After upgrading from 4.0.2 to 4.0.4, I'm finding that newly created topics are being marked as version 1.2 instead of version 1.1, although the RCS store is correct. The discrepancy disappears after the first revision of the topic (both *.txt and *.txt,v are marked as version 1.2, then 1.3, etc.). The problem only arises when using RcsLite, not RcsWrap.

Here's a example of the files generated for a new topic:

This is a test.

-- Main.JamesAnderson - 03 Aug 2006

head	1.1;
access	;
locks; strict;
comment	@@;

date	2006.;	author JamesAnderson;	state Exp;
next	;


@%META:TOPICINFO{author="JamesAnderson" date="1154599114" format="1.1" version="1.2"}%
This is a test.

-- Main.JamesAnderson - 03 Aug 2006

My setup is: Solaris 5.8, Perl 5.6.1, Apache 1.3.33, Intranet access only.

As for reproducibility, I've yet to find anyone else who has encountered this problem (I asked around on TWiki:Codev.TWikiIRC #twiki) but I can reproduce it any time I like on my system! wink

Update: I think I've tracked down the source of the problem. (Caveat: This is my first foray into the source code!)

From 4.0.2 to 4.0.3 (specifically, SVN revision 10180) the following two lines were inserted into TWiki::Store::RcsLite::numRevisions:

    # if state is is nocommav, there is only one revision
    return 1 if $this->{state} eq 'nocommav';

Unless I'm mistaken, 0 should be returned rather than 1 when there is no RCS store (as is the case with a new topic). What's currently happening is that numRevisions is returning 1 for a new topic, then this is incremented (in TWiki::Store::_noHandlersSave) and used as the version number. However, on the first revision of the topic, 1 is returned again and so the version number is correct from there on.

Can anyone with more knowledge of RcsLite confirm my diagnosis?

Anyway, I've 'corrected' this line in my own installation and now new topics are marked as version 1.1. Whether my 'correction' has broken other things remains to be seen...

I'm surprised no one else has reported this problem. Shouldn't it affect everyone using 4.0.3 or 4.0.4 with RcsLite?

-- TWiki:Main.JamesAnderson - 09 Aug 2006

Update 2: On further investigation, I think the line in question should be replaced with something like:

    if( $this->{state} eq 'nocommav' ) {
        return 1 if( -e $this->{file} );
        return 0;

This mirrors the logic of TWiki::Store::RcsWrap::numRevisions and should give the correct version number both for non-existent topics (0) and for manually added topic files (1).

-- TWiki:Main.JamesAnderson - 11 Aug 2006

Good debugging, James. Your analysis seems sound. You will be pleased to hear that the unit tests pass with your change in place. I would have been grateful for an updated test that showed the problem, but in the absence of one I have checked in anyway. 11456


Seems like an annoying bug for those using RcsLite so I add this to hotfix-4.0.4-4


closed with 4.0.5 KJL

Summary Newly created topics have wrong version number
ReportedBy TWiki:Main.JamesAnderson
Codebase 4.0.4, 4.0.3
SVN Range

AppliesTo Engine

Priority Normal
CurrentState Closed

Checkins 11456
TargetRelease patch
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2006-08-03 - JamesAnderson
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback