#NEWLINE# def run( self , edit ) : #NEWLINE# #INDENT# if ( len ( self . view . sel ( ) ) > 1 ) : #NEWLINE# #INDENT# sublime . status_message ( 'SublimeHg: Please select only one commit.' ) #NEWLINE# return #NEWLINE# #UNINDENT# sels = list ( self . view . sel ( ) ) #NEWLINE# if ( not self . view . match_selector ( sels [ 0 ] . begin ( ) , 'keyword.other.changeset-ref.short.mercurial-log' ) ) : #NEWLINE# #INDENT# sublime . status_message ( 'SublimeHg: SublimeHg: Please select only one commit.' ) #NEWLINE# return #NEWLINE# #UNINDENT# w = self . view . window ( ) #NEWLINE# w . run_command ( 'close' ) #NEWLINE# v = sublime . active_window ( ) . active_view ( ) #NEWLINE# path = v . file_name ( ) #NEWLINE# ( text , exit_code ) = hg ( running_servers [ path ] , 'status' ) #NEWLINE# if text : #NEWLINE# #INDENT# msg = "SublimeHg: Don't update to a different revision with uncommited changes. Aborting." #NEWLINE# logging . warning ( msg ) #NEWLINE# sublime . status_message ( 'Mercurial: Error' ) #NEWLINE# return #NEWLINE# #UNINDENT# v . run_command ( 'hg_command_runner' , { #NEWLINE# #INDENT# 'cmd' : ( 'update %d' % int ( self . view . substr ( self . view . sel ( ) [ 0 ] ) ) ) , #NEWLINE# 'display_name' : 'update' , #NEWLINE# 'cwd' : path , #NEWLINE# #UNINDENT# } )