§
    	^µc­1  ã                   ó�   — d dl Z ddlmZ ddlmZmZ  ej        d¦  «        Zd„ Zd„ Z	 G d„ d	¦  «        Z
d
„ Z G d„ d¦  «        ZdS )é    Né   )Únullrev)ÚdagopÚpolicyÚparsersc                 ó`  — t          |t          ¦  «        st          |¦  «        }t          |v rt          ¦   «         S t          |¦  «        dk    r|S dt          |¦  «        z  dz
  }dgt	          |¦  «        dz   z  }t          |¦  «        D ]\  }}d|z  ||<   Œd|dz   z  }t          ¦   «         }t          |¦  «        }t          |¦  «        dz
  }	|	dk    rØ|rÖ|	}
|	dz  }	||
         sŒ||
         }||k     r,|dz  }||k    r!|                     |
¦  «         ||z  }|
|v r|
hS ||k     rJ | |
¦  «        D ]=}||         }|t          k    rŒ|dk    r|||<   |dz  }Œ'||k    r||xx         |z  cc<   Œ>n4 | |
¦  «        D ](}|t          k    rŒ||         }|r||k     r|dz  }|||<   Œ)|	dk    r|°Ö|S )z»Returns a set with the heads of all common ancestors of all nodes,
    heads(::nodes[0] and ::nodes[1] and ...) .

    pfunc must return a list of parent vertices for a given vertex.
    r   r   )Ú
isinstanceÚsetr   ÚlenÚmaxÚ	enumerateÚadd)ÚpfuncÚnodesÚallseenÚseenÚiÚnÚpoisonÚgcaÚinterestingÚnvÚvÚsvÚpÚsps                 ú4/usr/lib/python3/dist-packages/mercurial/ancestor.pyÚcommonancestorsheadsr      s%  € õ �e�SÑ!Ô!ð Ý�E‘
”
ˆÝ�%ÐÐÝ‰uŒuˆÝ
ˆ5�z„z�Q‚€Øˆà•C˜‘J”J‰ !Ñ#€GØˆ3•#�e‘*”*˜q‘.Ñ!€DÝ˜%Ñ Ô ð ð ‰ˆˆ1Ø�q‘&ˆˆQ‰ˆØ�1�q‘5‰\€Få
‰%Œ%€CÝ�e‘*”*€KÝ	ˆT‰Œ�Q‰€BØ
�Š'ˆ'�kˆ'ØˆØ
ˆa‰ˆØ�AŒwð 	ØØ�!ŒWˆØ�Š;ˆ;Ø˜1ÑˆKØ�WŠ}ˆ}Ø—’˜‘
”
�
Ø�f‘�Ø˜�:�:à˜3�JØ�Š;ˆ;Ø�U˜1‘X”Xð "ð "�Ø˜!”W�Ø�’<�<ØØ˜’7�7Ø �D˜‘GØ 1Ñ$�K�KØ˜2’X�XØ˜�G�G”G˜r‘M�G�G‘Gøð"ð �U˜1‘X”Xð ð �Ø�’<�<ØØ˜!”W�Øð %˜"˜vš+˜+Ø 1Ñ$�KØ��Q‘�ð? �Š'ˆ'�kˆ'ð@ €Jó    c                 óh   ‡ — ˆ fd„}t          ‰ g|¢R Ž }t          |¦  «        dk    r|S  ||¦  «        S )z·
    Returns the common ancestors of a and b that are furthest from a
    root (as measured by longest path).

    pfunc must return a list of parent vertices for a given vertex.
    c                 óØ  •‡— i }t          | ¦  «        dz   }dg|z  }dg|z  }g }t          t          | ¦  «        ¦  «        D ]0\  }}d||<   d|z  }|||<   d||<   |                     ||f¦  «         Œ1|dz
  }	|	dk    �r?t	          |¦  «        dk    �r+|	}
|	dz  }	||
         }|dk    rŒ1||
         } ‰|
¦  «        D ]È}|t
          k    rŒ||         }||         }||k    rE|dz   ||<   ||k    r6||xx         dz  cc<   |||<   |r||xx         dz  cc<   ||         dk    r||= Œi||dz
  k    rV||z  }||k    rŒ~|||<   |                     |d¦  «         ||xx         dz  cc<   ||xx         dz  cc<   ||         dk    r||= ŒÉ||xx         dz  cc<   ||         dk    r||= |	dk    rt	          |¦  «        dk    �°+t	          |¦  «        dk    rg S dŠ|D ]}‰|z  ŠŒˆfd„|D ¦   «         S )Nr   r   c                 ó$   •— h | ]\  }}‰|z  ¯
|’ŒS © r#   )Ú.0r   r   Úks      €r   ú	<setcomp>z-ancestors.<locals>.deepest.<locals>.<setcomp>‹   s&   ø€ Ð1Ð1Ð1‘f�q˜!¨1¨q©5Ð1�Ð1Ð1Ð1r   )r   r   ÚsortedÚappendr   r   Ú
setdefault)r   r   ÚcountÚdepthr   Úmappingr   r   Úbr   r   Údvr   r   Údpr   Únspr%   r   s                    @€r   Údeepestzancestors.<locals>.deepestU   s±  øø€ ØˆÝ�E‘
”
˜Q‘ˆØ��e‘ˆØˆs�U‰{ˆØˆÝ¥ u¡¤Ñ.Ô.ð 	#ð 	#‰FˆQ�ØˆE�!‰HØ�Q‘ˆAØˆD�‰GØˆK˜‰NØ�NŠN˜A˜q˜6Ñ"Ô"Ð"Ð"Ø�Q‰YˆØ�AŠg‰g�#˜kÑ*Ô*¨QÒ.Ñ.ØˆAØ�!‰GˆBØ�q”ˆBØ�QŠwˆwØØ�a”ˆBØ�U˜1‘X”Xð ,ð ,�Ø�’<�<ØØ˜1”X�Ø˜!”W�Ø˜’8�8Ø! A™v�E˜!‘HØ˜R’x�xØ# B˜˜œ¨1Ñ,˜˜™Ø"$˜˜Q™Øð 4Ø'¨˜O˜OœO¨qÑ0˜O˜O™OØ*¨2œ°!Ò3Ð3Ø$/° OøØ˜2 ™6’\�\Ø˜r™'�CØ˜b’y�yØ Ø!�D˜‘GØ×*Ò*¨3°Ñ2Ô2Ð2Ø Ð$Ð$Ô$¨Ñ)Ð$Ð$Ñ$Ø �O�O”O qÑ(�O�O‘OØ" 2”¨!Ò+Ð+Ø'¨˜OøØ˜ˆOˆOŒO˜qÑ ˆOˆO‰OØ˜2Œ !Ò#Ð#Ø �OðC �AŠgˆg�#˜kÑ*Ô*¨QÒ.Ñ.õF ˆ{ÑÔ˜qÒ Ð ØˆIàˆØð 	ð 	ˆAØ�‰FˆAˆAØ1Ð1Ð1Ð1 Ð1Ñ1Ô1Ð1r   r   )r   r   )r   Ú	orignodesr1   r   s   `   r   Ú	ancestorsr3   M   sV   ø€ ð62ð 62ð 62ð 62ð 62õp ˜uÐ
1 yÐ
1Ð
1Ð
1€Cå
ˆ3�x„x�1‚}€}Øˆ
Øˆ7�3‰<Œ<Ðr   c                   ó6   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	dS )	Úincrementalmissingancestorsa  persistent state used to calculate missing ancestors incrementally

    Although similar in spirit to lazyancestors below, this is a separate class
    because trying to support contains and missingancestors operations with the
    same internal data structures adds needless complexity.c                 óˆ   — t          |¦  «        | _        | j        s| j                             t          ¦  «         || _        d S ©N)r
   Úbasesr   r   r   )Úselfr   r8   s      r   Ú__init__z$incrementalmissingancestors.__init__›   s8   € Ý˜‘Z”ZˆŒ
ØŒzð 	$ØŒJ�NŠN�7Ñ#Ô#Ð#ØˆŒ
ˆ
ˆ
r   c                 ó2   — | j         o| j         t          hk    S )z0whether the common set has any non-trivial bases)r8   r   ©r9   s    r   Úhasbasesz$incrementalmissingancestors.hasbases¡   s   € àŒzÐ5˜dœj­W¨IÒ5Ð5r   c                 ó:   — | j                              |¦  «         dS )z)grow the ancestor set by adding new basesN)r8   Úupdate)r9   Únewbasess     r   Úaddbasesz$incrementalmissingancestors.addbases¥   s   € àŒ
×Ò˜(Ñ#Ô#Ð#Ð#Ð#r   c                 ó@   — t          j        | j        | j        ¦  «        S r7   )r   Úheadrevsr8   r   r<   s    r   Ú
basesheadsz&incrementalmissingancestors.basesheads©   s   € ÝŒ~˜dœj¨$¬*Ñ5Ô5Ð5r   c                 óì  ‡— | j         }| j        }|                     |¦  «         |                     t          ¦  «         |sdS t          |¦  «        Št          ˆfd„|D ¦   «         ¦  «        }t          |¦  «        |k    rdS t          ‰t          |¦  «        dz
  d¦  «        D ]P}||vrŒ|                     |¦  «         | 
                     ||¦  «        ¦  «         t          |¦  «        |k    r dS ŒQdS )z:remove all ancestors of bases from the set revs (in place)Nc              3   ó(   •K  — | ]}|‰k    ¯d V — ŒdS )r   Nr#   )r$   ÚrÚstarts     €r   ú	<genexpr>zBincrementalmissingancestors.removeancestorsfrom.<locals>.<genexpr>¸   s'   øè è € Ð5Ð5˜a¨1¨uª9¨9˜¨9¨9¨9¨9Ð5Ð5r   r   éÿÿÿÿ)r8   r   Údifference_updateÚdiscardr   r   Úsumr   ÚrangeÚminr?   )r9   Úrevsr8   r   Ú	keepcountÚcurrrH   s         @r   Úremoveancestorsfromz/incrementalmissingancestors.removeancestorsfrom¬   s  ø€ à”
