On 02/08/2017 10:05 AM, Thomas Mortagne wrote: > On Wed, Feb 8, 2017 at 3:53 PM, Sergiu Dumitriu <ser...@xwiki.org> wrote: >> I wouldn't want to have empty revisions. >> >> If you want to change the import, then you can manually call >> doc.setContentDirty(true). > > "So the question is do we force metadata dirty to true all the time in > the instance output filter" > > Again the subject here is default import mode only. We are not talking > about XWiki#saveDocument and I would be -1 to force new revision all > the time since we have use cases for this.
Yep, and I was agreeing. >> >> On 02/08/2017 08:33 AM, Thomas Mortagne wrote: >>> Hi devs, >>> >>> We have a unintended regression in the standard import: if what you >>> import is identical to what is already in the database (including the >>> author) it won't add a new version (if you use the default option "Add >>> a new version to the existing page"). >>> >>> What happen in practice is that if you keep calling XWikiDocument#set* >>> methods with the same data it won't update the metadata or content >>> dirty flags. This flags are what hibernate store look at to know if it >>> should add a new version or not. >>> >>> You can reproduce the same behavior with a simple script which load a >>> document, always set the same content and save. You will notice that >>> the history of that document does not change. >>> >>> So the question is do we force metadata dirty to true all the time in >>> the instance output filter or do we keep this feature (in which case >>> we should optimize it a bit to not do the useless XWiki#saveDocument >>> but that's another subject). >>> >>> WDYT ? >>> >>> It could be seen as a nice feature but in practice my first reaction >>> was WTF and you often want to be sure the import actually did >>> something so I'm +1 to force metadata dirty. But I'm +0 to keep the >>> current behavior if there is a majority for it. >>> >> >> >> -- >> Sergiu Dumitriu >> http://purl.org/net/sergiu > > > -- Sergiu Dumitriu http://purl.org/net/sergiu