首页 Soft PlugIn RAN乱 Dev开发 Info资料 English WAP 留言 登陆 注册
-
Posted by Yippee | 评论(0) | 引用(2) | 阅读1666次
Tortoisesvn帮助-版本控制模型1

Locking may cause unnecessary serialization. What if Harry is editing the beginning of a text file, and Sally simply wants to edit the end of the same file? These changes don't overlap at all. They could easily edit the file simultaneously, and no great harm would come, assuming the changes were properly merged together. There's no need for them to take turns in this situation.
锁定可能导致不必要的长篇大论。当张三正在编辑一个文本文件的开头部分,李四希望编辑同一个文件的结尾。这些修改根本不会交迭。他们可以轻松的同时编辑,不会产生大问题,这些修改可以正常的进行合并,不需要他们依次进行修改

Locking may create a false sense of security. Pretend that Harry locks and edits file A, while Sally simultaneously locks and edits file B. But suppose that A and B depend on one another, and the changes made to each are semantically incompatible. Suddenly A and B don't work together anymore. The locking system was powerless to prevent the problem—yet it somehow provided a false sense of security. It's easy for Harry and Sally to imagine that by locking files, each is beginning a safe, insulated task, and thus not bother discussing their incompatible changes early on.
锁定可能产生一个安全方面的错误判断,假设张三锁定并编辑文件A,当李四同时锁定和编辑文件B,但是A和B彼此关联依赖,而每个文件的修改造成语义冲突,突然A和B彼此不能一起工作,锁定系统也对预防这个问题无能为力。然而它提供了一种错误的安全假象,很容易让张三和李四假设锁定之后,单独开始了一个安全的,绝缘的任务,因此不会在早期进行协商,解决彼此的冲突。

The Copy-Modify-Merge Solution 复制 修改 合并 模型
Subversion, CVS, and other version control systems use a copy-modify-merge model as an alternative to locking. In this model, each user's client contacts the project repository and creates a personal working copy—a local reflection of the repository's files and directories. Users then work in parallel, modifying their private copies. Finally, the private copies are merged together into a new, final version. The version control system often assists with the merging, but ultimately a human being is responsible for making it happen correctly.
subversion cvs和其他一些版本控制系统使用复制 修改 合并模型作为锁定的选择,这种模型,每个用户客户端访问项目仓库,创建个人工作副本,一个本地的仓库文件目录的映象,使用者彼此平行,修改他们的本地副本,最后,本地副本彼此合并成为一个新的、最终的版本。版本控制系统经常帮助合并,但是最终还是需要人正确的进行合并。

Here's an example. Say that Harry and Sally each create working copies of the same project, copied from the repository. They work concurrently, and make changes to the same file A within their copies. Sally saves her changes to the repository first. When Harry attempts to save his changes later, the repository informs him that his file A is out-of-date. In other words, that file A in the repository has somehow changed since he last copied it. So Harry asks his client to merge any new changes from the repository into his working copy of file A. Chances are that Sally's changes don't overlap with his own; so once he has both sets of changes integrated, he saves his working copy back to the repository. Figure 2.4, “The copy-modify-merge solution” and Figure 2.5, “The copy-modify-merge solution (continued)” show this process.
这里有一个例子,例如,张三和李四每个人创建同一个项目的工作副本,从仓库复制,他们并发工作,在他们的本地副本上对同一个文件A进行修改,张三首先提交他的修改到仓库,当李四随后试图保存他的修改,仓库提示他文件A已经过期了,换句话说,文件A仓库里的,已经自从他最后一次复制后被修改了,因此李四要求他的客户端从仓库合并最新的修改到他的本地副本A,张三所作的修改不会覆盖他自己的,最后他得到了一个综合的修改,他再提交他的本地副本到仓库

Figure 2.4. The copy-modify-merge solution 复制 修改 合并 方案


Figure 2.5. The copy-modify-merge solution (continued) 继续


But what if Sally's changes do overlap with Harry's changes? What then? This situation is called a conflict, and it's usually not much of a problem. When Harry asks his client to merge the latest repository changes into his working copy, his copy of file A is somehow flagged as being in a state of conflict: he'll be able to see both sets of conflicting changes, and manually choose between them. Note that software can't automatically resolve conflicts; only humans are capable of understanding and making the necessary intelligent choices. Once Harry has manually resolved the overlapping changes—perhaps after a discussion with Sally—he can safely save the merged file back to the repository.
但是如果张三的修改和李四的修改冲突怎么办?这种情形成为冲突,它通常不是经常出现的问题。当李四要求他的客户端合并最新的仓库修改到他的本地副本的时候,他的A文件副本被标记为冲突状态,他可以查看所有冲突的修改部分,手工选择 重叠修改-多半和张三讨论以后,他可以安全的保存合并后的文件到仓库

The copy-modify-merge model may sound a bit chaotic, but in practice, it runs extremely smoothly. Users can work in parallel, never waiting for one another. When they work on the same files, it turns out that most of their concurrent changes don't overlap at all; conflicts are infrequent. And the amount of time it takes to resolve conflicts is far less than the time lost by a locking system.
复制 修改 合并模型听起来有一些乱,但是实际上,它运行非常平稳,用户可以并行工作,不用彼此等待,当他们工作于同一个文件,它合并他们的大部分并发的修改,冲突是罕见的,解决冲突的时间总计还是少于由于锁定系统造成的时间浪费

