You are here: Foswiki>Tasks Web>Item10390 (06 Jul 2015, GeorgeClark)Edit Attach

Item10390: Meta documented as supporting missing revs ... doesn't

pencil
Priority: Normal
Current State: Proposal Required
Released In: n/a
Target Release: major
Applies To: Engine
Component: FoswikiMeta, FoswikiStore
Branches:
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
Meta::getLoadedRev is documented as returning "undef" if the requested rev is not in the store. However it returns the requested Rev number, while actually returning the data from the prior available rev.

I created a topic with a missing revision: (From rcs rlog command)
----------------------------
revision 1.4
date: 2011/02/21 03:05:10;  author: BaseUserMapping_333;  state: Exp;  lines: +1 -1
save topic
----------------------------
revision 1.2
date: 2011/02/21 02:13:36;  author: BaseUserMapping_333;  state: Exp;  lines: +4 -3
reprev
----------------------------

Viewing the topic with raw=debug;rev=3 shows from the metadata that Revision 2 is actually returned as the topic object. However the RCS chain at the bottom of the window shows r3 as the current version

%-META:TOPICINFO{author="BaseUserMapping_333" comment="save topic" date="1298254416" format="1.1" reprev="2" version="2"}%
...
 History: r13 | r4 < =r3= < r2 < r1 |

$topicObject->getLoadedRev() however returns 3 as the topic revision.

From the Meta->load() documentation:
   * =$rev= - revision to load. If undef, 0, '' or > max available rev, will
     load the latest rev. If the revision is in range but does not exist,
     then will return an unloaded meta object (getLoadedRev() will be undef)

In trying to write Topic Restore logic that cleanly restores old preferences, I attempted to detect this condition. However the code silently restores the prior version rather than returning an oops that the requested revision is not available.

-- GeorgeClark - 22 Feb 2011

Defer to 1.1.5 or 1.2.0

-- GeorgeClark - 23 Nov 2011

Defer to 2.0.

-- GeorgeClark - 02 Jun 2014
 

ItemTemplate edit

Summary Meta documented as supporting missing revs ... doesn't
ReportedBy GeorgeClark
Codebase 1.1.3 beta1, 1.1.2, trunk
SVN Range
AppliesTo Engine
Component FoswikiMeta, FoswikiStore
Priority Normal
CurrentState Proposal Required
WaitingFor
Checkins
TargetRelease major
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r7 - 06 Jul 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy