§
    	^µc  ã                   ó”   — d dl mZ d dlmZmZmZmZmZm	Z	 ddl
mZmZ  G d„ d¦  «        Zd„ Zd„ Zdd„Zd„ Z	 dd„Zdd„Zd„ Zd„ Zd
S )é    )Úgetattr)ÚcontextÚdagopÚ
extensionsÚhgwebÚpatchÚutilé   )r   Úrevmapc                   óJ   — e Zd ZdZd„ Zd„ Zd„ Zej        d„ ¦   «         Z	d„ Z
dS )Ú	_lazyfctxz<delegates to fctx but do not construct fctx when unnecessaryc                 ó0   — || _         || _        || _        d S ©N)Ú_nodeÚ_pathÚ_repo)ÚselfÚrepoÚnodeÚpaths       ú</usr/lib/python3/dist-packages/hgext/fastannotate/support.pyÚ__init__z_lazyfctx.__init__   s   € ØˆŒ
ØˆŒ
ØˆŒ
ˆ
ˆ
ó    c                 ó   — | j         S r   )r   ©r   s    r   r   z_lazyfctx.node!   ó
   € ØŒzÐr   c                 ó   — | j         S r   )r   r   s    r   r   z_lazyfctx.path$   r   r   c                 óL   — t          j        | j        | j        | j        ¦  «        S r   )r   Úresolvefctxr   r   r   r   s    r   Ú_fctxz_lazyfctx._fctx'   s   € åÔ" 4¤:¨t¬z¸4¼:ÑFÔFÐFr   c                 ó,   — t          | j        |¦  «        S r   )r   r    )r   Únames     r   Ú__getattr__z_lazyfctx.__getattr__+   s   € Ý�t”z 4Ñ(Ô(Ð(r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r	   Úpropertycacher    r#   © r   r   r   r      sx   € € € € € ØFÐFðð ð ð
ð ð ðð ð ð 
ÔðGð Gñ ÔðGð)ð )ð )ð )ð )r   r   c                 ó   — g }i }t           j        }t          |¦  «        D ]]\  }\  }}}	||	f|vrt          | ||	¦  «        |||	f<   |dz   }
|||	f         }||         }|                      |||
|¬¦  «        ¦  «         Œ^|S )z7convert fastannotate outputs to vanilla annotate formatr
   )ÚfctxÚlinenoÚtext)r   ÚannotatelineÚ	enumerater   Úappend)r   Ú	annotatedÚcontentsÚresultsÚfctxmapr.   ÚiÚhshÚlinenumr   r,   r+   Úlines                r   Ú_convertoutputsr9   /   s¯   € ð €GØ€GÝÔ%€LÝ#,¨YÑ#7Ô#7ð Jð JÑˆÑˆC�˜$Ø�ˆ;˜gÐ%Ð%Ý#,¨T°3¸Ñ#=Ô#=ˆG�S˜$�KÑ à˜1‘ˆØ˜˜T�{Ô#ˆØ˜Œ{ˆØ�Š�|�|¨°fÀ4ÐHÑHÔHÑIÔIÐIÐIØ€Nr   c                 óF   — | j         j                             dd¦  «        pdS )z(fctx) -> strs   fastannotates
   mainbranchs   default)r   ÚuiÚconfig)r+   s    r   Ú
_getmasterr=   A   s!   € àŒ:Œ=×Ò °Ñ?Ô?ÐMÀ:ÐMr   TNc                 ó(  — t          | ¦  «        }t          j        | ||¦  «        5 }	 |                     |                      ¦   «         |dd¬¦  «        \  }}nŠ# t
          $ r} |                     ¦   «          | j        j         	                    d| j
        z  ¦  «         	 |                     |                      ¦   «         |dd¬¦  «        \  }}n# t
          $ r ‚ w xY wY nw xY wddd¦  «         n# 1 swxY w Y   |r|sJ ‚t          | j        ||¦  «        S )zÃlike the vanilla fctx.annotate, but do it via fastannotate, and make
    the output format compatible with the vanilla fctx.annotate.
    may raise Exception, and always return line numbers.
    T)ÚmasterÚshowpathÚ	showliness*   fastannotate: %s: rebuilding broken cache
