³ò ø$•Jc @sèddklZlZlZlZddklZddkZddkZddk Z ddk Z ddk Z ddk Z ddk Z defd„ƒYZd„Zd„Zd„Zd „Zd „Zd „Zd „Zd „ZdS(iÿÿÿÿ(tnullidtnullrevthextbin(t_Nt mergestatecBskeZdZd„Zd d„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z RS( s+track 3-way merge state of individual filescCs||_|iƒdS(N(t_repot_read(tselftrepo((s"/sys/lib/python/mercurial/merge.pyt__init__s cCs=h|_|o ||_nti|iidƒtƒdS(Ntmerge(t_statet_localtshutiltrmtreeRtjointTrue(Rtnode((s"/sys/lib/python/mercurial/merge.pytresets  c CsÊh|_y‹d}|iidƒ}x]t|ƒD]O\}}|djo|d }q1|d idƒ}|d|i|d|iiƒD]-\}}|idi|g|ƒdƒq?WdS(Ns merge/statetws R(RRtwriteRR R t iteritemsR(RRtdtv((s"/sys/lib/python/mercurial/merge.pyt_write&s  cCsti|iƒƒiƒ}|iid|dƒi|iƒƒd||iƒ|iƒt|i ƒƒ|iƒ|g|i |<|i ƒdS(Nsmerge/R"tu( tutiltsha1tpatht hexdigestRRR#tdataRtfilenodeR R'(Rtfcltfcotfcatfdtflagsthash((s"/sys/lib/python/mercurial/merge.pytadd+s &(cCs ||ijS(N(R (Rtdfile((s"/sys/lib/python/mercurial/merge.pyt __contains__1scCs|i|dS(Ni(R (RR6((s"/sys/lib/python/mercurial/merge.pyt __getitem__3sccs3|iiƒ}|iƒx|D] }|Vq WdS(N(R tkeystsort(RRR((s"/sys/lib/python/mercurial/merge.pyt__iter__5s  cCs||i|d<|iƒdS(Ni(R R'(RR6tstate((s"/sys/lib/python/mercurial/merge.pytmark:scCsÜ||djodSn|i|\}}}}}} } |iid|ƒ} |ii|| iƒ| ƒ||} || } |ii|d|ƒ}ti|i|i|| | |ƒ}|p|i|dƒn|S(Ntrismerge/tfileid( R RRtwwritetreadtfilectxt filemergeR R=(RR6twctxtoctxR<R4tlfiletafiletanodetofileR3RtfcdR0R1R>((s"/sys/lib/python/mercurial/merge.pytresolve=s"  $N(t__name__t __module__t__doc__R RRRR'R5R7R8R;R=RK(((s"/sys/lib/python/mercurial/merge.pyR s         cCscx\|iƒD]N}||jo;||i||iƒƒotitdƒ|ƒ‚q q WdS(s<check for collisions between unknown files and files in mctxsQuntracked file in working directory differs from file in requested revision: '%s'N(tunknowntcmpR-R)tAbortR(RDtmctxR((s"/sys/lib/python/mercurial/merge.pyt _checkunknownKs  +cCseh}xX|D]P}|iƒ}||jo'titdƒ|||fƒ‚n|||R(tdeletedtappendtremoved(RDRRt branchmergetactionR<R((s"/sys/lib/python/mercurial/merge.pyt_forgetremoved\s    cs˜‡‡‡‡fd†}‡‡fd†}gh‰}|o |}n«||jo|iƒ}nŽ|o†ˆiiddtƒomˆiiddtƒ} tiˆ|||| ƒ\}} x1| iƒD]\} } |dd| | ƒqËWnˆiitdƒƒˆiitd ƒ|t |ƒfƒˆiitd ƒ|||fƒ|i ƒ|i ƒ|i ƒ‰‰‰t |i ƒƒ} xVˆiƒD]H\}}|o||ƒ oq–n|ˆjo»||||ƒ}ˆi |tƒ}|ˆ|jpˆ||jo1ˆi|ƒ|jo|d d ||ƒq‚qÞ||jo|d d||ƒqÞ|dd||||tƒq–|| joq–||joq||}|ˆjo*|d|d|d(|ˆi|ƒƒqÞ|d|d|||||||ƒtƒq–|ˆjo¼|ˆ|jo]ˆiitdƒ|tdƒtdƒfdƒo|dd|ƒqÚ|dd|ƒqÞ|ddjo|dd|ƒqÞ|ddjo|d d|ƒqÞq–q–Wx¯ˆiƒD]¡\}}|o||ƒ oqïn|ˆjp || joqïn||jo®||}|ˆjo*|d!|dd(||ˆi|ƒƒq|ˆjo0|d"|d|||||||ƒtƒq|d#|d|||||||ƒtƒqï|ˆjo |d$d|ˆi|ƒƒqï|ˆ|jo_ˆiitd%ƒ|tdƒtd&ƒfdƒdjo |d'd|ˆi|ƒƒqqïqïWˆS()s§ Merge p1 and p2 with ancestor ma and generate merge action list overwrite = whether we clobber working files partial = function to filter file lists csˆi|ƒˆi|ƒˆi|ƒ}}}||jo|Sn|o~|ow| ooˆiitdƒ|tdƒtdƒtdƒfdƒ}|djodSn|djod Snd Sn|o||jo|Sn|o||jo|Snd S( s merge flagss6 conflicting flags for %s (n)one, e(x)ec or sym(l)ink?s&NonesE&xecsSym&linkiitxiRt(R3tuit promptchoiceR(Rtf2tfatatmtnR>(tmaR tm1tm2(s"/sys/lib/python/mercurial/merge.pytfmerge€s /   'cs8ˆiid|||fƒˆi||f|ƒdS(Ns %s: %s -> %s (RatdebugRZ(tmsgRfRtargs(R R](s"/sys/lib/python/mercurial/merge.pytact“sR t followcopiest followdirssdivergent renamestdrsresolving manifests s overwrite %s partial %s s ancestor %s local %s remote %s supdate permissionstesremote is newertgsversions differRfsremote renamed directory to R%slocal copied/moved to sI local changed %s which remote deleted use (c)hanged version or (d)elete?s&Changeds&Deleteis prompt deleteR>s prompt keepReisremote deletedRR(s other deletedslocal renamed directory to sremote copied to sremote moved to sremote createdsOremote changed %s which local deleted use (c)hanged version or leave (d)eleted?s&Deletedsprompt recreatingN(tp1Rat configboolRtcopiesR$tnoteRRltbooltmanifesttsettvaluestgetRR3tFalseRRb(R Rutp2tpat overwritetpartialRkRotcopytdirstdivergetoftfltcopiedRRgtrflagsReRc((RiRjR RhR]s"/sys/lib/python/mercurial/merge.pyt manifestmergexsš    ! &#&  "        #          # #    %(cCs"|ddjodpd|fS(NiR>iÿÿÿÿi((Re((s"/sys/lib/python/mercurial/merge.pyt actionkeyësc Cs9d\}}}}t|ƒ}|i|iƒdiƒƒg} |idtƒ|i} xð|D]è} | d \} } | djoÅ| d\}}}}| djoqan|iit dƒ| |fƒ|| }||}|i |ƒp|i | dt ƒ}|i |||||ƒ| |jo|o| i| ƒqIqaqaWx[| D]S} ti|i| ƒƒo4|iit dƒ| ƒti|i| ƒƒqTqTWti|iƒ}xi|D]a} | d \} } | o| dd joqÄn| d joÅ|iit dƒ| ƒ|| ƒ| djoti||||ƒnyti|i| ƒƒWnOtj oC}|itijo'|iit d ƒ| |ifƒq½nX|d 7}qÄ| djo8| djo&ti||||i |ƒƒqÄn| d\}}}}|i|||ƒ}|dj o|djo|d 7}n&|djo|d 7}n |d 7}ti |i|ƒd |jd|jƒ| |joT|oMti|i| ƒƒo4|iit dƒ| ƒti|i| ƒƒq%qÄ| djo| d}|iit dƒ| ƒ|i | ƒi!ƒ}|i"| ||ƒ|d 7}| djoti||||ƒq%qÄ| djoÝ| d\}}}| ob|iit dƒ| |fƒ|i | ƒi!ƒ}|i"|||ƒti|i| ƒƒn|oL|iit dƒ||fƒ|i |ƒi!ƒ}|i"|||ƒn|d 7}qÄ| djoM| d}|iit dƒ| ƒxi|D]}|iid|ƒqÀWqÄ| djo6| d}ti |i| ƒd |jd|jƒqÄqÄW||||fS(s4apply the merge action list to the working directoryitkeyiRfs .hgsubstates preserving %s for resolve of %s R?s removing %s t/R>s update failed to remove %s: %s! iRR_Rts getting %s R%smoving %s to %s sgetting %s to %s Rrs.warning: detected divergent renames of %s to: s %s Rs(iiiiN(#RRtparentsRR:R‹tsubstateRaRlRtancestorRBRR5RZR)tlexiststwjointostunlinkt path_auditortrootRxtsubrepotsubmergetOSErrorRRtwarntstrerrorRKRt set_flagsR-R@(R R]RDRRtupdatedtmergedR[t unresolvedtmstmovesRReRRfRcR2R3tmoveR/R0R1t audit_pathtinstR>ttR‡tnf((s"/sys/lib/python/mercurial/merge.pyt applyupdatesîs°       %       (-           0c Cs°x©|D]¡}|d \}}|djo/|o|ii|ƒq¨|ii|ƒq|djo|p|ii|ƒq¨q|djo|ii|ƒq|djo|ii|ƒq|djo/|o|ii|ƒq¨|ii|ƒq|djoÃ|d\}}}} |ow|ii|ƒ||joV| o|ii|ƒn||jo|ii||ƒq |ii||ƒqÏq¨|ii|ƒ| o|ii|ƒq¨q|djoÈ|d\}}}| o||ijoqn|o`|ii|ƒ|o'|ii|ƒ|ii||ƒn|o|ii||ƒq¤q¨|ii|ƒ|o|ii|ƒq¨qqWd S( s$record merge actions to the dirstateiR>ReRRsRtRfR%N( tdirstatetremovetforgetR5t normallookupt normaldirtytnormalR Rƒ( R R]R\ReRRfRcR2tflagR¢((s"/sys/lib/python/mercurial/merge.pyt recordupdatesOsZ         cCs7|iƒ}z|d}|djoyy|iƒ|iƒ}WqŸtj oL|iƒdjo|idƒ}q›titdƒ|iƒƒ‚qŸXn|o| }|i ƒ}|d||} } | i | ƒ} | i ƒ| i ƒt | ƒt | ƒf\} } }}t }| o,t|ƒdjotitdƒƒ‚n|o®| | jotitdƒƒ‚nJ| | jo<| iƒ| iƒjo t}qÃtitdƒƒ‚n| o3|iƒp |iƒotitd ƒƒ‚qÉnÈ|pÀ| | jp | | joqÉ| iƒ| iƒjoL|iƒp |iƒotitd ƒƒ‚ntitd ƒƒ‚qÉ|iƒp |iƒotitd ƒƒ‚qÉt}ng}|pt|| ƒnti|iƒpt| ƒn|t|| |ƒ7}|t||| | ||ƒ7}|p"| t|d f\} } }}n|p#|iddtd|d|ƒnt|||| ƒ}|ptt|||ƒ|ii| | ƒ| o"| o|ii| iƒƒn|idd|d|d|dƒn|SWd|iƒXdS(s Perform a merge between the working directory and the given node branchmerge = whether to merge between branches force = whether to force branch merging or file overwriting partial = a function to filter file lists (dirstate not updated) tdefaultttipsbranch %s not foundiisoutstanding uncommitted mergesscan't merge with ancestors6nothing to merge (use 'hg update' or check 'hg heads')sAoutstanding uncommitted changes (use 'hg status' to list changes)sFcrosses branches (use 'hg merge' or 'hg update -C' to discard changes)s3crosses branches (use 'hg merge' or 'hg update -C')s>crosses named branches (use 'hg update -C' to discard changes)R`t preupdatetthrowtparent1tparent2tupdateterroriN( twlockRt branchtagstbranchtKeyErrortlookupR)RQRRŽRRtstrR~tlenRtfilesRYRSt checkcaseR+RXR^RŠRthookR§R¯R¨t setparentst setbranchtrelease(R RR\tforceR‚R¸twcRtplRuRR€tfp1tfp2txp1txp2t fastforwardR]tstats((s"/sys/lib/python/mercurial/merge.pyR¶Œsr   ( 6   " "#'(RRRRRti18nRR)RCRwR—RR“RtobjectRRSRXR^RŠR‹R§R¯R¶(((s"/sys/lib/python/mercurial/merge.pyss"0$>   s  a =