
    6h	                    >    S SK Jr  SSKJr  SSKJr  SrS rS rS r	g	)
    )annotations   )_)errors   \ No newline at end of file
c                ^    U[        U5      -
  nU[        U5      -
  n[        Xg5      nUS:X  a  g[        U5       H  n	U R                  5       n
U
(       d  [        R
                  " [        S5      5      eU
[        :X  a  [        XU5        MQ  U
S:X  d  U
S:X  a  SU
-   n
UR                  U
5        U
R                  S5      (       a  UR                  U
SS 5        M  U
R                  S	5      (       a  UR                  U
5        M  UR                  U
SS 5        UR                  U
5        M     GM-  )
zRead 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.)
r   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);'<==**4A&EzQ'\ 1HKKN||D!!12d##12%      c                    U S   nUR                  S5      (       a  USS nOUSS nUR                  S5      (       a  USS US'   UR                  S5      (       a  XAS'   X@S'   g)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   5   so    RAzz'#2#2%%ab	"%%"Hr#   c                    [        U 5      n[        U5      nX4U-
  :  d  US:  a  g[        U5       H  nX   SS XU-      :w  d  M    g   g)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.   E   sU     q6Dq6DVmvz4[48qV}$  r#   N)

__future__r   i18nr    r   r   r"   r   r.    r#   r!   <module>r3      s*    #  ; D r#   