ˆØ”
ˆØ×Ò˜uÑ%Ô%Ð%à�Š•WÑÔÐØð 	ØˆFõ �E‘
”
ˆÝÐ5Ð5Ð5Ð5 4Ð5Ñ5Ô5Ñ5Ô5ˆ	Ýˆt‰9Œ9˜	Ò!Ð!àˆFå˜%¥ T¡¤¨Q¡°Ñ3Ô3ð 	ð 	ˆDØ˜5Ð Ð ØØ�LŠL˜ÑÔÐØ�LŠL˜˜˜t™œÑ%Ô%Ð%Ý�4‰yŒy˜IÒ%Ð%à��ð &ð	ð 	r   c                 ó’  — t          |¦  «        }| j        }| j        }|                     |¦  «        }|                     |¦  «         |sg S t          t          |¦  «        t          |¦  «        ¦  «        }g }t          |t          d¦  «        D �]#}|s �n||v rc|                     |¦  «          ||¦  «        D ]A}	| 	                    |	¦  «         | 
                    |	¦  «         | 
                    |	¦  «         ŒBŒo||v r/|                     |¦  «         |                     |¦  «         |}
|}n
||v r|}
|}nŒ¬ ||¦  «        D ]k}	|	t          k    rŒ|	|v s|	|v r@| 	                    |	¦  «         | 
                    |	¦  «         | 
                    |	¦  «         ŒV|
 
                    |	¦  «         Œl�Œ%|                     ¦   «          |S )a   return all the ancestors of revs that are not ancestors of self.bases

        This may include elements from revs.

        Equivalent to the revset (::revs - ::self.bases). Revs are returned in
        revision number order, which is a topological order.rJ   )r
   r8   r   ÚintersectionrK   r   rN   r   ÚremoverL   r   r(   Úreverse)r9   rP   Ú	revsvisitÚ
