On 8/11/07, Artem Melentyev
<amelentev(a)gmail.com> wrote:
> Hi.
>
> Ludovic Dubost wrote:
> >
> > I have some Diff code that requires the data to be correct in the Database.
> > I agree that code polution is not great. So I suggest we write some code
> > to "fix and resave" without changing the document version number.
> > For this we need a "resave" api that does not change anything in the
> > document.
> Do you mean we need reconstruct only XWikiDocumentArchive without to set
> XWikiDocument.version?
>
> > What I don't like too much in Artem's proposed approach is the the
> > version inside the XML is different than the version in the RCS file.
> > I think it is still better to have them in sync.
> >
> > I propose to modify my fix patch but not to run it dynamically, but only
> > from an API in groovy and provide a groovy script to fix versions.
> > We'll explain in the release notes that this scripts needs to be called
> > for versioning to have the expected behavior.
>
> This is good solution.
>
> But we have another major problem with versions: XWIKI-1582.
> While xwiki is importing, packager plugin do not reset doc.version when
> history is not in xar. So we get doc.version>1.1 and
> archive.latestVersion=1.1. This bug is old. Catalin reproduces it on
> xwiki-1.1M1.
> There are many problems because we assume that archive is always begins
> at 1.1 in many places of core. All these problems can't be fixed for
> 1.1M4, so I think we need to set document.version to
> archive.latestVersion for sync versions.
>
> Ludovic: your patch is simple make -1 to all versions. This is not adapt
> to migration for XWIKI-1582. We need more. We need reconstruct history
> from scratch and set doc.versions according to document archive.
>
> I attached XWIKI-1468-resaveapi-amelentev.patch and fixrcs.groovy as sample.
> But these patches modify document.version and save document as new
> version with comment "fixrcs".
>
> WDYT?
>
http://jira.xwiki.org/jira/browse/XWIKI-1582
I added a remark to this issue, which has already been committed: I
created the preserveVersion option so that the version would be
preserved *whether or not* the history was attached to the document
(
http://jira.xwiki.org/jira/browse/XWIKI-1544).
The patch for XWIKI-1582 effectively reverses that behavior. There has
to be some other way to make RCS happy-- perhaps by making the version
of the document an attribute that doesn't have to directly match the
RCS version (where the value returned by getVersion is is the content
of the version field, rather than the value maintained by RCS).
I want to be able to install an application (say a panels app, or a
package containing many documents) on multiple wikis, and be able to
tell, based on the document versions, what version of the app I'm
running (which also implies the ability to ascertain whether or not
the documents have been customized).
Maybe the rest of you think it's an edge case, but it's something that
I think has value, and is why I opened the XWIKI-1544 and submitted
the patch introducing "preserveVersion" to begin with.
Erin
--
'Waste of a good apple' -Samwise Gamgee