How to share files in a depot
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 ver开发者_运维问答sion 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.
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.
精彩评论