Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/lib/python/mercurial/ancestor.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�
�c@sddkZd�ZdS(i�Nc	s'||jo|Snh�||g}h�x�o�|d}||�}|�|<|pd�|<|i�q0xN|D]F}||jp
||jo|Sn|�jo|i|�q}q}W|d|joAtg}|D]}|�|q��d�|<|i�q0q0W��fd���fd�}||�}	||�}
|	i�}|
i�}y�x�|d|djoJx+|dD]}
|
|djo|
Sq�q�W|
i�}|	i�}qu|d|djo|
i�}qu|	i�}quWntj
odSnXdS(s�
    return the least common ancestor of nodes a and b or None if there
    is no such ancestor.

    pfunc must return a list of parent vertices
    i�iic3s��||fg}t�}xy|oqti|�\}}||joK|i|�||fVx0�|D] }ti|�||f�qkWqqWdS(N(tsettheapqtheappoptaddtheappush(tvertexthtseentdtntp(tdepthtparentcache(s%/sys/lib/python/mercurial/ancestor.pyt	ancestors+s	


c3s�dt�}}xd�|�D]V\}}||jo0|o||fVn|t|f�}}q|i|�qW||fVdS(N(tNoneRR(Rtsgtstgtv(R
(s%/sys/lib/python/mercurial/ancestor.pytgenerations6s

N(tpoptappendtmintnextt
StopIterationR(tatbtpfunctvisitRtplR
t_[1]RtxtytgxtgyR((RRR
s%/sys/lib/python/mercurial/ancestor.pytancestor
sR





3(RR#(((s%/sys/lib/python/mercurial/ancestor.pys<module>s

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.