#NEWLINE# def parse( self ) : #NEWLINE# #INDENT# allowedmodes = ( 'message' , 'template' , 'merge' , 'squash' , 'commit' ) #NEWLINE# messagefile = sys . argv [ 1 ] #NEWLINE# mode = None #NEWLINE# sha = None #NEWLINE# if ( len ( sys . argv ) > 2 ) : #NEWLINE# #INDENT# mode = sys . argv [ 2 ] #NEWLINE# #UNINDENT# if ( len ( sys . argv ) > 3 ) : #NEWLINE# #INDENT# sha = sys . argv [ 3 ] #NEWLINE# #UNINDENT# if ( ( mode is not None ) and ( mode not in allowedmodes ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Invalid Second Argument: mode' ) #NEWLINE# #UNINDENT# if ( ( mode != 'commit' ) and ( sha is not None ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Invalid Third Argument' ) #NEWLINE# #UNINDENT# if ( ( mode == 'commit' ) and ( sha is None ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Missing Third Argument' ) #NEWLINE# #UNINDENT# resolver = gitinforesolver ( ) #NEWLINE# resolver . messagefile = messagefile #NEWLINE# resolver . mode = mode #NEWLINE# resolver . sha = mode #NEWLINE# return resolver