-=[ Mr. Bumblebee ]=-
_Indonesia_
Nc @@ s d d l m Z d d l m Z d d l Z d d l m Z d d d g Z d Z d Z d
Z d Z
d e j f d
YZ d S( i ( t absolute_import( t bisectN( t muttert PatienceSequenceMatchert unified_difft unified_diff_filesc C@ s} i } xG t t | D]3 } | | } | | k rB d | | <q | | | <q Wd g t | } i } xp t | D]b \ } } | j | } | d k rv | | k r d | | | <| | =q | | | <| | | <qv qv Wd g t | } g }
g } d } xt | D]\ }
} | d k r,qn |
rQ|
d | k rQt |
} n\ |
r|
| | k r| t |
d k s|
| d | k r| d 7} n t |
| } | d k r| | d | |
<n | t |
k r| |
| <|
| | <q|
j | | j |
qWt | d k r+g Sg } | d } x1 | d k rn| j | | | f | | } q>W| j | S( s3 Find the longest common subset for unique lines.
:param a: An indexable object (such as string or list of strings)
:param b: Another indexable object (such as string or list of strings)
:return: A list of tuples, one for each line which is matched.
[(line_in_a, line_in_b), ...]
This only matches lines which are unique on both sides.
This helps prevent common lines from over influencing match
results.
The longest common subset uses the Patience Sorting algorithm:
http://en.wikipedia.org/wiki/Patience_sorting
i ii N( t xranget lent Nonet enumeratet getR t appendt reverse( t at bt indext it linet btoat index2t post nextt backpointerst stackst lastst kt bpost apost result( ( s; /usr/lib/python2.7/dist-packages/bzrlib/_patiencediff_py.pyt
unique_lcs_py sZ
,
c C@ s | d k r t d d St | } | | k s>