XWIKI-10036: It's possible to modify a document without getting a new entry in the history
* fix some use cases (a new history entry should be added only there is not not only one). We really need a more clear API, doing revert trough standard saveDocument API is super hacky...

(cherry picked from commit f43ef8f7402955a32e282cf41109dba6f44c5aed)