��Qc@s�ddlZddlZddlmZddlmZmZddlZd�Zd�Z d�Z
d�Zd�Zd �Z
dS(
i�N(t_(tshortthexcs��j�tg|dD]}�j|�^q�}��fd�}t}||d|d�\}}|s�t}||d|d�\}}n�j|�}|st|d�dkr�|d�dkr�jt d���ntjt d�|t
|�f��ni} tj|g�}
g}x�|
r�|
j�}||gkr8|j
|�x`�|�D]O}
|
dkrt|
| kr�| |
j
|�q�|g| |
<|
j
|
�qtqtWq8q8W|j�t|�}g|D]$}||kr�|kr�^q�|dks(|rQg|D]}�j|�^q/d |fS|d
}d}d}t�}xB|D]:}||kr�|j| j|g��qwn||p�|g}d||<t|�}||}t||�}||kr!||kr!|}|}||kr!Pq!n||krX||krX|j| j|g��qwnxV| j|g�D]B}||r�tt|||��||<qk||g||<qkWqwW|dk s�t��j|�}|g||fS(s�find the next node (if any) for testing during a bisect search.
returns a (nodes, number, good) tuple.
'nodes' is the final result of the bisect if 'number' is 0.
Otherwise 'number' indicates the remaining possible candidates for
the search and 'nodes' contains the next bisect target.
'good' is True if bisect is searching for a first good changeset, False
if searching for a first bad one.
tskipc sptg|D]}�j|�^q
�}g|D]}�j|�^q/}t|�}dgt��d}x|D]}g||<qtWxO�j|d�D]:}x1�|�D]#}||gkr�g||<q�q�Wq�Wx|D]}d||<q�xT�jt��|�D]:}||dkrx!�|�D]}d||<q1WqqW||dkrf|dfS||fS(Ni(tmintrevtNonetlentrevs( tbadtgoodtntbadrevtgoodrevstgoodrevt ancestorsRtprev(t changelogt clparents(s5/sys/lib/python2.7/site-packages/mercurial/hbisect.pytbuildancestorss&("
R R
is+starting revisions are not directly relateds)inconsistent state, %s:%s is good and badi�iiN(t
parentrevstsetRtFalsetTruetnodeRtutiltAbortRRtdequetpoplefttappendtsortRtupdatetgetRtlisttAssertionError(RtstateRRRR
RRR tchildrentvisitt
candidatesRRttottct unskippedtperfecttbest_revtbest_lentpoisontatxtytvaluet best_node((RRs5/sys/lib/python2.7/site-packages/mercurial/hbisect.pytbisectsx , ,
1)
!cCs�igd6gd6gd6gd6}tjj|jd��r�xx|jd�D]d}|d j�\}}|j|�}||kr�tjt d�|��n||j
|�qMWn|S(NtcurrentR
R Rsbisect.statei�sunknown bisect kind %s(tostpathtexiststjointopenertsplittlookupRRRR(trepoR#tltkindR((s5/sys/lib/python2.7/site-packages/mercurial/hbisect.pyt
load_state�s"cCs�|jdddt�}|j�}zWxFt|�D]8}x/||D]#}|jd|t|�f�qEWq4W|j�Wd|j�XdS(Nsbisect.statetwt
atomictemps%s %s
(R9RtwlocktsortedtwriteRtclosetrelease(R<R#tfRBR>R((s5/sys/lib/python2.7/site-packages/mercurial/hbisect.pyt
save_state�s%c
Csht|�}|dkr/t|jj||�Sd}|jd�}t|�dkred}d }nd
}d}d}d
|||f}d||f} d}
d}d|
||f}|dkr�|j|�S|dkr�j|�S|dkr|j| �S|dkr|j|�S|dkr6|j|�S|dkrO|j|�Stjtd���dS(s
Return a list of revision(s) that match the given status:
- ``good``, ``bad``, ``skip``: csets explicitly marked as good/bad/skip
- ``goods``, ``bads`` : csets topologically good/bad
- ``range`` : csets taking part in the bisection
- ``pruned`` : csets that are goods, bads or skipped
- ``untested`` : csets whose fate is yet unknown
- ``ignored`` : csets ignored due to DAG topology
- ``current`` : the cset currently being bisected
R
R RR4s9( bisect(bad)::bisect(good) | bisect(good)::bisect(bad) )sbisect(good)::bisect(bad)isbisect(good)::s
::bisect(bad)s::bisect(good)s
bisect(bad)::sbisect(skip)s( (%s) | (%s) | (%s) )s( (%s) - (%s) )s::bisect(bad) - ::bisect(good)s::bisect(good) - ::bisect(bad)s( ( (%s) | (%s) ) - (%s) )trangetprunedtuntestedtignoredtgoodstbadssinvalid bisect stateN(sgoodsbadsskipscurrent( R?tmapRRRRterrort
ParseErrorR(
R<tstatusR#RIt_tRMRNtskipsRJRKtibatigaRL((s5/sys/lib/python2.7/site-packages/mercurial/hbisect.pyR �s:
cCs|jj|�}|t|d�kr1td�S|t|d�krPtd�S|t|d�krotd�S|t|d�ks�|t|d�kr�td�S|t|d�kr�td�S|t|d�kr�d �S|t|d
�krtd�SdS(NR
R RtskippedRKR4RLRMsgood (implicit)RNsbad (implicit)(RRR RR(R<RR((s5/sys/lib/python2.7/site-packages/mercurial/hbisect.pytlabel�s
*
cCs|r|dj�SdS(Ni(tupperR(RX((s5/sys/lib/python2.7/site-packages/mercurial/hbisect.pyt
shortlabel�s(R5RPti18nRRRRRR3R?RHR RXRZ(((s5/sys/lib/python2.7/site-packages/mercurial/hbisect.pyt<module>s v C
|