def create_branch(self, branch_name):
<EOL>self.create()<EOL>self.ensure_working_tree()<EOL>logger.info("<STR_LIT>", branch_name, format_path(self.local))<EOL>self.context.execute(*self.get_create_branch_command(branch_name))<EOL>
Create a new branch based on the working tree's revision.

:param branch_name: The name of the branch to create (a string).

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