Item12709: Stores not reading latest when its a dirty Rev
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: n/a
While working on Versatile I deliberately created a text file to create an RCS dirty rev to test store Copy operations. The store recognised the extra revision and an active Foswiki site would display the changed text.
I had rev=8 as the latest and rev=9 dirty (and not latest).
However, I noticed during these copy operations that this dirty rev=9 was returned with rev=8 text.
I had to change the Copy code to incorporate this logic
if( $topic_version == $top_rev_list[0] ) { # is this the highest numbered rev?
$source_store->readTopic( $top_meta );
}
else {
$source_store->readTopic( $top_meta, $topic_version );
}
The Store readTopic API is not clear on this point. I expected the readTopic( $top_meta, 9 ) call to read and return the dirty rev. It appears that it's interpreted by the Store (
RcsLite and
RcsWrap anyway) as beyond the clean latest rev 8 and therefore not a valid rev and so it returns the latest rev. However, it was the Store itself that said there were revs 1..9 in the first place.
There is therefore a bug in the code or lack of clarity in the API.
Note that not all stores support dirty Revs and the Copy code forces the dirty rev to latest with
UnknownUser as the author.
As an aside,
RcsLite is more tolerant of errors than
RcsWrap (well at least some errors). This suggests recommending
RcsLite as the Store to convert from even if
RcsWrap is the live Store on the active Foswiki.
While you could argue it's a bug in
RcsWrap, there's not a lot we can do as we depend on an unsupported external tool and the bug lives there. I believe we are moving towards deprecating/removing
RcsWrap and this is another nail in it's coffin.
--
JulianLevens - 03 Jan 2014
Is this trunk or Release 1.1.x?
--
GeorgeClark - 03 Jan 2014
Trunk
--
JulianLevens - 04 Jan 2014