This is not an easy question, so I'll try my best to explain it with a simplified example...
We have 2 branches (potentially more): main
and dev
. Development is done in dev
, si it gets multiple CLs. Some time to time, we full integrate dev
into main
: we take all the changes done in dev
and we put them in main
in a single full-integrate CL.
dev main
│ │
W ├─────►│ A full integrate W
│ │
X ├─────►│ B full integrate X
│ │
Y │ │
│ │
Z ├─────►│ C full integrate Y and Z
│ │
Now, I want to know if I have Y
in main
at a specific CL. For example:
- do I have
Y
inmain@A
: NO - do I have
Y
inmain@B
: NO - do I have
Y
inmain@C
: YES
I want a command line that will give me this result. So far, I am using :
p4 integrate -n "//dev/...@Y,@Y" //main/...
Because it tries to integrate Y
in main
and tells if something should be done or not. If not, we already have the changes, nothing to be done.
The problem is that with this command, as soon as Y
gets integrated into main
, it will always say that it is here as we can't provide a CL for the target branch main
...
Use the
-C
flag top4 integrate
. The-C
flag limits the integration records considered to those that are <= the given changelist; it's meant for this exact problem.For example:
See
p4 help undoc
: