[p4] Propagating deleted files even if the file never existed inthe target location

Rick Macdonald rickmacd at shaw.ca
Wed May 13 08:26:12 PDT 2009


There are a few options, depending on the actual intent and use of the 
two sibling branches and the policy and activity of the mainline.

I'd be inclined to only use the "p4 integ" tool and nothing else. I only 
want do full branch (directory) integrations, not individual files. I 
don't want to research other people's work in great detail unless I need 
to or have to or want to.

If I knew that branch_a would be integrated to branch_b at the time that 
branch_b was created, I would create branch_b from branch_a in the first 
place, not from the mainline.

Otherwise, I would do this:

@1 Create file "mainline/foo"
@2 Integrate "mainline/..." to "branch_a/..." [creates branch_a/foo]
@3 Delete file "mainline/foo"
@4 Integrate "mainline/..." to "branch_b/..." [doesn't create branch_b/foo]

@5a Integrate "mainline/..." to "branch_a/..." [deletes branch_b/foo]
@5b Integrate "branch_a/..." to "branch_b/..." [doesn't touch branch_b/foo]

You can do all of the above without even having to know if any files 
were deleted. That's a big bonus, if appropriate.

You didn't bring up the issue of finishing the jobs and integrating 
everything to the mainline. Depending on how you've managed any 
parent-child relationship to the end, I would:

@6 Integrate "mainline/..." to "branch_a/..." to "branch_b/..." to 
"branch_a/..." to "mainline/..."
or
@6 Integrate "mainline/..." to "branch_a/..." to "branch_b/..." to 
"mainline/..."
or
@6 Integrate "mainline/..." to "branch_b/..." to "branch_a/..." to 
"mainline/..."

All of the above are meant to be "Merge Down - Copy Up" procedures. 
Regardless of how you create branch_b (even if from the mainline), you 
can thereafter treat branch_b as a child of branch_a if you want to. 
Laura explained to me once that parentage is "just a state of mind", 
which I take as meaning it is more significant to me than to Perforce 
and its integration history. In my words and way of thinking:  if you 
integrate to and from branch_b as if it is a child of branch_a, then it is.

Rick

Peter Buckley wrote:
> I'm not sure if what you're looking for is supported by the tool (or any tool). 
>
> To handle cases like this I've used a workaround of multi-level parentage. 
>
> So where branch_a and branch_b are both children of main, any integrations between the two go through main first. Obviously this won't work if you're using main for active development. We had "holding" branches as the parents in these cases, that were only used to accomplish what you're trying to do. 
>
> @1 Create file "mainline/foo"
> @2 Integrate "mainline/..." to "branch_a/..." [creates branch_a/foo]
> @3 Delete file "mainline/foo"
> @4 Integrate "mainline/..." to "branch_b/..." [doesn't touch branch_b/foo] (why not??? You could have solved your problem here without this complex workaround.)
> @5 Integrate "branch_a/..." to "mainline/..."
> @6 Integrate "mainline/..." to "branch_b/..." [Thus propagating the changes from branch_a, and deleting branch_b/foo]
>
> Thanks,
> Peter
>
> -----Original Message-----
> From: Weeble <clockworksaint+p4 at gmail.com>
>
> Date: Wed, 13 May 2009 14:38:54 
> To: <perforce-user at perforce.com>
> Subject: [p4] Propagating deleted files even if the file never existed in
> 	the target location
>
>
> (Apologies if this is a repost, I think I sent it with the wrong "From:"
> header and it seems to have disappeared into a black hole.)
>
> I've seen this pop up a few times when we've had some awkward
> integrations across branches. In this scenario:
>
> @1 Create file "mainline/foo"
> @2 Integrate "mainline/..." to "branch_a/..." [creates branch_a/foo]
> @3 Delete file "mainline/foo"
> @4 Integrate "mainline/..." to "branch_b/..." [doesn't touch branch_b/foo]
> @5 Integrate "branch_a/..." to "branch_b/..." [creates branch_b/foo]
>
> ....we have the file "foo" in branch_b even though we previously
> integrated from a version of mainline that included the deletion. The
> file won't be deleted until the *next* integration from mainline.
>
> Is there any general way to do step 4 in a way that means that step 5
> will not attempt to introduce the file? In this case it seems like we
> could first branch from mainline/foo at 2 to branch_b/foo, to introduce
> the file, then integrate again from mainline/foo to branch_b/foo to
> delete the file. However, that gets pretty messy to do if many files
> have been deleted, possibly over several changelists. Is there any way
> to say "propagate file deletions even if the file never existed in the
> target location"?
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
>   



More information about the perforce-user mailing list