mò óRÅDc@s’dklZdklZeeƒdƒdZd d„Zd„Z de fd„ƒYZ d„Z d d „Z hde ged ƒfcCsR|iƒ\}}}}}|p|p|o|idƒt i dƒndS(Ns1Repository is not clean, please commit or revert i( RtchangestmodifiedtaddedtremovedtdeletedtunknownRtwarntsystexit(RRRRRRR((Rt check_cleans tbisectcBs˜tZdZd„Zd„Zd„Zd„Zeed„Zeed„Z ed„Z d„Z d „Z d „Z ed „Zd „Zed „ZRS(s*dichotomic search in the DAG of changesetscCs`||_|idƒ|_ti|iƒ|_||_g|_d|_ d|_ d|_ d|_ d|_ tiitii|i|i ƒƒoU|i|i ƒiƒiƒ|_g}|iD]}|ti|ƒqÆ~|_ntiitii|i|i ƒƒoH|i|i ƒiƒiƒ}|oti|idƒƒ|_ q\ndS(NRitgoodtbad(RtselftjointpathR topenerRtgoodrevsRtbadrevt good_dirtyt bad_dirtyt good_pathtbad_pathtostexiststreadt splitlinesRtxRtbintrR(RRRR/RR-((Rt__init__!s"        (!4(cCsÛtii|iƒpdSn|i|idƒ}|idig}|i D]}|t i |ƒqM~ƒƒt|i ƒdjo|idƒn|i|idƒ}|io!|it i |iƒdƒndS(Ntws i(R)R!tisdirRR"R'tftwriteR RR#R/RthexR R(R$(RR3RR/((Rt__del__5s= cCsVtii|iƒotitdƒƒ‚nti|iƒt|i |i ƒdS(sstart a new bisections bisect directory already exists iN( R)R!R2RR R R tmkdirRRR(R((Rtinit@s cCs¢tii|iƒoˆg}|i|igD]}|tii|i|ƒq-~}x2|D]*}tii |ƒoti |ƒq\q\Wti |iƒndS(sfinish a bisectioniN(R)R!R2RRR(R'RR tsltsR*tunlinktrmdir(RRRR:R9((RtresetHs?cCs.|djo |i}n|i||ƒdS(s® returns a dict with the mapping: node -> number of ancestors (self included) for all nodes who are ancestor of head and not in stop. iN(theadRRR$t#_bisect__ancestors_and_nb_ancestorststop(RR>R@((Rt num_ancestorsVs  cCs.|djo |i}n|i||ƒdS(sg returns the set of the ancestors of head (self included) who are not in stop. iN(R>RRR$R?R@(RR>R@((Rt ancestorsas  c sV|ii‰|pttigƒ}xbtt|i ƒdddƒD]=}|i |}||joqBn|i ˆi |ƒƒqBWn‡d†} ||jo5titdƒˆi|ƒti|ƒfƒ‚n| |ƒ}xhtˆi|ƒdƒD]M}ˆi|ƒ} g}ˆi| ƒD]!} | tijo || q$q$~} x| D]y} || dcd8<| |jo!|| di|| dƒn|| ddjot|| dƒ|| number of ancestors (self included) iiÿÿÿÿcsåh|dtigƒg<}xÀtˆi|ƒdƒD]¥}ˆi|ƒ}|i |ƒpdtigƒg|| [number of children, empty set] iiN(tatsetstSettdtxrangetclRtitnodetnthas_keyRRRRR (RCRFRIRKRRR(RH(Rt num_children{s>s)Unconsistent state, %s:%s is good and badiN( RRt changelogRHR@RDRERGR R#RItgtupdatet reachableRMR>R R R RRtshorttn_childRJRKRRRR t union_updatetaddtanc( RR>R@RRORHRIRVRSRKRRMR((RHRt__ancestors_and_nb_ancestorsjs@      5 > !    c Cs|iptitdƒƒ‚n|ip0|iitdƒƒ|iitdƒƒn|i|iƒ\}}t |ƒ}|djo{|i ƒ|ijotitdƒƒ‚n|iitdƒƒti|i|ihƒ} | id|iƒdSnd}d} xH|D]@}||} t| || ƒ} | | jo| } |}qqW|dj pt‚d }t|d ƒ\}}x+|o#|d7}t|d ƒ\}}q’Wtd ƒ|iii |ƒt!i"|ƒ||f} |ii| ƒ|S( Ns)You should give at least one bad revisionsNo good revision given s#Marking the first revision as good is%Could not find the first bad revisionsThe first bad revision is: t changenodeiÿÿÿÿiis=Testing changeset %s:%s (%s changesets remaining, ~%s tests) ($RR$R R R R#RRR?RBRAR ttotRR4tcommandstshow_changesetRt displayertshowRtbest_revtbest_lenRKtltmintAssertionErrortnb_teststdivmodtqR/RNRRRRtmsg( RReRBRcRAR^RYRKR/R_RfR\R`((RtnextŸsB       4cCsJt|i|iƒ|iƒ}|dj o|ii|dtƒSndS(s,find and update to the next revision to testtforceN( RRRRRgRRRPtTrue(RR((RtautonextÃs   cCs|ii|ƒdS(N(RR#tappendR(RR((RRÊscCsTt|i|iƒt|i|i|ƒ}|i|ƒ|io|iƒSndS(s=mark revision as good and update to the next revision to testN( RRRRRRRR$Rj(RR((RtautogoodÍs   cCs ||_dS(N(RRR$(RR((RRÕscCsTt|i|iƒt|i|i|ƒ}|i|ƒ|io|iƒndS(s<mark revision as bad and update to the next revision to testN( RRRRRRRR#Rj(RR((RtautobadØs   (t__name__t __module__t__doc__R0R6R8R=RRARBR?RgRjRRlRRm(((RRs      5 $    cCsnt||ƒ}|i|ƒ}|idti|ƒƒ|i ƒ}xÆt |ƒdjo²||jo|i dƒt idƒn|idƒ|iƒ}|idƒ||i d|ƒjo|i|ƒ|idƒn|i|ƒ|idƒ|i ƒ}qGWx0|D](}||jo|i d ƒdSqqW|id ti|iƒƒ|id ƒd S(stest the bisection codestesting with rev %s isfailure while bisecting s it worked :) schoosing if good or bad R>s it is bad s it is good sfail to found cset! :( sFound bad cset: %s sEverything is ok :) iN(RRRtbRRR4RR5RBRVR RRRRgtnew_revRRtvR$(RRRRqRVRrRs((Rttestás6             c s?d‡‡d†}tˆ|ƒ}hd|idtdƒf<d|idtdƒf<d|i dtd ƒf<d |i dtd ƒf<d |i dtd ƒf<d|dtdƒf<‰ˆi |ƒpˆitdƒƒ|ƒSnt|ƒˆ|djoˆitdƒƒ|ƒSnˆ|d|ŒS(sfbisect extension: dichotomic search in the DAG of changesets for subcommands see "hg bisect help" c sˆ}|oM||di}||d}ˆi|dƒˆid|dƒdSnˆitdƒƒ|i ƒ}|i ƒt g}|D]}|t|ƒq‘~ƒ}xL|D]D}||diidƒdiƒ}ˆid|||fƒq·WdS(s:show help for a given bisect subcommand or all subcommandsiis Ns.list of subcommands for the bisect extension s %-*s %s (tbisectcmdtabletcmdtabletcmdRptdoctsynopsisRR4R tkeystcmdstsorttmaxRtcR tmR,trstrip( RwtargsR~RxRvRR{RRy(RRu(Rthelp_s   -$R8ishg bisect initRishg bisect bad []Rshg bisect good []Rgshg bisect nextR=shg bisect resetthelpshg bisect help []sbisect: Unknown sub-command sbisect: Too many arguments N(RR‚RRRRqR8R RmRlRjR=RuRLRwRR R(RRRwRRqR‚Ru((RRuRt bisect_runþs¥   s)hg bisect [help|init|reset|next|good|bad]N(tmercurial.i18ntgettextR tmercurial.demandloadt demandloadtglobalst versionstrRRRtobjectRRtR„Rv( RRRˆRvRŠRR„RtR ((Rt? s     '