#NEWLINE# def detect_merge_conflict( argv = None ) : #NEWLINE# #INDENT# parser = argparse . ArgumentParser ( ) #NEWLINE# parser . add_argument ( 'filenames' , nargs = '*' ) #NEWLINE# args = parser . parse_args ( argv ) #NEWLINE# if ( not is_in_merge ( ) ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# retcode = 0 #NEWLINE# for filename in args . filenames : #NEWLINE# #INDENT# with open ( filename ) as inputfile : #NEWLINE# #INDENT# for ( i , line ) in enumerate ( inputfile ) : #NEWLINE# #INDENT# for pattern in CONFLICT_PATTERNS : #NEWLINE# #INDENT# if line . startswith ( pattern ) : #NEWLINE# #INDENT# print ( WARNING_MSG . format ( pattern , filename , ( i + 1 ) ) ) #NEWLINE# retcode = 1 #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return retcode