In the end, it all comes down to one critical factor: user communication. When users communicate poorly, both syntactic and semantic conflicts increase. No system can force users to communicate perfectly, and no system can detect semantic conflicts. So there's no point in being lulled into a false promise that a locking system will somehow prevent conflicts; in practice, locking seems to inhibit productivity more than anything else.
最后,还是一个重要的因素,用户交流,当用户缺少交流,语义和语法的冲突将增大,没有系统能够强制用户完美交流,没有系统能够检测语义冲突,因此因此锁定系统可以预防冲突是一个错误的印象,实际上,锁定系统比其他的更加抑制生产力。

Versioning Models  版本控制模型 www.shengfang.org
The core mission of a version control system is to enable collaborative editing and sharing of data. But different systems use different strategies to achieve this.
版本控制系统的核心功能就是运行协同编辑和共享数据,但是不同的系统使用不同的策略实现

The Problem of File-Sharing 文件共享难题 www.shengfang.org
All version control systems have to solve the same fundamental problem: how will the system allow users to share information, but prevent them from accidentally stepping on each other's feet? It's all too easy for users to accidentally overwrite each other's changes in the repository.
所有的版本控制系统必须解决同一个基本难题:如何允许用户共享信息,但是防止他们意外的打乱彼此的脚步。对用户来说,覆盖别人在仓库里面的修改太容易了 www.shengfang.org

Consider the scenario shown in Figure 2.2, “The problem to avoid”. Suppose we have two co-workers, Harry and Sally. They each decide to edit the same repository file at the same time. If Harry saves his changes to the repository first, then it's possible that (a few moments later) Sally could accidentally overwrite them with her own new version of the file. While Harry's version of the file won't be lost forever (because the system remembers every change), any changes Harry made won't be present in Sally's newer version of the file, because she never saw Harry's changes to begin with. Harry's work is still effectively lost—or at least missing from the latest version of the file—and probably by accident. This is definitely a situation we want to avoid!
考虑一下如图所示特定的情形,避免问题。如果我们有两个工人,他们同时决定修改同一个仓库文件,如果哈尼先保存他的修改到仓库,一段时间以后,sally可能意外的用他的最新修改版本覆盖了这个文件,虽然harry的版本永远不会丢失,因为系统记住了每一个修改,所有harry的修改都没有出现在sally的新版本文件,因为他从来没有看到harry的修改,张三的修改仍然是有效的丢失了,或者知道从最新版本的文件中丢失了,也许是意外。这就是我们希望避免的问题 www.shengfang.org

The Lock-Modify-Unlock Solution 锁定-修改-锁定解决方案
Many version control systems use a lock-modify-unlock model to address this problem. In such a system, the repository allows only one person to change a file at a time. First Harry must “lock” the file before he can begin making changes to it. Locking a file is a lot like borrowing a book from the library; if Harry has locked a file, then Sally cannot make any changes to it. If she tries to lock the file, the repository will deny the request. All she can do is read the file, and wait for Harry to finish his changes and release his lock. After Harry unlocks the file, his turn is over, and now Sally can take her turn by locking and editing. Figure 2.3, “The lock-modify-unlock solution” demonstrates this simple solution.
许多版本控制系统使用锁定-修改-解锁模型来解决这个问题,在这种系统中,仓库每次只允许一个人修改文件,首先张三必须在修改之前锁定文件,锁定文件类似于从图书馆借出一本书,如果张三锁定了文件,那么李四就不能作任何修改,如果他试图锁定文件,仓库将拒绝这个请求,他只能读取文件,等待张三完成他的修改并释放锁定,在张三解锁文件后,他的过程结束,www.shengfang.org 现在李四能够进入他的工作锁定修改文件。

The problem with the lock-modify-unlock model is that it's a bit restrictive, and often becomes a roadblock for users:
这个模型的问题在于它是限制性的,www.shengfang.org 经常带来一些障碍

Locking may cause administrative problems. Sometimes Harry will lock a file and then forget about it. Meanwhile, because Sally is still waiting to edit the file, her hands are tied. And then Harry goes on vacation. Now Sally has to get an administrator to release Harry's lock. The situation ends up causing a lot of unnecessary delay and wasted time.
锁定可能导致管理问题,有时张三锁定了文件,然后忘记了,这段时间,由于李四仍然在等待编辑文件,他的手不停的尝试,但是此时张三仍然度假,现在李四必须获得超级管理员权限来释放张三的锁定。这个情形将导致不必要的延时和时间浪费 www.shengfang.org


字体:

Permanant URI永久地址 http://www.shengfang.org/blog/p/tsvnhlpvermodel1.php
Trackback URI引用地址 http://www.shengfang.org/blog/tb.php?tb_id=1124199691

2005年8月16日21:41星期二  [English] 追踪此文的RSS
提示:
此文还没有评论。

称呼:    登陆   注册
   不注册,但记住我的信息
邮件:
(非必须)
评论: [UBB代码帮助]
粗体 斜体 下划线 链接 水平线 引用



验证码: 请输入你看见的数字
关闭UBB      提交时自动将内容复制到剪贴板

公告
Fire and Motion!

统计信息
[Yippee]||[统计]||日志:1790
在线: 13||用户: 2562 [列表]
今日:2384||到访:2671883
Rss:838500||评论:1584

最新日志

最新评论

友情链接

日历

最新引用

搜索

归档

杂项
Get RSS Feed (Version 2.0)
Get Atom Feed (Version 0.3)
编码:  UTF-8