You are here: Foswiki>Tasks Web>Item9969 (13 Dec 2011, GeorgeClark)Edit Attach

Item9969: REVINFO and $meta->getRevisionInfo() has issues when the ,v file is re-built after it was lost.

Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: FoswikiMeta, FoswikiStore, REVINFO
Reported By: SvenDowideit
Waiting For:
Last Change By: GeorgeClark
this shows up in the REVINFO macro in 1.1, but only affects getRevisioninfo in 1.0, so is a regression in 1.1

if you have a topic that has a rev > 0, and delete its ,v file, and then edit and save again, you get a new ,v file.

however, the revision history is a bit messed up. The ,v file will start fresh r1 with the .txt file, and then the save will be r2

# lets say that the metaINFO when we lost the ,v file was rev=4
my ($meta, $text) = Foswiki::Func::readTopic($web, $topic, 2);
my ($date, $author,$rev,$c) = meta->getRevisionInfo()= $meta->getRevisionInfo()
#rev == 2
my ($meta, $text) = Foswiki::Func::readTopic($web, $topic, 1);
my ($date, $author,$rev,$c) = meta->getRevisionInfo()= $meta->getRevisionInfo()
#rev = 4
my ($meta, $text) = Foswiki::Func::readTopic($web, $topic, 4);
my ($date, $author,$rev,$c) = meta->getRevisionInfo()= $meta->getRevisionInfo()
#rev = 2

imo that the rev returned by getRevisionInfo does not match is annoying, but slightly reasonable (it'd be better if the missing ,v file resulted in the first rev == 4, and the missing revs where undefined / empty..

but that readTopic of a future revision silently succeeds i think is bad.

-- SvenDowideit - 07 Nov 2010

If the ,v file is removed the revisions should start over from 1.

This is essential and I use this all the time when I make new applications by copying some old web at file system level. Then I copy and deleted the ,v files. It would be a major pain in the arse if I also have to hack the revision

And the number of support calls I will geg when a topic is rev 4. "where are revs 1-3?" will be the question over and over again.

No let the revision start at 1 when the ,v file is deleted.

And it is not a release blocker for 1.1.2 no matter what.

-- KennethLavrsen - 07 Nov 2010

This has been changed a bit Item10307. If rcs file is missing, the initial rev is rev 0. First save will create rev 1 for the existing topic in store, AND rev 2 for the initial changes. Bumped target release to 1.1.4 - no fixes committed to 1.1.2.

-- GeorgeClark - 12 Mar 2011

Kenneth is right, the history should start again from 1. There is no way to distinguish between a lost history, and a history that never existed e.g. a manual edit that happened to include TOPICINFO. The only rational course is to start again from 1.

Returning a rev 0 is IMHO a mistake, though I'm not going to start breaking 1.1.4 to assert that.

See Item10091 for what I'm doing on trunk.

-- CrawfordCurrie - 31 Aug 2011

I think this is no action - Revisions start over from Rev 1 now. That is the desired behavior

-- GeorgeClark - 13 Dec 2011

ItemTemplate edit

Summary REVINFO and $meta->getRevisionInfo() has issues when the ,v file is re-built after it was lost.
ReportedBy SvenDowideit
Codebase 1.1.1, trunk
SVN Range
AppliesTo Engine
Component FoswikiMeta, FoswikiStore, REVINFO
Priority Normal
CurrentState No Action Required
TargetRelease n/a
ReleasedIn n/a
Topic revision: r7 - 13 Dec 2011, 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