Artem Melentyev wrote:
Hi.
Ludovic Dubost wrote:
But what for the latest version of the document..
It could still be
wrong compared to the last RCS version
It will be sync on next save.
I think this is not too important.
IMHO any bug-specific migrations(as XWIKI-1468-B) in
xwiki-platform-core is bad. Because:
it is decrease performance
fast to obsolete
pollution core code
If we really need migration maybe we need create migration system.
Something like: store data version in db, xwiki will execute
migrations at boot. Migrations will be like patches from one data
version to another.
(XWIKI-883 also need migration)
WDYT?
Indeed, any migration should be performed only once, when the platform
starts. And to speed things up even more, we can even put a version
identifier in the database, equal to the svn version or the build
number, and only if the stored version differs from the current version
we perform the update.
Artem
Melentyev a écrit :
> Hi.
>
> I'm sorry for hasn't replied early. I had problems with spam filters
> :/.
>
> I fix this problem in XWIKI-1459 in >=XWIKI-1459-2-r2.patch.zip
> (18.07) yet.
>
> My implementation:
> Before I save document, I do
> document.setVersion(~archive.getLatestVersion()+1)
> After I load a specific version of document, I do
> doc.setVersion(thisversion)
>
> So document.version is fully depends on rcs store. We don't need to
> store version in xml.
> No need for special migration.
> Version numbers may be any.
>
> Ludovic Dubost wrote:
>> Erin Schnabel a écrit :
>>
>> [snip]
>>> I prefer to allow document versions to start at an arbitrary number
>>> (i.e. if I've imported the document from another wiki, I like to
>>> preserve the version of the document from the original wiki in the
>>> target wiki). This means that the first version of the document
>>> may be
>>> 1.9, and that's certainly a lot more than one version off...
>>>
>> That's indeed possible to do. The versions don't need to be off
>> though.. The document version will match the version in RCS.
>> It's not a problem to have versions start at a certain number. This
>> happens if the resetVersion API is called.
>>
>> The problem is different than this out of sync issue between RCS
>> and the current document version. Here our problem is that the RCS
>> version does not match what you have in the archived XML document..
>>
>> I've made progress with my fix. You can check out a fix in
>>
http://jira.xwiki.org/jira/browse/XWIKI-1468
>>
>> Now for your suggestion of having imports not resetting version, I
>> think both cases are interesting. Sometimes we want to reset (like
>> when importing a default wiki).
>> There will need to be an option to decide if you want to reset
>> version numbers or not.