#NEWLINE# def current( config , head_only = False ) : #NEWLINE# #INDENT# 'Display the current revision for each database.' #NEWLINE# script = ScriptDirectory . from_config ( config ) #NEWLINE# def display_version( rev , context ) : #NEWLINE# #INDENT# rev = script . get_revision ( rev ) #NEWLINE# if head_only : #NEWLINE# #INDENT# config . print_stdout ( ( '%s%s' % ( ( rev . revision if rev else None ) , ( ' (head)' if ( rev and rev . is_head ) else '' ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# config . print_stdout ( 'Current revision for %s: %s' , util . obfuscate_url_pw ( context . connection . engine . url ) , rev ) #NEWLINE# #UNINDENT# return [ ] #NEWLINE# #UNINDENT# with EnvironmentContext ( config , script , fn = display_version ) : #NEWLINE# #INDENT# script . run_env ( )