[p4] Branch rename question

Chuck Karish chuck.karish at gmail.com
Wed Jan 31 08:22:35 PST 2007


On 1/30/07, Smith, Jeff <jsmith at medplus.com> wrote:

> Problem: Given 2 branches (BR1 and BR2), we need BR2 renamed to BR3 and
> BR1 branched to create a new BR2.  Note that the existing BR2 was
> created from BR1 at some point in the past.
>
> Solution 1:
> integrate BR2->B3
> integrate BR1->BR2 (accepting source)

You'll have to delete files that were created on BR2 and not
reverse integrated to BR1.

This preserves the whole history.  The commands I'd use would
be

  p4 integ -f  -t -b BR3
  p4 resolve -at
  p4 integ -f  -t -b BR2
  p4 resolve -at

Choose your change description so the first few characters identify
it clearly.  That way the role change will stand out in 'p4 filelog'
output.

The deletes I mentioned above might be an occasion for confusion.
When at a later time someone re-integrates them from BR3,
Perforce's new implicit indirect integration might decide that
the deleted changes had already been integrated to BR2 and
so choose not to schedule the integrates.  'p4 integ -r -f' fixes this
for these few (I assume) files when it's time to integrate changes
back from BR3 to BR2.

> Solution 2:
> integrate BR2->B3
> delete BR2
> integrate BR1->BR2

When someone suggests a big delete on a branch I hear a little
bell ringing behind me.  Like the one that would ring if a garbage
truck were about to back over me.

'p4 delete' is the command that has the most potential to make
things confusing.  If you do this be sure to also perform a null
integration of the delete.  In somewhat dated syntax:

  p4 integ -r -b BR2 -s @=<delete_changelist>
  pr resolve -ay

> Solution 3:
> integrate BR2->B3
> obliterate BR2
> integrate BR1->BR2

This destroys the BR1 -> BR3 integration history.  I
wouldn't consider it.

> Solution 4:
> use checkpoint surgery to rename BR2->BR3
> integrate BR1->BR2

This works .  It hides the actual history.  IF BR2 and BR3
are to be sibling branches and the BR1 -> BR2 ->BR3
integration path will not be interesting, this is a good
approach.  Requires more server down time than the
other choices would.


I'd choose #1 if the future integration path were
BR1 -> BR2 -> BR3, #1 or #4 if the future integration path
were BR1 -> BR3.

-- 
Chuck Karish   karish at well.com   (415) 317-0182


More information about the perforce-user mailing list