Edit conflicts can be resolved by using a diff3 algorithm (as used in patch)
- merge changes and send back editor
- if changes could not be resolved, mark conflicting changes with horizontal lines (patch like)
- give user a warning message
- update timestamp to avoid edit conflict next saving
- should be done for previews, too
MoniWiki use "merge" and show diff to resolve this conflict problem --WkPark
Implementation log
One problem is MoinMoin/PageEditor PageEditor.saveText(). It now returns a message. The save action displays the page and the message afterward. It is difficult to call PageEditor.send_editor() instead. And changing saveText() like in the patch is not possible because it is used by other code that doesn't want to display anything.
Solution: raise exception (PageEditor.WriteError, PageEditor.LockError, ...)
I've completely rewritten the merge code to not longer require difflib. It is much cleaner now.
Change is in tla now.
The merge is still a bit conservative. If both editors do exactly the same changes this is shown as conflict.
Preview returns merged source, too.