#NEWLINE# def create_release_branch_main( args , base_path , top_level ) : #NEWLINE# #INDENT# '\n    Create a release branch.\n\n    :param list args: The arguments passed to the script.\n    :param FilePath base_path: The executable being run.\n    :param FilePath top_level: The top-level of the flocker repository.\n    ' #NEWLINE# options = CreateReleaseBranchOptions ( ) #NEWLINE# try : #NEWLINE# #INDENT# options . parseOptions ( args ) #NEWLINE# #UNINDENT# except UsageError as e : #NEWLINE# #INDENT# sys . stderr . write ( ( '%s: %s\n' % ( base_path . basename ( ) , e ) ) ) #NEWLINE# raise SystemExit ( 1 ) #NEWLINE# #UNINDENT# version = options [ 'flocker-version' ] #NEWLINE# path = FilePath ( __file__ ) . path #NEWLINE# try : #NEWLINE# #INDENT# base_branch = calculate_base_branch ( version = version , path = path ) #NEWLINE# create_release_branch ( version = version , base_branch = base_branch ) #NEWLINE# #UNINDENT# except NotARelease : #NEWLINE# #INDENT# sys . stderr . write ( ( "%s: Can't create a release branch for non-release.\n" % ( base_path . basename ( ) , ) ) ) #NEWLINE# raise SystemExit ( 1 ) #NEWLINE# #UNINDENT# except TagExists : #NEWLINE# #INDENT# sys . stderr . write ( ( '%s: Tag already exists for this release.\n' % ( base_path . basename ( ) , ) ) ) #NEWLINE# raise SystemExit ( 1 ) #NEWLINE# #UNINDENT# except BranchExists : #NEWLINE# #INDENT# sys . stderr . write ( ( '%s: The release branch already exists.\n' % ( base_path . basename ( ) , ) ) ) #NEWLINE# raise SystemExit ( 1 )