Perforce 开发分支 - 稀疏分支与私有分支 [英] Perforce Dev Branches - Sparse Branching vs. Private Branching

查看:73
本文介绍了Perforce 开发分支 - 稀疏分支与私有分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关可用于在 Perforce 软件仓库中创建单个开发分支的方法的优缺点的反馈.如果我理解正确,有两种处理方法.首先是创建一个私有分支,它是您正在处理的分支的完整副本.该分支将完全独立,并将您的更改与目标分支完全隔离.

I'm looking for some feedback on the advantages and disadvantages of the methods available for creating individual development branches in a Perforce depot. If I understand correctly, there are two ways of handling this. The first is to create a Private branch, which is a complete copy of the branch that you are working on. The branch would completely stand on its own and completely isolate your changes from the target branch.

我听说过的另一种推荐方法是稀疏分支.它在 Practical Perforce(第 9 章,第 242 页)中进行了描述.这将创建一个分支,但仅包含您需要编辑的文件.然后,您将目标分支客户端视图与这个稀疏的开发分支客户端视图重叠.

The other method that I've heard recommended is Sparse branching. It is described in Practical Perforce (Chapter 9, p.242). This creates a branch, but only with the files that you will need to edit. You then overlap the target branch client view with this sparse dev branch client view.

这两种方法都需要程序员执行一些集成工作,以便在目标分支中获取更改.Private Branch 方法似乎需要更多的额外内存才能创建整个分支的副本.但是,Perforce 文档指出它在这种情况下执行惰性复制".

Both methods would require the programmer to perform some integration work in order to get their changes in the target branch. The Private Branch method seems like it would require a lot more additional memory in order to create a copy of the whole branch. However, the Perforce documentation states that it performs a "lazy copy" in this situation.

集成还使 Perforce 能够执行文件的惰性复制".当你分支时文件,服务器实际上并不保存文件的两个副本——它只保存源文件,数据库中的一个指针记录了到目标文件的分支已经发生的事实.懒惰的副本使分支成为一种低开销的操作;服务器不必跟踪文件的重复副本.

Integration also enables Perforce to perform a "lazy copy" of the files. When you branch files, the server does not actually hold two copies of the files - it merely holds the source file and a pointer in the database records the fact that the branch to the target file has occurred. Lazy copies make branching a low-overhead operation; the server doesn’t have to keep track of duplicate copies of files.

这使得 Sparse 分支方法似乎只是在流程中增加了人为错误的可能性,例如,开发人员可能开始处理他们没有添加到 Sparse 分支的文件,然后意外更新对破坏构建的目标分支的更改.但是,稀疏分支功能的存在是有原因的.任何关于它为什么存在以及为什么我应该在一个完整的私有分支上使用它(反之亦然)的反馈将不胜感激.

This makes it seem like the Sparse branch method is just adding the possibility of human error to the process as, for instance, the developer may start working on a file that they didn't add to the Sparse branch and then accidentally update a change to the target branch that breaks the build. But, the Sparse branching functionality exists for a reason. Any feedback on why it exists and why I should be using it over a complete private branch (or vice versa) would be greatly appreciated.

推荐答案

正如您在文档空间中指出的那样,这并不是真正的问题.速度还是可以的.同步整个开发树可能需要很长时间.整合回来也需要一段时间.如果您只需要树的一个分支,那么这两个操作都会快得多.

As you noted from the documentation space is not really an issue. Speed is though. Syncing down the entire development tree may take a long time. The integration back will also take a while. If you only need a branch of the tree then both of those operations are much faster.

正如您已经说过的那样,可能会发生人为错误,但是如果您制定了分支规范,它可以帮助减轻一些潜在的错误.

Human error, as you already said, can occur, but if you make a branchspec, it can help alleviate some of the potential errors.

这篇关于Perforce 开发分支 - 稀疏分支与私有分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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