branchperforceintegrateperforce-branch-spec

Branch view for a file that has been split into multiple files


I have a large source file in Perforce that has been split up into several smaller files in a branch. I want to create a branch view that can handle this, but perforce (2009.1) only sees the last of the multiple files. For example, I created:

p4 integrate //depot/original/huge_file.c //depot/new/huge_file.c

Later I split the huge file into smaller ones:

p4 integrate //depot/new/huge_file.c //depot/new/small_file_one.c
p4 integrate //depot/new/huge_file.c //depot/new/small_file_two.c
p4 integrate //depot/new/huge_file.c //depot/new/small_file_three.c

Then edit each of those (including //depot/new/huge_file.c) and submit.

Now I make changes to //depot/original/huge_file.c and I want to integrate those changes to //depot/new. If I do this manually, it works fine:

p4 integrate //depot/original/huge_file.c //depot/new/huge_file.c
p4 integrate //depot/original/huge_file.c //depot/new/small_file_one.c
p4 integrate //depot/original/huge_file.c //depot/new/small_file_two.c
p4 integrate //depot/original/huge_file.c //depot/new/small_file_three.c

But I don't want to do that every time I integrate -- this kind of thing belongs in a branch view.

Unfortunately if the branch view includes the same source file multiple times, the subsequent lines override the earlier ones. How can I create a branch view like this:

//depot/original/huge_file.c //depot/new/huge_file.c
//depot/original/huge_file.c //depot/new/small_file_one.c
//depot/original/huge_file.c //depot/new/small_file_two.c
//depot/original/huge_file.c //depot/new/small_file_three.c

When I integrate using this branch spec, I get only small_file_three.c integrated.


Solution

  • I was going to suggest that you use an overlay mapping (a means to force all the lines of the spec to be processed), but a quick perusal of the page put the kibosh on that:

    Overlay mappings are only allowed on client views and do not work with branch views.

    It looks like you'll have to script it. This page has some more info that might be of use to you (and emphasizes the fact that this can't be done, "Perforce does not support 1:many file mappings.").