If we treated section' s path as its ID, we could get rid of most conflicts when editing sections.
''Disclaimer: this should work fairly well for two users in conflict. I'm not sure how scalable it is or needs to be.''
Construct paths from heading texts, separated by #. Where needed, add dissambig characters. Use the path to identify sections when editing.
Provide users with an option to either edit the section with it subsections (so the smallest needed part is edited when restructuring) or just the text of the section (to edit even less when appropriate).
So, users U1 and U2 are concurrently editing section S1 and S2 and then U1 saves the page with his version of S1. U2 tries to save the page with his edit of S2, but gets an edit conflict. What's to be done?
1) If S1 and S2 are same, show diff and let U2 handle it.
2 ) If S1 and S2 are disjunct (i.e. one is not included in the other), there is no conflict. Overwrite S2 with U2's version and save.
3) If S1 and S2 are not disjunct, we call the larger one (S) and the smaller one (s). Check if (s) exists in the newest version of (S).
3.1) If (s) doesn't exist, present U2 with the diff page for (S).
3.2) If (s) exists, and U1 changed its contents, present U2 with the diff.
3.3) If (s) exists, and the user who edited (S) did not change its contents, replace it with the version of the user who edited (s) (this is quite automagical, so if conservative, present U2 with the diff)
3.4) When U2 finally saves the page, record the version as an edit of (S) to ensure correct behaviour.
Additional tuning may be needed: Maybe show separate diff for (s) and show source of (s) in the version where it was directly chosen for editing .
What happens when U1 changed the title of the section, (or ordering of sections with the same names) but left the contents alone? Should we bother to check for it? Maybe keep CRC's of section contents? (They can be kept in the source- filter them out on display and edit, calculate new and store on save)
~~~~ zocky
zocky-
Construct paths from heading texts, separated by #. Where needed, add dissambig characters. Use the path to identify sections when editing.
What do you mean? Headers are already translated to anchors. Try http://en.wikipedia.org/wiki/Biology#Evolution_and_biology
If there are two or more headers of the same name, the duplicates will be numbered.
Provide users with an option to either edit the section with it subsections (so the smallest needed part is edited when restructuring) or just the text of the section (to edit even less when appropriate).
Yeah, that's been on my to do list for some time.
So, users U1 and U2 are concurrently editing section S1 and S2 and then U1 saves the page with his version of S1. U2 tries to save the page with his edit of S2, but gets an edit conflict. What's to be done?
... It's better to use a generic merge mechanism that is applicable to all edits, not just section edits. Then you just treat section edits like regular ones -- use the text constructed from the pre-conflict revision with inserted section as basis for the merge.
Regards,
Erik
Erik Moeller wrote:
It's better to use a generic merge mechanism that is applicable to all edits, not just section edits. Then you just treat section edits like regular ones -- use the text constructed from the pre-conflict revision with inserted section as basis for the merge.
Section edits require special attention, though. Currently in section editing, sections are identified solely by their number. If a user adds a section, all subsequent sections now have different numbers. Then if you get an edit conflict, and your generic merge mechanism tries to replace the old section with the new version, it will replace the wrong one.
It may be best to come up with some sort of system to uniquely identify a section. Maybe they should be identified by their title (which will only change if it itself is edited, but not when other sections are edited).
Greetings, Timwi
"T" == Timwi timwi@gmx.net writes:
T> It may be best to come up with some sort of system to uniquely T> identify a section. Maybe they should be identified by their T> title (which will only change if it itself is edited, but not T> when other sections are edited).
So, I had another idea, which is hard to implement, has limited scope, and would probably corrupt a lot of data before it got tested out.
http://meta.wikipedia.org/wiki/Edits_as_patches
Thought I'd throw it out there.
~ESP
Evan Prodromou wrote:
So, I had another idea, which is hard to implement, has limited scope, and would probably corrupt a lot of data before it got tested out.
http://meta.wikipedia.org/wiki/Edits_as_patches
Heh. I'm not sure I understand what you mean by "it has limited scope", but it's certainly worth considering.
Timwi
wikitech-l@lists.wikimedia.org