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.
New option "reset versions" in Import interface?
--
Artem Melentyev