
    q&f                     2    d dl mZ d dlmZ dZd Zd Zd Zy)   )_)errors   \ No newline at end of file
c                 .   	 |t        |      z
  }|t        |      z
  }t        ||      }|dk(  ryt        |      D ]  }	| j                         }
|
st	        j
                  t        d            |
t        k(  rt        |||       J|
dk(  s|
dk(  rd|
z   }
|j                  |
       |
j                  d      r|j                  |
dd        |
j                  d	      r|j                  |
       |j                  |
dd        |j                  |
        )
a  Read lines from fp into the hunk

    The hunk is parsed into two arrays, a and b. a gets the old state of
    the text, b gets the new state. The control char from the hunk is saved
    when inserting into a, but not b (for performance while deleting files.)
        s   incomplete hunk   
   
       +r   N   -)lenmaxrangereadliner   
ParseErrorr   MISSING_NEWLINE_MARKER
fixnewlineappend
startswith)fphunklenalenbabtodoatodobnumiss              6/usr/lib/python3/dist-packages/mercurial/diffhelper.pyaddlinesr!      s     s1vs1v%!8s 	AA&&q);'<==**4A&EzQ'\ 1HKKN||D!12d#12%	     c                     | d   }|j                  d      r|dd }n|dd }|j                  d      r|dd |d<   |j                  d      r||d<   || d<   y)zEFix up the last lines of a and b when the patch has no newline at EOFr   N)r	   r
   r   )r	   r   )endswithr   )r   r   r   lhlines        r    r   r   4   sj    RAzz'#2#2%ab	"%"DHr"   c                     t        |       }t        |      }|||z
  kD  s|dk  ryt        |      D ]  }| |   dd |||z      k7  s y y)zCompare the lines in a with the lines in b

    a is assumed to have a control char at the start of each line, this char
    is ignored in the compare.
    r   Fr   NT)r   r   )r   r   bstartalenblenr   s         r    testhunkr-   D   s`     q6Dq6DdVmvz4[ Q48qV}$ r"   N)i18nr    r   r   r!   r   r-    r"   r    <module>r1      s'     ; D r"   