Jump to content

Set base revisions/parent for a branch, "post factum"

branch integration merge

  • Please log in to reply
1 reply to this topic

#1 redsoft



  • Members
  • Pip
  • 6 posts

Posted 31 July 2017 - 07:05 PM

Our company needs urgent help in this stupid scenario: one of our workers was not familiar with p4 and started his work in a separate branch. The problem is he did not create a branch, but simply added all files as new files. He worked on his task during 5 months and now we need to integrate his work. We know exact day and what was the parent branch of his new added branch. But is it possible now somehow to set this information in order p4 will know what is the base file for each file on this new branch?
Many thanks in advance for your help.
SW developer

#2 Sambwise


    Advanced Member

  • Members
  • PipPipPip
  • 1175 posts

Posted 31 July 2017 - 10:09 PM

If you use the "-f" flag and manually specify a revision range, all of the normal logic that figures out which changes are new and what the base should be is disabled, and the base is inferred from the revision range instead:

    p4 integ -f //depot/parent_branch/...@STARTDATE,@now //depot/your_branch/...

All revisions submitted between STARTDATE and now will be included in the merge, and the revision immediately prior (i.e. whatever revision of the file existed prior to STARTDATE) will be used as the base.

Once you've carefully merged everything from the parent branch to your branch, you can copy up from your branch and from that point on everything should be in sync.

Note that the "integ -f" trick might do undesirable things to renamed files.  If any files got renamed on the branch during that five month span, I'd recommend either undoing the renames on the child branch or manually re-creating the renames on the parent branch prior to integrating.

Also tagged with one or more of these keywords: branch, integration, merge

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users