basesvisitr   Ú	bothvisitrH   ÚmissingrR   r   Ú	thisvisitÚ
othervisits               r   Úmissingancestorsz,incrementalmissingancestors.missingancestorsÆ   s  € õ ˜‘I”Iˆ	Ø”Zˆ
Ø”
ˆØ×*Ò*¨:Ñ6Ô6ˆ	Ø×#Ò# IÑ.Ô.Ð.Øð 	ØˆIå•C˜	‘N”N¥C¨
¡O¤OÑ4Ô4ˆð  ˆÝ˜%¥¨"Ñ-Ô-ð %	%ñ %	%ˆDØð Ø‘à�yÐ Ð Ø× Ò  Ñ&Ô&Ð&ð ˜˜t™œð %ð %�AØ×%Ò% aÑ(Ô(Ð(Ø—N’N 1Ñ%Ô%Ð%Ø—M’M !Ñ$Ô$Ð$Ð$Øà�yÐ Ð Ø—’˜tÑ$Ô$Ð$Ø× Ò  Ñ&Ô&Ð&Ø%�	Ø'�
�
Ø˜Ð#Ð#Ø&�	Ø&�
�
ð à�U˜4‘[”[ð %ð %�Ø�’<�<ØØ˜*�_�_¨¨Y¨¨ð ×%Ò% aÑ(Ô(Ð(Ø—N’N 1Ñ%Ô%Ð%Ø—M’M !Ñ$Ô$Ð$Ð$ð —M’M !Ñ$Ô$Ð$Ð$ñ%ð 	�ŠÑÔÐØˆr   N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r:   r=   rA   rD   rS   r^   r#   r   r   r5   r5   ”   s}   € € € € € ð?ð ?ðð ð ð6ð 6ð 6ð$ð $ð $ð6ð 6ð 6ðð ð ð4Hð Hð Hð Hð Hr   r5   c              #   óœ  K  — t           h}t          j        }t          j        }t          j        }|j        }|r6d„ |D ¦   «         }	|                     |¦  «         t          j        |	¦  «         nag }	t          j        |	¦  «         |D ]H}
 | |
¦  «        \  }}||vr ||	| ¦  «          ||¦  «         ||vr ||	| ¦  «          ||¦  «         ŒI|	r{|	d          }||k     rd S |V —  | |¦  «        \  }}||vr)||z
  dk    r| |	d<   n ||	| ¦  «          ||¦  «         n ||	¦  «         ||vr ||	| ¦  «          ||¦  «         |	°yd S d S )Nc                 ó   — g | ]}| ‘ŒS r#   r#   )r$   rG   s     r   ú
