June 17, 2011
Surround SCM Branches Versus Perforce Streams
Perforce introduced the concepts of streams in their upcoming release, and we've had a few folks ask us how they compare with Surround SCM's implementation of branches. I gathered some highlights on streams from their blog posts, and I'd like to compare these highlights to existing Surround SCM features. As you'll see, many of the new features that Perforce streams provide have been part of Surround SCM branches for years.Email sign up
Streams Will Prevent the Branching of BranchesIn the blog post introducing streams, Perforce poses a scenario of how Jane could mistakenly create a branch that contains two existing branches. Because Perforce "hasn’t had the metadata to guide Jane toward what she really wanted," streams now ensure this won’t happen. Surround SCM has never had this issue. Branches are always based on repositories and it is impossible to branch a branch.
Streams Allow the Project Lead to Control Which Files Will Be in the StreamPerforce mentions that a project lead can choose the files that can be included in the stream, in the same introductory blog post. When you create a branch in Surround SCM, you have the option to create the branch off a sub-repository. This allows you to create a branch that only contains the files that pertain to a specific repository. You can also control which files to include in the branch and the content. You can create a branch based on latest version, label, timestamp, and latest version in state—these options have been available in Surround SCM for years.
Streams Allow You to Model Branching and Merging IntentIn another blog post, Perforce states that branching and merging intent is done "through their parent-child relationships." This is at the heart of branching in Surround SCM. When you create a branch, it always has a parent and thus a parent-child relationship is established. Promotes will always merge changes to the parent and rebases will always merge changes from the parent and into the child.
Streams Types Control How Changes FlowIn a post about stream types, Perforce defines the types of available streams. The parent is always going to be a mainline, and children will be either a release or a development stream. According to the writer, the difference between the two is "how change is expected to flow—by merging, or by copying—between a stream and its parent." Surround SCM also has different types of branches, but the differences between the branch types is more significant. Mainline branches are similar to Perforce’s in that both are at the root of the branch tree and cannot be a child of another branch. However, Surround SCM also includes three other types of branches that give you greater control:
- Baseline: A public branch used for collaborative development. Similar to the Perforce release and development streams, but you get to choose how the changes flow.
- Workspace: A private branch that can be used for sandbox development.
- Snapshot: A read-only, static branch that captures its parent branch at a specific moment in time. With snapshot branches, you can tell exactly which versions of files went into builds, making them ideal for capturing releases for future rebuilds or a QA build.