Last modified: 2014-08-29 08:26:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T64698, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62698 - Make it possible to specify what to do on edit conflict on action=edit
Make it possible to specify what to do on edit conflict on action=edit
Status: NEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: 70163 59982
  Show dependency treegraph
Reported: 2014-03-15 16:43 UTC by Peter Bena
Modified: 2014-08-29 08:26 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Peter Bena 2014-03-15 16:43:56 UTC
Currently mediawiki auto-merge edits on edit conflict. It would be more useful if it was possible to specify what should happen, for example there could be variable


automerge - would do what it does now
fail - would return an error in case there was any kind of edit conflict
overwrite - would ignore all edits of other people and would overwrite the page with new content

This is useful for things like antivandalism tools which need to deliver a message to users based on current content of their talkpage (the warning template level get adjusted based on templates currently present on the page). When two users post in same moment, the edit conflict get resolved by merging both messages, that have same level. Being able to fail on edit conflict would allow tool to redownload content of talk page and parse it again.

I believe that other bots / tools could use this as well when they edit the page based on current content of a page. Especially bots that are doing similar tasks.
Comment 1 Umherirrender 2014-03-15 17:36:40 UTC
Just for info: auto merge is mostly provided by diff3, which must not be not part of all mediawiki installation, but exist for wmf wikis. So the documentation for auto-merge should be mention, that merge is only done, when the software is there and it is a trivial merge without merge conflicts.
Comment 2 Brad Jorsch 2014-03-17 16:04:27 UTC
Note that this would need changes to EditPage::internalAttemptSave, it can't easily be done only in ApiEditPage. One additional test in the 'if' at should do it. We could either turn the "$bot" parameter into a flag parameter or add a new local for no-merge to EditPage that ApiEditPage would set.

Ideally we'd do the following:

* editconflictresolution=automerge as default. Requires starttimestamp and basetimestamp.
* editconflictresolution=fail would be the new code. It also would require starttimestamp and basetimestamp, and would pass the no-merge flag to EditPage.
* editconflictresolution=overwrite would be the same as what currently happens if you omit starttimestamp and basetimestamp. It would ignore starttimestamp and basetimestamp, and the docs would say something like "Using this mode is probably wrong, automerge should be used isntead.".

As for getting there from here (i.e. without breaking BC right away), we'd need to add a fourth case: rather than defaulting to automerge, editconflictresolution not given at all would do what the API does now and additionally include a warning if starttimestamp and basetimestamp weren't both specified.

Note You need to log in before you can comment on or make changes to this bug.