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:
- Merges between the mapped branches in
Git will result in an
AccuRev
promote between the corresponding streams.
-
Promotes from the child stream to the parent stream in
AccuRev will result in a merge between the corresponding branches in the
Git repository if the content under the mount point is empty in the child stream. (That is, the merge will happen if the child
stream is completely inherited so that it is the same as the parent at the mount point).
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:
- 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”.
- There is no timestamp on
AccuRev stream “C”. (A timestamp will prevent a stream default group from being cleared.)
- 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.)
- 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.