Memory Pool System branching and merging procedures

author Gareth Rees
confidentiality public
date 2014-01-09
organization Ravenbrook Limited
readership MPS developers

1. Introduction

This document contains procedures and checklists for branching and merging during the ordinary course of development. For making version branches, see version-create, and for making releases, see release-build.

2. Creating a development branch

  1. If you are creating a development branch to fix a problem, make sure that there's a job recording the problem.

  2. Create a branch specification.

    p4 branch mps/branch/2013-08-21/lii6ll

    The specification should look something like this:

    Branch: mps/branch/2013-08-21/lii6ll
    
    Description:
            Adding new supported platform lii6ll (job003596).
    
    View:
            //info.ravenbrook.com/project/mps/master/... //info.ravenbrook.com/project/mps/branch/2013-08-21/lii6ll/...
    
  3. If you're working on a problem that's specific to customer, then map the mainline for that customer rather than the master sources:

    View:
            //info.ravenbrook.com/project/mps/custom/cet/main/... //info.ravenbrook.com/project/mps/branch/2013-11-04/cet-i6-stack-probe/...
    
  4. If you're just going to work on a subset of the sources, then just map the files you need:

    View:
            //info.ravenbrook.com/project/mps/custom/cet/main/code/... //info.ravenbrook.com/project/mps/branch/2013-07-02/cet-ap-key/code/...
    
  5. Edit the branch index:

    p4 edit //info.ravenbrook.com/project/mps/branch/index.html
    

    and add an entry to the "Active branches" section.

3. Pre-merge checklist

  1. Have you solved the problem?
  2. Is there an automated test case?
  3. Does the test suite pass?
  4. If there are interface changes, is there documentation?
  5. If this is work on a customer-specific branch, and you've added new customer-specific interfaces, have you ensured that these interfaces are separated from the public interfaces?
  6. If this is work on a customer-specific branch, and you've added new files that should be merged into the mainline for that customer, but not into the master sources, have these files been excluded in the branch specification for that customer?
  7. Has there been a code review?

4. Merging a development branch

  1. Do a catch-up merge from the master sources (or the appropriate customer-specific mainline):

    BRANCH=mps/branch/2013-08-21/lii6ll
    p4 integrate -b $BRANCH
    p4 resolve -as
    p4 resolve
    
  2. Check that the test suite passes on the branch.

  3. Submit the merged files:

    p4 submit -d "Catch-up merge from the master sources to $BRANCH"
    
  4. Update the branch on other platforms and check that the test suite passes.

  5. Backward merge into the master sources (or the appropriate customer-specific mainline):

    p4 integrate -r -b $BRANCH
    p4 resolve -as
    p4 resolve
    

    Note: don't cherry-pick individual lines from files, if at all possible. (It may not be possible in the case of makefiles.) Try to structure changes so that files can be included or excluded as a whole.

  6. Check that the test suite passes on the master sources.

  7. Submit the merged files:

    p4 submit -d "Merge $BRANCH into the master sources"
    
  8. Create a fix record for the change you just submitted:

    p4 fix -c CHANGE JOB
    
  9. Edit the branch index, moving the development branch from the "Active branches" to "Dormant branches" section and linking the change in which the branch was merged.

  10. If the change is significant and user-visible, update the release notes (master/manual/source/release.rst).

A. References

B. Document History

2014-01-09 GDR Created.