I am trying to merge with perforce the entire content from another branch (source and target files or branch mapping), but I don't want to merge the files which are supposed to be auto-generated based on other files.
Is there some way to define a set of files which should be skipped from merge when doing a branch merge? I would like to reuse the solution multiple times and the maintenance overhead should be low if possible.
You could set up a branch mapping, see http://www.perforce.com/perforce/doc.current/manuals/p4guide/06_codemgmt.html.
If your generated files have some pattern that makes them easy to identify with a P4 file specification, or if they live in a small subset of folders, then it should be pretty easy to exclude them from your mapping.
Related
According to the API guideline
https://www.perforce.com/manuals/v15.1/dvcs/_specify_mappings.html
It seems that I can only specify a one-to-one mapping. Is there any way I can specify a mapping with two sources into one destination?
For example:
//stream/main/... //depot/main/...
//stream/build/... //depot/main/...
Branch mappings are one-to-one. If you want to integrate multiple sources into one target, you need multiple branch mappings and multiple integrate commands. (I would recommend multiple submits as well; it is technically possible to squash multiple integrations into one submit but it multiplies the complexity of the conflict resolution process.)
YMMV, but pretty sure that after 2004.1, you should be able to use the + syntax to append rules instead of overwriting, like:
//stream/main/... //depot/main/...
+//stream/build/... //depot/main/...
Here is the associated reference on perforce views
When I am trying to merge between two streams in Perforce, for example
Stream A is a parent and Stream B is a child of Stream A. I want to merge down to Stream B from Stream A. When I try to merge between these, in the merge dialog box there are three options
stream to stream merge
specify source and target files
use branch mapping
I have a question here, what is the difference between these 1st and 3rd?
These are all just different ways to specify a source and target mapping.
here are my streams, figure out how they relate and merge one into the other
here are two sets of files, merge one into the other
here is a branch mapping defining two sets of files, merge one into the other
The purpose of having streams is largely to make #2 and #3 obsolete -- when you merge two streams a branch mapping is automatically generated internally to perform the merge. If you don't use streams you define your own branch mappings (which gives you some flexibility but is also more work).
Is there a way to make a changelist restricted if any of the files in it match a certain pattern? I'd like to use this to protect private internal projects from external contractors.
I know that the contractors won't be able to see the files if they don't have access in the protections, but I'd rather not have to rely on everyone sanitizing their checkin comments.
It's been a while since I did this, but as I recall the trick is to set up a very simple trigger that forces all changelists to be restricted. Assuming you are already using protections, your users will then see only the changelists whose files they can see; all other changelists (and their descriptions) will be hidden from them.
I have two copies of an application source code. One copy is encoded, while the other is not. There are config files scattered through-out the application's directory structure, and this is what I would like to compare.
Is there a way to use diff where-by I can ignore the wildly different files (ie: An encrypted file and an unencrypted file), and only report the difference on the similar-yet-different files (The configs).
You could write a script that uses find to find the files based on name or other criteria and file to determine whether they have the same type of contents (i.e. one compressed, one not).
For me to be more specific I would need you to give more details about whether these are parallel directory structures (files and directories appear in the same places in the two trees) and whether the files you are looking for have names that distinguish them from files you want to ignore. Any additional information you can provide might help even more.
I've got a system in which users select a couple of options and receive an image based on those options. I'm trying to combine multiple generated images(corresponding to those options) into the requested picture. I'm trying to optimize this so that if, an image exists for a certain option (i.e. the file exists), then there's no need to compute it and we move on to the next step.
Should I store these images in different folders, where each folder is an option name? Should I store them in the same folder, adding a prefix corresponding to the option to each image? Should I store the filenames in a database and check there? Which way is faster to check a file for existence?
I'm using PHP on Linux, but I'm also interested if the answer varies if I change the programming language or the OS.
If you're going to be producing a lot of these images, it doesn't seem very scalable to keep them all in one flat directory. I would go with a hierarchy, which will make it a lot easier to manage.
It's always going to be quicker to check in a database than to check if a file exists though, so if speed is the primary concern, use a hierarchical folder structure and keep all the filenames in a database.