What methods do wikis use to merge parallel changes?

If two users edit the same section of the wiki, what methods were used in wikis (or in similar collaboration software) to merge the second user rights with the first?

I need a solution that:

  • no lock required
  • does not lose any additions to the page.
  • He can add additional “template” text to indicate where the various changes were made.

(I'm interested in a solution that can be used to implement this idea of ​​uservoice for.)

+7
merge wiki
source share
7 answers

TWiki automatically merges Concurrent Changes .

TWiki allows several simultaneous changes to the same theme, and then automatically changes the various changes. You probably won't even notice this unless there is a conflict that cannot be automatically combined. In this case, you can see how TWiki inserts “label changes” into the text to highlight the conflicts between your changes and the other person. These change labels are only used if you are editing the same part of the topic as someone else, and they indicate what the text looked like, what the other person was made to, and what your changes were.

TWiki will warn you if you try to edit a topic that someone is editing. He will also warn that merging is required during the save.

In addition, some documentation was developed from this function, which describes in detail how it will behave.

The basic principles that I used in coding the merge algorithm were as follows:

  • If merging is possible without the use of conflict markers, do so.
  • If merging using conflict markers is possible, do so.
  • If this cannot be combined, the last session wins.

It is worth noting that TWiki has a similar function in Qaru to collapse subsequent changes by the same user for a certain period of time, and this caused an error when it occurs with the merge .

  • User A is editing a topic.
  • User A saves rev N
  • User B edits the topic, selects rev N
  • User edits topic again, selects rev N
  • User A saves the changes; does save see the change is within the ReplceIfEditiedWithin? window, so do not increase the speed
  • User B saves, the code sees that the turnover number on the disk has not changed since they started editing , so the need for merging is not detected.

It is also worth noting that TWiki warns the second user that the topic is being edited:

So, I came up with the concept of "rent." When a topic is edited, rent is taken on the topic for a fixed period of time (default is 1 hour). If someone else is trying to edit, they are informed that there is already a rental on this topic, but this does not prevent them from editing. This is not a castle, but simply a way to advise them. Consolidation is still the primary resolution mechanism; rent is purely advisory. If the user - or the plugin - prefers to move away from the topic, because someone has leasing on it, well, what about the plugin.

A descriptive comment in TWiki.cfg is as follows:

# When a topic is edited, the user takes a "lease" on that topic. # If another user tries to also edit the topic while the lease # is still active, they will get a warning. The warning text will # be different depending on whether the lease has "expired" or # not ie if it was taken out more than LeaseLength seconds ago. 

Please note that rental terminology is for developers only and not for end users.

+3
source share

My experience with most Wiki programs (such as MediaWiki) is that it keeps track of the version of the document you are editing. If the document changes during time editing, your change is rejected and you are prompted to perform manual merging.

+2
source share

You can write a “lock” in another database table with a user ID and time and remove the “lock” (which is not a real lock for those who do not understand) when a person saves or after x minutes.

Thus, when someone is trying to edit, and someone is already doing it. The message may appear with the remaining time OR, simply saying that someone else is editing the message.

0
source share

Well, you could use a merge algorithm, like the one used by version control software. You probably want it to check for changes at the paragraph level in order to maintain readability.

If there is a potential conflict (for example, two users editing the same paragraph), you probably need to simply submit both versions with the text of the template and / or notify the second and subsequent senders that the contents of their message may be changed from what they presented.

0
source share

Ok, now I think it will be a terrible, scary idea. Let me be honest: merging is pretty self-serving in the code, and it at least has elements that can be isolated. Do not do this - the human mind will always be better. Instead, you are trying to replace it with an automatic solution, which can lead to a result that is not normal, without any advantages.

0
source share

In researching the TWiki answer, I also stumbled upon SynchroEdit , which looks like SubEthaEdit , a browser-based concurrent multi-user editor. It looks like it was closed in September 2007, but the source code is available for download.

0
source share

For documentation: DokuWiki puts a 15-minute lock on edited pages, which is updated whenever you view your changes (i.e. 15 minutes from your preview or the start of editing).

0
source share

All Articles