您的视图/分支的 Perforce 实践是什么?

发布于 2024-08-07 15:32:58 字数 167 浏览 3 评论 0原文

我是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦开始←不甜 2024-08-14 15:32:58

如果“视图”指的是工作区(又名客户端规范),那么我努力为我正在处理的每个分支拥有一个客户端规范。我假设分支是指您有一个典型的系统,其中有主线、开发分支,也许还有发布分支?

保持一一对应的原因是这样可以让事情变得更简单。它还可以防止意外 - 例如,当我在开发客户端规范中时,我知道我不会意外地查看或修改另一个分支中的同名文件。当您处于深层源文件夹层次结构的深处时,这可能会很有帮助。

在 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?

淡淡的优雅 2024-08-14 15:32:58

我不确定视图/工作空间之间的切换是否那么容易
必然。

这很容易。假设您使用命令行,请在每个客户端规范(也称为视图)的根目录中创建一个 p4config.txt。在每个 p4config.txt 中,将 P4CLIENT 变量设置为客户端规范的名称。您可以保留其他变量不变。

这是我的示例 p4config.txt

P4USER=deepaknag
P4PORT=SJCPperforce01:1666
P4CLIENT=deepaknag_fbsd

然后按如下方式设置 P4CONFIG 环境变量:

export P4CONFIG=p4config.txt

现在,每当您更改客户端目录时,它都会自动使用“正确的”客户端规范。尝试

p4 info

在您的客户端目录中发出:进行验证。


Perforce 知识库(适用于p4 对我来说)。

I am not sure switching between views/worspaces is that easy in
Perforce.

It is easy. Assuming you use the command-line, create a p4config.txt at the root directory of each client-spec (aka view). In each p4config.txt, set the P4CLIENT variable to the name of the client-spec. You can leave the other variables as they are.

Here is my sample p4config.txt:

P4USER=deepaknag
P4PORT=SJCPperforce01:1666
P4CLIENT=deepaknag_fbsd

Then set the P4CONFIG environment variable as follows:

export P4CONFIG=p4config.txt

Now it automatically uses the "correct" client-spec whenever you change client directories. Try issuing:

p4 info

in your client directories to verify.


This is also documented in Perforce Knowledge Base (works with p4 for me).

无声无音无过去 2024-08-14 15:32:58
  • 以下是 Perforce
    主题
  • 此外,Eric Sink 还拥有 a
    很好的讨论
  • 我创建一个
    查看可以访问许多分支。
    由于分支默认出现在每个人的视图中,因此您希望在主线之外有一个用户区域。
  • 许多工程师对分支的概念更加熟悉,因为它们存在于所有 SCM 系统中。但如果他们还没有看到这个概念,他们的观点可能会令人担忧
  • Here's what Perforce says on the
    subject
    .
  • Also Eric Sink has a
    good discussion
    .
  • I create one
    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.
  • Many engineers are more comfortable with the concept of branches, since they exist in all SCM systems. But views may be concerning, if they haven't seen that concept
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文