您的视图/分支的 Perforce 实践是什么?
我是 Perforce 的新手。
您认为 P4 在视图/分支方面的最佳实践是什么?
您会创建 1 个可以访问多个分支的视图,还是会创建 1 个视图/分支?
我不确定 Perforce 中视图/工作空间之间的切换是否那么容易。
谢谢,
托马斯
I am new to Perforce.
What would you consider P4 best practices in terms of views/branches.
Would you create 1 view with access to many branches, or would you create 1 view / branch ?
I am not sure switching between views/worspaces is that easy in Perforce.
Thanks,
Thomas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果“视图”指的是工作区(又名客户端规范),那么我努力为我正在处理的每个分支拥有一个客户端规范。我假设分支是指您有一个典型的系统,其中有主线、开发分支,也许还有发布分支?
保持一一对应的原因是这样可以让事情变得更简单。它还可以防止意外 - 例如,当我在开发客户端规范中时,我知道我不会意外地查看或修改另一个分支中的同名文件。当您处于深层源文件夹层次结构的深处时,这可能会很有帮助。
在 Peforce 中,保持“严格”的观点通常是良好的做法——就像在任何事情中一样。它有助于提高服务器性能,进而提高客户端计算机上 Perforce 的性能。但除了性能之外,我认为只看到您需要看到的内容(让计算机为您进行过滤)的概念通常是一件好事。它可以让您专注于手头的工作而不会分心。
我在切换工作空间方面没有任何困难,并且根据您的情况和偏好,有多种方法可以做到这一点。例如,P4V 在左窗格顶部有一个简单的下拉菜单。您在切换工作空间时遇到什么困难?
If by "view" you mean workspace (aka client-spec), then I strive to have one client spec for each branch I am working on. I'm assuming by branch you mean you have a typical system where you have mainline, development branches, and maybe release branches too?
The reason for keeping the 1-1 correspondence is it just keeps things simpler. It can also prevent accidents - e.g. when I am in a development client spec, I know I cannot accidentally look at or modify a file of the same name in another branch. This can be a big help when you are down in the depths of a deep source folder hierarchy.
Keeping views "tight" is generally good practice in Peforce - as in anything. It helps server performance, which in turn helps performance of Perforce on your client machine. But beyond performance, I think the concept of only seeing what you need to see - letting the computer do the filtering for you - is just generally a good thing. It lets you concentrate on the job at hand without distraction.
I don't have any difficultly switching workspaces, and there are a number of ways to do this depending on your circumstances and preferences. P4V has a simple drop-down at the top of the left pane, for example. What difficulties are you having switching workspaces?
这很容易。假设您使用命令行,请在每个客户端规范(也称为视图)的根目录中创建一个
p4config.txt
。在每个p4config.txt
中,将P4CLIENT
变量设置为客户端规范的名称。您可以保留其他变量不变。这是我的示例
p4config.txt
:然后按如下方式设置
P4CONFIG
环境变量:现在,每当您更改客户端目录时,它都会自动使用“正确的”客户端规范。尝试
在您的客户端目录中发出:进行验证。
Perforce 知识库(适用于
p4
对我来说)。It is easy. Assuming you use the command-line, create a
p4config.txt
at the root directory of each client-spec (aka view). In eachp4config.txt
, set theP4CLIENT
variable to the name of the client-spec. You can leave the other variables as they are.Here is my sample
p4config.txt
:Then set the
P4CONFIG
environment variable as follows:Now it automatically uses the "correct" client-spec whenever you change client directories. Try issuing:
in your client directories to verify.
This is also documented in Perforce Knowledge Base (works with
p4
for me).主题。
很好的讨论。
查看可以访问许多分支。
由于分支默认出现在每个人的视图中,因此您希望在主线之外有一个用户区域。
subject.
good discussion.
view with accesses to many branches.
Since branches appear in everyone's view by default, you want to have a user area off the main line.