<listcomp>z&_lazyancestorsiter.<locals>.<listcomp>  s   € Ð&Ð&Ð&˜�!�Ð&Ð&Ð&r   r   r   )r   ÚheapqÚheappushÚheappopÚheapreplacer   r?   Úheapify)Ú
parentrevsÚinitrevsÚstoprevÚ	inclusiver   rg   rh   ri   ÚseeÚvisitrG   Úp1Úp2Úcurrents                 r   Ú_lazyancestorsiterrt     sÒ  è è € Ýˆ9€DÝŒ~€HÝŒm€GÝÔ#€KØ
Œ(€Càð Ø&Ð&˜XÐ&Ñ&Ô&ˆØ�Š�HÑÔÐÝŒ�eÑÔÐÐàˆÝŒ�eÑÔÐØð 	ð 	ˆAØ�Z ‘]”]‰FˆB�Ø˜ˆ~ˆ~Ø�˜  Ñ$Ô$Ð$Ø��B‘”�Ø˜ˆ~ˆ~Ø�˜  Ñ$Ô$Ð$Ø��B‘”�øà
ð Ø˜”8�)ˆØ�WÒÐØˆEØˆˆˆð �˜GÑ$Ô$‰ˆˆBØ�Tˆ>ˆ>Ø˜‰|˜qÒ Ð Ø˜3��a‘�à�˜E B 3Ñ'Ô'Ð'ØˆC�‰GŒGˆGˆGàˆG�E‰NŒNˆNØ�Tˆ>ˆ>ØˆH�U˜R˜CÑ Ô Ð ØˆC�‰GŒGˆGð% ð ð ð ð ð r   c                   ó,   — e Zd Zdd„Zd„ ZeZd„ Zd„ ZdS )	Úlazyancestorsr   Fc                 óÔ   ‡— || _         ˆfd„|D ¦   «         | _        ‰| _        || _        t	          ¦   «         | _        t          | j         | j        | j        | j        ¦  «        | _        dS )aÖ  Create a new object generating ancestors for the given revs. Does
        not generate revs lower than stoprev.

        This is computed lazily starting from revs. The object supports
        iteration and membership.

        cl should be a changelog and revs should be an iterable. inclusive is
        a boolean that indicates whether revs should be included. Revs lower
        than stoprev will not be generated.

        Result does not include the null revision.c                 ó    •— g | ]
}|‰k    ¯|‘ŒS r#   r#   )r$   rG   rm   s     €r   re   z*lazyancestors.__init__.<locals>.<listcomp>L  s   ø€ Ð:Ð:Ð: ¨Q°'ª\¨\˜!¨\¨\¨\r   N)Ú_parentrevsÚ	_initrevsÚ_stoprevÚ
_inclusiver
   Ú_containsseenrt   Ú_containsiter)r9   r   rP   rm   rn   s      ` r   r:   zlazyancestors.__init__?  sl   ø€ ð !ˆÔØ:Ð:Ð:Ð: TÐ:Ñ:Ô:ˆŒØˆŒØ#ˆŒå ™UœUˆÔÝ/ØÔ˜dœn¨d¬m¸T¼_ñ
ô 
ˆÔÐÐr   c                 ób   — 	 t          t          | ¦  «        ¦  «         dS # t          $ r Y dS w xY w)z*False if the set is empty, True otherwise.TF)ÚnextÚiterÚStopIterationr<   s    r   Ú__nonzero__zlazyancestors.__nonzero__U  sB   € ð	Ý•�d‘”ÑÔÐØ�4øÝð 	ð 	ð 	Ø�5�5ð	øøøs   ‚   
.­.c                 óN   — t          | j        | j        | j        | j        ¦  «        S )a  Generate the ancestors of _initrevs in reverse topological order.

        If inclusive is False, yield a sequence of revision numbers starting
        with the parents of each revision in revs, i.e., each revision is
        *not* considered an ancestor of itself. Results are emitted in reverse
        revision number order. That order is also topological: a child is
        always emitted before its parent.

        If inclusive is True, the source revisions are also yielded. The
        reverse revision number order is still enforced.)rt   ry   rz   r{   r|   r<   s    r   Ú__iter__zlazyancestors.__iter___  s(   € õ "ØÔ˜dœn¨d¬m¸T¼_ñ
ô 
ð 	
r   c                 óÒ   — | j         }||v rdS | j        }|€dS |€dS |j        }	 	 t          |¦  «        } ||¦  «         ||k    rdS ||k     rdS Œ+# t          $ r d| _        Y dS w xY w)z5Test whether target is an ancestor of self._initrevs.TNF)r}   r~   r   r€   r‚   )r9   Útargetr   r�   ro   Úrevs         r   Ú__contains__zlazyancestors.__contains__n  s®   € àÔ!ˆØ�Tˆ>ˆ>Ø�4ØÔ!ˆØˆ<à�5ð ˆ>Ø�5àŒhˆð	ð!Ý˜4‘j”j�Ø��C‘”�Ø˜&’=�=Ø˜4Ø˜’<�<Ø ˜5ð!øõ ð 	ð 	ð 	ð "&ˆDÔØ�5�5ð		øøøs   ¥!A ÁA ÁA ÁA&Á%A&N)r   F)r_   r`   ra   r:   rƒ   Ú__bool__r…   r‰   r#   r   r   rv   rv   >  s\   € € € € € ð
ð 
ð 
ð 
ð,ð ð ð €Hð
ð 
ð 
ðð ð ð ð r   rv   )rf   Únoder   Ú r   r   Ú	importmodr   r   r3   r5   rt   rv   r#   r   r   ú<module>rŽ      sþ   ðð €€€à Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð
 ˆ&Ô
˜9Ñ
%Ô
%€ð6ð 6ð 6ðrDð Dð DðNzð zð zð zð zñ zô zð zð|)ð )ð )ðXKð Kð Kð Kð Kñ Kô Kð Kð Kð Kr   