#NEWLINE# def merge_tree( repository , ours , theirs ) : #NEWLINE# #INDENT# theirs = repository . revparse_single ( theirs ) #NEWLINE# theirs_tree = theirs . tree #NEWLINE# ours = repository . revparse_single ( ours ) #NEWLINE# ours_tree = ours . tree #NEWLINE# merge_base_oid = repository . merge_base ( str ( theirs . id ) , str ( ours . id ) ) #NEWLINE# merge_base_tree = ( repository . get ( str ( merge_base_oid ) ) . tree if merge_base_oid else ours_tree ) #NEWLINE# index = ours_tree . merge ( theirs_tree , merge_base_tree ) #NEWLINE# return format_index ( index )