³ò ÷$•Jc@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 o dSnXdS(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(tdeptht parentcache(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.pyt generations6s  N(tpoptappendtmintnextt StopIterationR(tatbtpfunctvisitRtplR t_[1]RtxtytgxtgyR((R R R s%/sys/lib/python/mercurial/ancestor.pytancestor sR        3        (RR#(((s%/sys/lib/python/mercurial/ancestor.pyss