如何共享仓库中的文件

发布于 2024-08-09 07:05:28 字数 596 浏览 9 评论 0原文

我们正在使用 Perforce。在软件仓库中有一些项目有自己的 main/branches/releases 子文件夹。还有一些不同项目需要(共享)的资源文件(png、mp3 等)。那些没有主/分支/结构。目前,它们存储在仓库中独立于项目的单独文件夹中。

现在我不知道如何共享项目的资源文件。我有点困惑。至少我可以说符号链接是错误的,因为如果资源文件更新,项目不应自动获取较新的版本。它应该需要一个明确的步骤,因为项目可能需要适应新版本。

我能想到的是将资源文件集成到专用位置,也许使用准备好的分支视图。这样可以吗?但接下来我只能想象融入主线了。当我想在分支中编辑或添加资源文件时该怎么办?一个将被重新集成到主干中的分支?我可以添加一个图像并将其集成到资源文件夹中,然后集成到其他项目中吗?如果我要在分支中编辑资源文件,这些编辑是否应该集成到资源文件夹中?听起来很乱。嗯,一个人不应该随机整合。难道不是吗?我需要为此制定一些特殊规则吗?或者这根本不是一个好主意?

为资源文件提供 main/branches/releases 文件夹也会有帮助吗?也许项目具体?这会怎样出现呢?

感谢您的帮助! 我还可以想象不使用集成,而是详细说明将资源文件和项目文件映射到单个本地环境的工作区视图。但我想这肯定会导致一些其他问题。

We are using Perforce. In the depot are some projects that have their own main/branches/releases sub folders. There are also some resource files (png, mp3 and so on) that are needed (shared) for some of the different projects. Those don't have the main/branches/structure. Currently they are stored in a seperat folder in the depot that is independent of the projects.

Now I'm not sure how to share the resource files for the projects. I'm a bit confused. At least I can say that symbolic links would be wrong, since if a resource file gets updated the projects should not get the newer version automatically. It should require a explicit step since it could be that the project needs to be adapted to the newer version.

What I could imagine is to integrate the resource files to the dedicated places, maybe using prepared branch views. Would this be okay? But then I can only imagine to integrate into the main-line. What is then when I would like to edit or add a resource file in a branch? A branch that will be back-integrated into main? Could I add there an image and integrate it into the resource file folder and then to the other projects? And if I would edit a resource file in the branch, should those edit get integrated into the resource file folder? Sounds messy. AFIAK one should not integrate randomly. Isn't it true? Do I need some special rules for this way? Or is it not a good idea at all?

Would it help to have main/branches/releases folders for the resource files as well? Maybe Project specific? How would this apear?

Thanks for any help!
I could also imagine not to use integration, rather to elaborate workspace views that map both resource files and project files to a single local environment. But I guess this will surely cause some other problems.

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

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

发布评论

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

评论(1

下壹個目標 2024-08-16 07:05:28

不幸的是,Perforce 不允许您在客户端视图规范中为文件指定特定修订版。

由于您希望使用资源的项目仅使用特定版本,因此您需要:

  • 为资源创建分支,各个项目可以将其合并到客户端文件规范中,以便它们可以从具有的分支中提取正确的版本他们想要的版本
  • 只是让每个项目将他们想要的版本放入自己的仓库部分,并且该项目会在需要更新时定期更新自己单独的资源版本,

这两个选项对我来说都不是很好,但选项 2 似乎如果我们只讨论几个文件,那就更简单了。在这两种情况下,当项目想要迁移到较新版本的资源时,项目都需要手动更新内容 - 只是选项 #1 需要更多的工作来设置和维护事物的分支。除非您有许多文件需要从“资源文件”库/分支中提取,否则我认为它不会为您购买任何超过选项 #2 的东西。

但也许其他人会有更好的第三种选择。

Unfortunately Perforce won't let you specify a particular revision for a file in the client view specification.

Since you want the projects using a resource to use only a particular version, you'll need to either:

  • create branches for the resources that the various projects can incorporate into the client file specification so they can pull the right version from the branch that has the version they want
  • just have each project put the version they want into their own part of the depot and the project would periodically update their own separate version of the resource when it needs updating

Neither of these options seems great to me, but option 2 seems simpler if we're talking about only a few files. In both cases projects would need to manually update things when they wanted to move to a newer version of the resource - it's just that option #1 would require more work to set up and maintain branches for the things. Unless you have a number of files that need to be pulled in from the 'resource file' depot/branch, I don't see that it buys you anything over option #2.

But maybe someone else will have a better, 3rd option.

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