## Please edit system and help pages ONLY in the moinmaster wiki! For more
## information, please see MoinMaster:MoinPagesEditorGroup.
##master-page:HelpOnEditLocks
##master-date:2006-06-18 19:04:00
#acl MoinPagesEditorGroup:read,write,delete,revert All:read
#format wiki
#language zh

== 锁定并发编辑 ==

如果两个人试图同时编辑相同的维基网页，就会出现冲突。一种简单的处理方法是，当编辑者试图编辑一个正在被其他人编辑的网页时，向其显示冲突警告。

Moin的编辑锁定系统就具有这个功能。锁定包括三个级别：''warn''，''lock''和''None''(关闭)。

如果你将Moin配置为'''warn'''，当有人试图编辑正在被编辑的网页时，他们会看到一条警告信息，要求他们等到当前编辑完成之后再继续。

Moin可以被配置为在编辑过程中'''lock'''(锁定)页面。如果有人试图边界正在被编辑的网页，他们会看到一条信息，说明该网页已经被锁定，直到当前编辑者完成之后，他才可以编辑。

这个功能复杂的地方在于编辑工作可能开始却没有结束。比如：
 * 有人点击编辑链接，然后没有取消编辑工作，就点击某个链接离开了该页面。
 * 没有取消编辑就关闭了浏览器窗口。
 * 点击了后退按钮。
 * 有人开始编辑网页，然后忘记了，结果一直保持编辑状态。

这可能导致网页处于永远警告或者永远锁定状态。因此，'''warn'''和'''lock'''都有一个'''timeout'''(超时)功能。在指定的时间之后，该功能就超时终止了。注意，当你预览时，计时器会重新计时。如果你在编辑网页，预览表明你仍然在编辑网页，计时器会重新启动。如果你离开或者退出这个网页的时间超过预设值，那么编辑锁定就会失效，其他人就可以自由编辑这个网页了。

=== 配置 ===

`edit_locking` 变量控制着编辑锁定系统的行为。它可以设定为下列值:

 * `None`, 即没有编辑锁定。关闭编辑锁定功能，同时编辑网页时不会有警告或者锁定发生。

 * "`warn <timeout>`" 同时编辑网页时，Moin会警告编辑者，而编辑工作在指定时间后收到警告。比如 "`warn 10`" 表示编辑开始10分钟后Moin向编辑者发出警告。

 * "`lock <timeout>`" 在编辑开始后，Moin会在指定的时间内锁定网页。比如 "`lock 5`" 表示锁定网页5分钟。

=== 取消编辑 ===

根据上述关于超时功能的描述，如果你打开了编辑锁定功能，建议取消编辑时，总是使用'''取消'''按钮来取消编辑!

== 例子 ==

Sample interaction of John``Miller and Jane``Doe...

 no locking (None):: John``Miller starts editing a page and Jane``Doe thinks she'll edit the same page. She has no idea that someone else is editing the page so they both edit away and hit save. It doesn't matter who started first and did the most editing, whoever hits ''save changes'' first will have their changes committed and the unfortunate 2nd editor will have to try and merge their changes in or lose them.

 edit warnings (warn):: John``Miller starts editing a page and Jane``Doe thinks she'll edit the same page. When she hits edit she'll see a warning telling her that someone else got there first. If she is polite she'll leave the page, but she can still save before John and he may lose his changes.

 edit locking (lock):: John``Miller starts editing a page and Jane``Doe thinks she'll edit the same page. When she hits edit she'll see a warning telling her that someone else got there first and the page is locked. She will have to wait for the page to become available.
