[p4] Finding changelists in branches.

Neil MacMullen npm at csr.com
Thu Oct 5 00:40:21 PDT 2006


Curry, Dave S. wrote:
> This is likely an old question, but has resurfaced here.
> 
> What is the best way to determine where a particular changelist has been integrated?
> 
> The graphing is fun, but many folks would prefer a "simple" command-line to say which branches contain a CL.
> 

[Assuming that it is _branches_ you care about rather than files.]

Unfortunately there isn't a way to get the information directly from the 
changelist.  The most straightforward way is to something like this 
(perlish pseudocode) ...

foreach branchname
{
	changes = `p4 changes -i //depot/branches/<branchname>/...`
	if (wanted_change in changes)
  		print "wanted_change is present in <branchname>"
}

You can also extend this technique to find out whether a changelist is 
present in a particular release by appending labels to the branch-spec.


Depending upon the size of your codebase, number of branches, releases 
etc This can be a slow operation - best to run it overnight or cache the 
results if you are doing it a lot (for example to automate parts of your 
defect tracking).

   Neil


More information about the perforce-user mailing list