N)r=   r   ÚfctxannotatecontextÚannotateÚrevÚ	ExceptionÚrebuildr   r;   Údebugr   r9   )r+   ÚfollowÚdiffoptsr?   Úacr1   r2   s          r   Ú_doannotaterK   F   s€  € õ
 ˜ÑÔ€Få	Ô	$ T¨6°8Ñ	<Ô	<ð Àð	Ø"$§+¢+Ø—’‘
”
 6°DÀDð #.ñ #ô #ÑˆI�x�xøõ ð 
	ð 
	ð 
	Ø�JŠJ‰LŒLˆLØŒJŒM×ÒØ>ÀÄÑKñô ð ðØ&(§k¢kØ—H’H‘J”J v¸Èð '2ñ 'ô 'Ñ#�	˜8˜8øõ ð ð ð Øðøøøð $˜8ð
	øøøðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð" Ð!˜Ð!Ð!Ð!Ý˜4œ: y°(Ñ;Ô;Ð;sM   ¦C-¨.AÁC-ÁACÂ.CÃCÃCÃCÃC-ÃCÃC-Ã-C1Ã4C1c                 óT   — t          j        |ddd¬¦  «        }t          ||¬¦  «        S )NTó   annotate)Ú	untrustedÚsectionÚ
whitespace)rI   )r   ÚdifffeatureoptsrK   )Úorigr+   r;   rI   s       r   Ú_hgwebannotaterS   b   s7   € ÝÔ$Ø
�d K¸Dðñ ô €Hõ �t hÐ/Ñ/Ô/Ð/r   Fc                 óÚ   — |r | |||||¬¦  «        S 	 t          |||¦  «        S # t          $ r;}|j        j                             d|z  ¦  «          | ||||¬¦  «        cY d }~S d }~ww xY w)N)ÚskiprevsrI   s7   fastannotate: falling back to the vanilla annotate: %r
)rH   rU   rI   )rK   rE   r   r;   rG   )rR   r   rH   Ú
linenumberrU   rI   Úexs          r   Ú_fctxannotaterX   i   s¹   € ð ð 
àˆtØ�&˜*¨xÀ(ð
ñ 
ô 
ð 	
ðOÝ˜4 ¨Ñ2Ô2Ð2øÝð Oð Oð OØŒ
Œ×ÒØGÈ"ÑLñ	
ô 	
ð 	
ð ˆt�D °(ÀXÐNÑNÔNÐNÐNÐNÐNÐNÐNøøøøð	Oøøøs   ”% ¥
A*¯0A%ÁA*Á%A*c                 ó°   — t          j        |||¦  «        5 }t          j        |j        ¦  «        }d d d ¦  «         n# 1 swxY w Y    | |||||¬¦  «        S )N)rU   rI   Úprefetchskip)r   rB   r   Ú
revmappath)rR   r   rH   rU   rI   rJ   Úskipsets          r   Ú_remotefctxannotater]   z   sž   € å	Ô	$ T¨6°8Ñ	<Ô	<ð /ÀÝ”- ¤Ñ.Ô.ˆð/ð /ð /ñ /ô /ð /ð /ð /ð /ð /ð /øøøð /ð /ð /ð /àˆ4Øˆf˜x°(Èðñ ô ð s   —=½AÁAc                  óP   — t          j        t          j        dt          ¦  «         d S ©NrM   )r   Úwrapfunctionr   ÚwebutilrS   r)   r   r   Úreplacehgwebannotaterb   ƒ   s   € ÝÔ�EœM¨;½ÑGÔGÐGÐGÐGr   c                  óP   — t          j        t          j        dt          ¦  «         d S r_   )r   r`   Ú	hgcontextÚbasefilectxrX   r)   r   r   Úreplacefctxannotaterf   ‡   s    € ÝÔ�IÔ1°;ÅÑNÔNÐNÐNÐNr   )TN)FFNN)FNN)Úmercurial.pycompatr   Ú	mercurialr   rd   r   r   r   r   r	   Ú r   r   r9   r=   rK   rS   rX   r]   rb   rf   r)   r   r   ú<module>rj      s`  ðð 'Ð &Ð &Ð &Ð &Ð &ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð)ð )ð )ð )ð )ñ )ô )ð )ð,ð ð ð$Nð Nð Nð
<ð <ð <ð <ð80ð 0ð 0ð IMðOð Oð Oð Oð"ð ð ð ðHð Hð HðOð Oð Oð Oð Or   