#### 3.5.3 Making Branches

Normally, editing revision 1.1 of a file produces revision 1.2. Editing that produces revision 1.3, and so on. Sometimes, however, we need to make a change to an earlier version which has already been superseded.

This might happen, for example, when a bug has been reported in a released version of a file; a rapid bug-fix is required, but you’re in the middle of working towards a new release. A viable strategy is to make a branch at the previously-released version, modify that to fix the bug (and release this bug-fix). Meanwhile, development can be continued along the “main trunk”, and the same bug-fix can be incorporated in this, ready for the next release later on.

When you check out a version of a file for editing, CSSC tells you what the SID of the new version will be. For normal progress along the trunk, the level number is incremented. This is the second numeric element of the SID. In general, a SID is composed of four numbers ‘`R.L.B.S`’, where “R” stands for “Release”, “L” stands for “Level”, “B” stands for “Branch”, and “S” stands for “Sequence number” (not the same as the sequence numbers produced in the output of `prt`).

Trunk revisions have only two components; you can think of the branch and sequence numbers as being zero. Non-trunk revisions have four components. When a branch is created from an existing SID, the release and level numbers are copied, the branch number is set to the lowest unused value for that release and level, and the sequence number is set to one. Hence the first branch from version 1.1 will be version 1.1.1.1, and if a branch is made from that, its SID will be 1.1.2.1.

Branches are made from any given version when that version already has a successor. For example, a `get -e` on version 1.1 will result in a branch (1.1.1.1) if version 1.2 exists, and a `get -e` on version 1.2.1.1 will result in a branch (1.2.2.1) if version 1.2.1.2 exists.

If the “enable branches” flag is set, it is also possible to make branches for revisions that do not have successors. This is done with the `-b` flag of `get`.