#NEWLINE# def conditional_symlink_current_release( deployed = False ) : #NEWLINE# #INDENT# "Swap the 'current' symlink to point to the new release if it doesn't\n    point there already.\n\n    Requires the env keys:\n        pretty_release - set by make_pretty_release(), a commit identifier\n        release_path - root target directory on the remote server\n    " #NEWLINE# current_version = None #NEWLINE# if exists ( utils . absolute_release_path ( ) ) : #NEWLINE# #INDENT# with settings ( cd ( utils . absolute_release_path ( ) ) , warn_only = True ) : #NEWLINE# #INDENT# current_version = run ( 'git describe' ) #NEWLINE# #UNINDENT# #UNINDENT# if ( ( not exists ( utils . absolute_release_path ( ) ) ) or deployed or ( current_version != env . pretty_release ) ) : #NEWLINE# #INDENT# _symlink_current_release ( env . release_path )