def create_release_branch(self, branch_name):
<EOL>self.ensure_release_scheme('<STR_LIT>')<EOL>if self.compiled_filter.match(branch_name) is None:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise ValueError(msg % branch_name)<EOL><DEDENT>self.create()<EOL>candidates = natsort([r.revision.branch for r in self.ordered_releases] + [branch_name])<EOL>index = candidates.index(branch_name) - <NUM_LIT:1><EOL>if index < <NUM_LIT:0>:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise ValueError(msg % branch_name)<EOL><DEDENT>parent_branch = candidates[index]<EOL>self.checkout(parent_branch)<EOL>self.create_branch(branch_name)<EOL>
Create a new release branch.

:param branch_name: The name of the release branch to create (a string).
:raises: The following exceptions can be raised:

          - :exc:`~exceptions.TypeError` when :attr:`release_scheme`
            isn't set to 'branches'.
          - :exc:`~exceptions.ValueError` when the branch name doesn't
            match the configured :attr:`release_filter` or no parent
            release branches are available.

This method automatically checks out the new release branch, but note
that the new branch may not actually exist until a commit has been made
on the branch.