Wiki如何处理多个同时进行的编辑? [英] How does a wiki handle multiple simultaneous edits?

查看:579
本文介绍了Wiki如何处理多个同时进行的编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这总是在我的脑海中徘徊,所以我认为我不妨继续问下去.

This has always lingered in the back of my mind, so I figure I might as well go ahead and ask.

Wiki如何处理对同一内容的多次编辑?

How does a wiki handle multiple edits on the same content?

这是我要问的一个简单例子.假设页面具有以下内容:

Here's a simplistic example of what I'm asking. Let's say that a page has the following content:

我是专页!

I'm a page!

现在让我们说两个去编辑该页面.每个人都添加一个句子:

And now let's say that two go to edit that page. Each person adds a sentence:

第一个人:

我是专页!
我是同一页面中的第二句话!

I'm a page!
I'm a second sentence in the same page!

第二个人:

我是专页!
我是第二句话!

I'm a page!
I'm a second sentence!

想象每个人的第二句话与每个人要添加的页面主题具有同等相关但又不同的事实.

Imagine each person's second sentence being an equally relevant but different fact about the topic of the page that each person wanted to add in.

现在,假设第一个人先提交第二个人所做的更改,但是第二个人甚至没有机会看到第一个人所做的更改.最后一个人提交时,第二个人的更改是否会覆盖第一个人的更改?

Now let's say that person one submits their changes before person two does, but person two doesn't even get a chance to see the changes that person one made. Does person two's changes overwrite those of person one when he finally goes to submit?

是否可以使用差异/合并算法?

Is there a diff / merge algorithm that could be used for this?

推荐答案

我相信Wikipedia使用 a简单的diff/merge 算法,类似于大多数源代码控制软件的方式.

I believe Wikipedia uses a fairly simple diff/merge algorithm, similar to how most source code control software does it.

在您给出的示例中,它将引发合并冲突错误,因为无法知道最终标记中哪一行应该排在第一位.保存更改的第二个人将看到一个合并错误页面,在该页面中,他们必须选择解决冲突的方式.

In the example you gave, it would raise a merge conflict error, because there's no way for it to know which line should come first in the final markup. The second person to save their changes would be presented with a merge error page where they have to choose how to resolve the conflict.

但是请记住,维基百科处于并发用户规模的高端.对于大多数Wiki,使用非常简单的最后保存获胜"算法可能是可以接受的,其中第二个人的编辑仅覆盖第一个人的编辑.随着历史的增加,第一个人应该很容易发现他们的更改已被覆盖,然后再次将其重新添加.

Keep in mind, though, that wikipedia is on the high-end of the concurrent users scale. For the majority of wikis, it would probably be acceptable to use a very simple "last save wins" algorithm, where the second person's edits simply overwrites the first person's. With the addition of history, it should be easy for the first person to spot that their changes have been overwritten and add them back again.

我相信此解决方案是Stack Overflow使用的解决方案. SO还具有一项附加功能,即使用Ajax调用来通知编辑器是否有人进入并在完成之前修改页面.

I believe this solution is what Stack Overflow uses. SO has an additional feature where an Ajax call is used to notify the editor if someone else comes in and modifies the page before they're finished.

这篇关于Wiki如何处理多个同时进行的编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