#NEWLINE# def run( self , edit ) : #NEWLINE# #INDENT# if ( len ( self . view . sel ( ) ) > 2 ) : #NEWLINE# #INDENT# sublime . status_message ( 'SublimeHg: Please select only two commits.' ) #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' ) and self . view . match_selector ( sels [ 1 ] . begin ( ) , 'keyword.other.changeset-ref.short.mercurial-log' ) ) ) : #NEWLINE# #INDENT# sublime . status_message ( 'SublimeHg: SublimeHg: Please select only two commits.' ) #NEWLINE# return #NEWLINE# #UNINDENT# commit_nrs = [ int ( self . view . substr ( self ) ) for x in self . view . sel ( ) ] #NEWLINE# ( older , newer ) = ( min ( commit_nrs ) , max ( commit_nrs ) ) #NEWLINE# w = self . view . window ( ) #NEWLINE# w . run_command ( 'close' ) #NEWLINE# v = sublime . active_window ( ) . active_view ( ) #NEWLINE# path = v . file_name ( ) #NEWLINE# v . run_command ( 'hg_command_runner' , { #NEWLINE# #INDENT# 'cmd' : ( 'diff -r%d:%d' % ( older , newer ) ) , #NEWLINE# 'display_name' : 'diff' , #NEWLINE# 'cwd' : path , #NEWLINE# #UNINDENT# } )