Keeping Git Merges and AccuRev Promotes in Sync

GitWhen you configure a Git repository to work with AccuRev through GitCentric, you map a Git branch to an AccuRev stream. If you wish to take advantage of AccuRev promote operations, you map the parent AccuRev Stream to one branch, and the child AccuRev stream to another branch.

If you configure things correctly and follow a few basic rules, then:

Note: The desired condition when these operations are completed is for the “default group” in AccuRev stream “C” to be empty. (The “default group” is the set of elements or files in a stream that are under current development. A file is removed from a stream’s default group when that file is either promoted or “revert to back”ed (or purged). See the AccuRev documentation for more details.)

To Ensure that this Happens Reliably and Predictably

Configure your system so that:

  1. One stream is the parent of another stream and each of these streams are mapped to branches in the Git repository. In this example, the parent stream is called “P” and the child stream is called “C”.
  2. There is no timestamp on AccuRev stream “C”. (A timestamp will prevent a stream default group from being cleared.)
  3. The mount point must be the same in each AccuRev stream for the branches that are mapped to them. (If one branch is mapped to one mount point in one stream, and the other branch is mapped to a different mount point in the other stream, the files will never line up.)
  4. Any AccuRev rules that are applied to the C stream are also applied to the P stream. (For example, avoid include/exclude rules one stream that cause that cause its contents to differ relative to the other stream. And do not use cross-links on writable elements.)

From a Git viewpoint, this ensures that the branches point to the same commit graphs when their contents are identical. From an AccuRev viewpoint, this ensures that the default groups in the streams get cleared out when appropriate, and do not keep growing to include (potentially) all files in the system.