如何编写这个强制客户端规范?

发布于 2024-09-30 07:55:40 字数 201 浏览 3 评论 0原文

我想同时将一个目录映射到不同的本地文件夹(例如 AA/adirBB/adir)。这是下面的规格,但效果不佳。

有什么问题吗?

//depot/adir/... //cws/build/AA/adir/...
//depot/adir/... //cws/build/BB/adir/...

I want to map a directory to different local folders (such as AA/adir and BB/adir) at the same time. Here's the spec below, but it doesn't work well.

Is there anything wrong?

//depot/adir/... //cws/build/AA/adir/...
//depot/adir/... //cws/build/BB/adir/...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

故事灯 2024-10-07 07:55:40

实际上,强烈要求仓库和工作区之间存在一对一的关系。来自文档

所有视图在软件仓库中的文件与客户端工作区、分支或标签中的文件之间构建一对一的映射。如果多个映射行引用同一文件,则较早的映射将被覆盖。以连字符 (-) 开头的映射专门排除与该映射匹配的任何文件。在客户端视图中,以加号 (+) 开头的映射会覆盖之前的映射。 (覆盖映射不适用于分支或标签视图。)

因此,像这样的映射:

//depot/adir/... //cws/build/AA/adir/...
//depot/adir/... //cws/build/BB/adir/...

仅激活第二行(赢得冲突)。

为了完成您想要的操作,您需要使用两个不同的客户端(工作区),每个客户端都有一行示例。

您可以查看覆盖映射,也许可以解决您的问题:

覆盖映射用于将多个 depot 目录中的文件映射到工作区中的同一位置。

//depot/dir1/... //cws/build/...
+//depot/dir2/... //cws/build/...

In perforce, there is a strong requirement that there be a one-to-one relationship between the depot and a workspace. From the doc:

All views construct a one-to-one mapping between files in the depot and the files in the client workspace, branch, or label. If more than one mapping line refers to the same file(s), the earlier mappings are overridden. Mappings beginning with a hyphen (-) specifically exclude any files that match that mapping. In client views, mappings beginning with a plus sign (+) overlay previous mappings. (Overlay mappings do not apply to branch or label views.)

so a mapping like:

//depot/adir/... //cws/build/AA/adir/...
//depot/adir/... //cws/build/BB/adir/...

only activates the second line (which wins the conflict).

To do what you want, you need to use two different clients (workspaces) each having one line of your example.

You could look at overlay mappings, and maybe work around your problem:

An overlay mapping is used to map files from more than one depot directory into the same place in the workspace.

//depot/dir1/... //cws/build/...
+//depot/dir2/... //cws/build/...
夏日浅笑〃 2024-10-07 07:55:40

在 Perforce 中,您可以拥有多对一映射,但不能拥有一对多映射。您无法将同一文件同步到 2 个位置。您需要向其提供要同步的内容的明确列表。像这样的东西:

//depot/adir/... //cws/build/AA/adir/...
+//depot/adir/exception.c //cws/build/BB/adir/exception.c

In Perforce, you can have a many-to-one mapping but you cannot have a one-to-many mapping. You cannot sync same file to 2 locations. you need to provide it explicit list of what you want to sync. Something like this:

//depot/adir/... //cws/build/AA/adir/...
+//depot/adir/exception.c //cws/build/BB/adir/exception.c
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文