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

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. www.shengfang.org
锁定可能导致不必要的长篇大论。当张三正在编辑一个文本文件的开头部分,李四希望编辑同一个文件的结尾。这些修改根本不会交迭。他们可以轻松的同时编辑,不会产生大问题,这些修改可以正常的进行合并,不需要他们依次进行修改 www.shengfang.org

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. www.shengfang.org
锁定可能产生一个安全方面的错误判断,假设张三锁定并编辑文件A,当李四同时锁定和编辑文件B,但是A和B彼此关联依赖,而每个文件的修改造成语义冲突,突然A和B彼此不能一起工作,锁定系统也对预防这个问题无能为力。然而它提供了一种错误的安全假象,www.shengfang.org 很容易让张三和李四假设锁定之后,单独开始了一个安全的,绝缘的任务,因此不会在早期进行协商,解决彼此的冲突。

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和其他一些版本控制系统使用复制 修改 合并模型作为锁定的选择,这种模型,每个用户客户端访问项目仓库,创建个人工作副本,一个本地的仓库文件目录的映象,使用者彼此平行,修改他们的本地副本,最后,本地副本彼此合并成为一个新的、www.shengfang.org 最终的版本。版本控制系统经常帮助合并,但是最终还是需要人正确的进行合并。

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.
这里有一个例子,例如,张三和李四每个人 www.shengfang.org 创建同一个项目的工作副本,从仓库复制,他们并发工作,在他们的本地副本上对同一个文件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. www.shengfang.org
但是如果张三的修改和李四的修改冲突怎么办?这种情形成为冲突,它通常不是经常出现的问题。当李四要求他的客户端合并最新的仓库修改到他的本地副本的时候,他的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. www.shengfang.org
复制 修改 合并模型听起来有一些乱,但是实际上,它运行非常平稳,用户可以并行工作,不用彼此等待,当他们工作于同一个文件,它合并他们的大部分并发的修改,冲突是罕见的,解决冲突的时间总计还是少于由于锁定系统造成的时间浪费

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.
最后,还是一个重要的因素,用户交流,当用户缺少交流,语义和语法的冲突将增大,没有系统能够强制用户完美交流,没有系统能够检测语义 www.shengfang.org 冲突,因此因此锁定系统可以预防冲突是一个错误的印象,实际上,锁定系统比其他的更加抑制生产力。


字体:

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

2005年8月18日22:15星期四  [English] 追踪此文的RSS
提示:
此文还没有评论。

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



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

公告
Fire and Motion!

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

最新日志

最新评论

友情链接

日历

最新引用

搜索

归档

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