#NEWLINE# def cmd_publish( args ) : #NEWLINE# #INDENT# 'Pushes an unpublished branch to a remote repository.' #NEWLINE# branch = fuzzy_match_branch ( args . get ( 0 ) ) #NEWLINE# if ( not branch ) : #NEWLINE# #INDENT# branch = get_current_branch_name ( ) #NEWLINE# display_available_branches ( ) #NEWLINE# if ( args . get ( 0 ) is None ) : #NEWLINE# #INDENT# print ( 'Using current branch {0}' . format ( colored . yellow ( branch ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( 'Branch {0} not found, using current branch {1}' . format ( colored . red ( args . get ( 0 ) ) , colored . yellow ( branch ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# branch_names = get_branch_names ( local = False ) #NEWLINE# if ( branch in branch_names ) : #NEWLINE# #INDENT# print ( "{0} is already published. Use a branch that isn't." . format ( colored . yellow ( branch ) ) ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# status_log ( publish_branch , 'Publishing {0}.' . format ( colored . yellow ( branch ) ) , branch )