我正在开发位于仓库中完全不同位置的许多项目,我想知道为每个项目使用不同的工作区与使用包含以下列表的工作区视图的单个工作区是否有任何真正的好处客户端映射。
在这里使用多个工作区是否有任何真正的好处,或者它们主要是为单用户多机场景设计的?多个工作空间何时有用?
I'm working on a number of projects that are in completely different locations in the depot and I'm wondering if there's any real benefit to using a different workspace for each project versus using a single workspace with the workspace-view comprising a list of client-mappings.
Is there any real benefit to using multiple workspaces here or are they primarily designed for single-user-multiple-machines scenarios? When are multiple workspaces useful?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一个“优点”是您可以多次打开同一个文件。我引用优势是因为 perforce 有其他可以说更好的方法来处理这种情况。另一个相关场景是能够在一台计算机上同步文件两次。这对于像头这样的事情很有用,其中使用的代码在仓库中被广泛分离(尽管对于头的特定情况也有其他解决方案)。当然,多个客户端对于多用户单机场景也很有用。您可能有一个客户/用户来进行构建,而与进行开发的客户/用户分开。
不过,主要优点是为 p4 同步、编辑等命令提供默认上下文。虽然您可以指定要同步的客户端子集,并且可以创建多个挂起的更改列表,但这始终需要一些纪律,而不是预先进行一些纪律。您仍然可能会在多个客户端上犯错误,并提交不相关的更改或同步到一段代码的正确标签或类似标签,但另一段代码同步到错误的标签,但它通过缩小您正在工作的宇宙来减少这些错误的可能性。
Perforce 有一套非常丰富的功能(现在我听起来像广告),用于在本地映射仓库的各个部分。多个工作空间的功能在其他功能的背景下更有意义。如果您想不出想要使用此功能的原因,请不要使用。但有一天你可能会发现自己需要做一些奇怪的事情,所以把它放在口袋里吧。
One "advantage" is that you can have the same file opened multiple times. I quote advantage because perforce has other arguably better ways to deal with that scenario. Another related scenario is the ability to sync down the file twice on one machine. This can be useful for things like headers where consuming code is separated widely in the depot (although for the specific case of a header has other solutions as well). And of course multiple clients are useful for multiple users single machine scenarios as well. You might have a client/user for doing builds separate from one doing development.
The main advantage though is providing a default context for commands like p4 sync, edit etc. While you can specify subsets of your client to sync, and can create multiple pending changelists, this requires some discipline all the time rather than a little discipline upfront. You can still make mistakes with multiple clients and submitting unrelated changes or syncing to the righ label or similar for one piece of code but the wrong one for another, but it reduces the chances of those mistakes by making the universe you're working in smaller.
Perforce has a very rich set (now I sound like an ad) of features for mapping parts of the depot locally. The feature of multiple workspaces makes more sense in the context of those other features. If you can't think of a reason why you'd want to use this functionality, don't. But someday you might find yourself needing to do something weird, so keep it in your pocket.
我使用多个工作区以便在多个平台上进行编码。我的主要 Linux PC 上有我最常使用的工作区。该代码还必须支持 SGI/Irix 平台,因此我也为该机器提供了一个工作区。
我曾经有一个工作区位于 NFS 驱动器上,在多台计算机之间共享,但通过在计算机上本地运行,我可以获得更快的编译时间。当 Perforce 支持搁置时,我将文件搁置在一个工作区中,并在另一个工作区中取消搁置。
我还使用 Windows 工作区,在其中处理 Microsoft Office 文档。我们将仓库分成文档和代码,并将代码映射到我在 PC/Linux 和 SGI/Irix 上的工作区。我的文档映射到我在 Windows 上使用的工作区。
I use multiple workspaces in order to code on multiple platforms. On my primary Linux PC I have the workspace I use most often. The code also has to support an SGI/Irix platform, so I have a workspace for that machine as well.
I used to have one workspace that was on an NFS drive that was shared among multiple machines, but I get much faster compile times by running locally on the machine. When Perforce supported shelving, I shelve files on one workspace and unshelve in the other.
I also use a workspace for Windows, in which I work on Microsoft Office documents. We have our depot split up into documents and code, with the code mapped to my workspaces on PC/Linux and SGI/Irix. My documents are mapped to my workspace I use on Windows.