peerdrive/client/views/diff3.py
def tripple_match(old, other, new, other_match, new_match):
    """find next matching pattern unchanged in both other and new
       return the position in all three lists
    """
    while 1:
        difference = new_match[0]-other_match[0]
        # new changed more lines
        if difference > 0:
            match_len = match(old, other, other_match[0], other_match[1],
                              difference)
            if match_len == difference:
                return (new_match[0], other_match[1]+difference, new_match[1])
            else:
                other_match =  find_match(old, other,
                                          other_match[0] + match_len,
                                          other_match[1] + match_len)
        # other changed more lines
        elif difference < 0:
            difference = -difference
            match_len = match(old, new, new_match[0], new_match[1],
                              difference)
            if match_len == difference:
                return (other_match[0], other_match[1],
                        new_match[0]+difference)
            else:
                new_match =  find_match(old, new,
                                        new_match[0] + match_len,
                                        new_match[1] + match_len)
        # both conflicts change same number of lines
        # or no match till the end
        else:
            return (new_match[0], other_match[1], new_match[1])
find next matching pattern unchanged in both other and new
       return the position in all three lists
    
find next matching pattern unchanged in both other and new
return the position in all three lists
find next matching pattern unchanged in both other and new return the position in all three lists
def tripple_match(old, other, new, other_match, new_match):
    while 1:
        difference = new_match[0]-other_match[0]
        if difference > 0:
            match_len = match(old, other, other_match[0], other_match[1],
                              difference)
            if match_len == difference:
                return (new_match[0], other_match[1]+difference, new_match[1])
            else:
                other_match =  find_match(old, other,
                                          other_match[0] + match_len,
                                          other_match[1] + match_len)
        elif difference < 0:
            difference = -difference
            match_len = match(old, new, new_match[0], new_match[1],
                              difference)
            if match_len == difference:
                return (other_match[0], other_match[1],
                        new_match[0]+difference)
            else:
                new_match =  find_match(old, new,
                                        new_match[0] + match_len,
                                        new_match[1] + match_len)
        else:
            return (new_match[0], other_match[1], new_match[1])
def tripple_match ( old , other , new , other_match , new_match ) : while 1 : difference = new_match [ 0 ] - other_match [ 0 ] if difference > 0 : match_len = match ( old , other , other_match [ 0 ] , other_match [ 1 ] , difference ) if match_len == difference : return ( new_match [ 0 ] , other_match [ 1 ] + difference , new_match [ 1 ] ) else : other_match = find_match ( old , other , other_match [ 0 ] + match_len , other_match [ 1 ] + match_len ) elif difference < 0 : difference = - difference match_len = match ( old , new , new_match [ 0 ] , new_match [ 1 ] , difference ) if match_len == difference : return ( other_match [ 0 ] , other_match [ 1 ] , new_match [ 0 ] + difference ) else : new_match = find_match ( old , new , new_match [ 0 ] + match_len , new_match [ 1 ] + match_len ) else : return ( new_match [ 0 ] , other_match [ 1 ] , new_match [ 1 ] )
find next matching pattern unchanged in both other and new
return the position in all three lists
find next matching pattern unchanged in both other and new return the position in all three lists
"""find next matching pattern unchanged in both other and new
       return the position in all three lists
    """ # new changed more lines # other changed more lines # both conflicts change same number of lines # or no match till the end
old
other
new
other_match
new_match