[p4] Confused by 'p4 integrate' behavior.

Krzysztof Kozminski kk at kozminski.com
Tue Oct 3 02:57:02 PDT 2006


Here's the relevant portion of the history of two files:

% p4 filelog //depot/x/branchNew/snafu
//depot/x/branchNew/snafu
... #1 change 4509 add on 2006/10/03 ...

% p4 filelog //depot/x/branchOld/snafu
//depot/x/branchOld/snafu
... #5 change 4292 delete on 2006/08/31 ...
... #4 change 4285 edit on 2006/08/31 ...
... #3 change 4278 edit on 2006/08/30 ...
... #2 change 4246 edit on 2006/08/25 ...
... #1 change 4241 add on 2006/08/25 ...

Relevant info: //depot/x/branchNew was branched off //depot/x/ 
branchOld in change 4506, using this branch specification:

    //depot/x/branchOld/... //depot/x/branchNew/...

and this command:

    p4 integrate -b branchNew -s #have

while portions of branchOld were synced @4500, some portions were  
@4490, and the rest was up-to-date (yes, there was a good reason for  
that). I am positive that snafu was not present in any revision prior  
to #5.

Now, the confusing part: the integration attempt:

% p4 integrate -n //depot/x/branchOld/... //depot/x/branchNew/...

attempts to delete snafu from branchNew.

It seems to me that given the sequence of events (branchOld/snafu was  
deleted BEFORE branchNew/snafu was added), the integration has no  
business deleting branchNew/snafu.

If branchNew/snafu was branched off some revision < 5 of branchOld/ 
snafu, then yes, deletion would be understandable, but not in the  
scenario described above.

Two questions:

1) Is this supposed to be happening that way? What is the rationale  
here?

2) How do I tell Perforce to ignore the deletion that happened on  
branchOld, keep the stuff I have in branchNew, and not attempt to  
delete branchNew/snafu? I am looking here for something like 'p4  
resolve -ay' that would ignore 'their' change (in this case, 'their'  
deletion). While I can hack a branch specification like this:

    //depot/x/branchOld/... //depot/x/branchNew/...
    -//depot/x/branchOld/snafu //depot/x/branchNew/snafu

this looks like too much effort for something that should be doable  
with less hassle (I have another 50 files like 'snafu'). Also, if I  
ever add branchOld/snafu again, I would like to get a chance to  
integrate it without having to remember to remove it from the branch  
specification...

BTW, both client and server are version 2005.1.

KK


More information about the perforce-user mailing list