\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@s<ddlmZddlZddlZddlmZddlmZmZddl m Z m Z m Z m Z mZmZmZmZmZmZddlmZeedZd Zd Zd Zd Zed dZdZdefdYZdedZ!dZ"dZ#dZ$dZ%dS(i(tabsolute_importNi(t_(thextshort( tbundle2t changegroupt discoveryterrortexchangetobsoletetobsutiltphasestpycompattutil(t stringutilc C@sLd}|j}|j|s.|j|n|jd||} td| D} tjdj| j} d|t |t | d |f} t j |} d}| dkrd}|rd }qn|rd }nd }tj|d |d |}i| d6|d6td6}tj|j|d| ||||d|S(s8create a bundle with the specified revisions as a backups strip-backups%ln::%lncs@s|]}|jVqdS(N(R(t.0tc((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pys .sts%s/%s-%s-%s.hgit01tHG20tBZtHG10BZtHG10UNt missingrootst missingheadss cg.versiont obsolescenceR tstript compressionN(tvfstisdirtmkdirtsettsortedthashlibtsha1tjointdigestRRRt localversiontNoneRtoutgoingtTrueRtwritenewbundletui(trepotbasestheadstnodetsuffixtcompressRt backupdirRt allcommitst allhashest totalhashtnamet cgversiontcompt bundletypeR't contentopts((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt backupbundle#s2     cC@sMt}x7tj|t|D]}|j||jq"Wt|S(s+find out the filelogs affected by the strip(RR txrangetlentupdatetfilesR (R+tstriprevR>tx((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt _collectfilesGs cC@s5|j|\}}g|D]}|j|^qS(N(t getstrippointtlinkrev(trevlogR?Rt brokensettr((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt_collectrevlogPscC@st|jjd|S(NR(RGt manifestlogt getstorage(R+R?((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt_collectmanifestTscC@sSt}|jt||x-|D]%}|jt|j||q&W|S(s<return the changesets which will be broken by the truncation(RR=RJRGtfile(R+R>R?tstfname((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt_collectbrokencsetsWs   #tbackupc*@s|jdk r$tjdn|dkr9t}n|j}|j|j}t|t rs|g}ng|D]}|j |^qz}t |}t ||} t || |} t|t| } x|jd|dD]z} tfd|j| Dr,j| n| kr| j| | j|j| | j| qqWg| D]} |j| ^qv} | rt|j| } | j| ng| D]} |j| ^q}gD]} |j| ^q}d }}|jjddr4tj||}n|rqgt|jD]\}}||krJ|^qJ}n|jd }|r||jj}nd }|j}g}x>|D]6}|||j }|kr|j|qqWd}|j}|d }|r}t |||j!||}|jj"t#d |j$||jj%d d |j$|nd}| rt ||| |ddtdt}n|j&y!|j'd0}t(|j)}|j*|j+||t,|||| x'| D]}|j-|j+||qW|j.xt/j0|t(|j)D]i}|j)|\}}} |j1|ddt2}!|!j3|WdQX|dkr^|j4j5|q^q^Wt6|j||`|j7|j8j9|WdQX|r|j:t#d|j;|d}"t<j=||"||}#|jj>s`|jj?nd|j$|}$d}%t|#t@jAsdtBjC|$}%n|j'|%&}t@jD||#|ddd|$WdQX|jj>s|jjEn|"jFn|j'dC}g|D]}|||jf^q}&|jG|||&WdQXx|jHD]w\}'}(y|'jI|(WqbtJk r})|)jKtKjLkr|jMt#d|'j$|(tNjO|)fqqbXqbWWn||r |jMt#d|j$|n|rV|jMt#d|j$||jMt#d|j$|nnX|rs|jI|nWdQX|jP|S(!Ns&cannot strip from inside a transactiontnoneRtstartic3@s|]}|kVqdS(N((Rtp(ttostrip(s6/usr/lib64/python2.7/site-packages/mercurial/repair.pys stdevelsstrip-obsmarkerssmax(parents(%ld) - (%ld))t.issaved backup bundle to %s R:ttempR0Rtat checkambigisadding branch trbsbundle:sstrip %stsourceturltrepairserror removing %s: %s s+strip failed, backup bundle stored in '%s' s1strip failed, unrecovered changes stored in '%s' sG(fix the problem, then recover the changesets with "hg unbundle '%s'") (RPR((QtcurrenttransactionR&RtProgrammingErrortFalset unfilteredt destroyingt changelogt isinstancetstrtrevtminRARNRtrevstanyt parentrevstaddtdifference_updateR.t descendantsR*t configboolR texclusivemarkerst enumeratetobsstoretfirstt _bookmarkstappendRR:R-tstatusRR#tlogtuninterruptablet transactionR<t_entriest startgroupRt stripmanifestRKtendgroupR R;tsvfsR(ttruncatetstoret markremovedtdeleteobsmarkerstinvalidatevolatilesetst _phasecachet filterunknowntnotetopenRt readbundletverboset pushbufferRt unbundle20R t hidepasswordt applybundlet popbuffertcloset applychangest undofilestunlinktOSErrorterrnotENOENTtwarnRt forcebytestrt destroyed(*R*R+tnodelistROttopictclR.t striplistR?R>tsaverevst saveheadsRFRlt savebasest stripbasest stripobsidxt obsmarkerstitmt newbmtargettbmtupdatebmRet backupfileRt tmpbundlefilettrtoffsettfnRKttroffsettignoretfptftgent tmpbundleurlttxnnamet bmchangestundovfstundofilete((RSs6/usr/lib64/python2.7/site-packages/mercurial/repair.pyRas      "   %  """          "      ) # c @sjjjtfd|D}d}tj|||tj|}||}|rdjtfd|D}|j t d|ngjd|D]}|j ^qS(sDreturn list of roots of nodes where descendants are covered by nodesc3@s|]}|VqdS(N((Rtn(ttorev(s6/usr/lib64/python2.7/site-packages/mercurial/repair.pys ss5%ld - ( ::( (roots(%ld):: and not _phase(%s)) -%ld) )s, c3@s%|]}t|jVqdS(N(RR.(RR(R+(s6/usr/lib64/python2.7/site-packages/mercurial/repair.pys ss9warning: orphaned descendants detected, not stripping %s s roots(%ld)( R`RbReRRgR tinternalR#R RRR.( R*R+tnodesRgtrevsetRStnotstriptnodestrR((R+Rs6/usr/lib64/python2.7/site-packages/mercurial/repair.pytsafestriprootss$ % t stripcallbackcB@s)eZdZdZdZdZRS(s(used as a transaction postclose callbackcC@s7||_||_||_|p$d|_g|_dS(NRO(R*R+RORR(tselfR*R+ROR((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt__init__$s    cC@s|jj|dS(N(Rtextend(RR((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pytaddnodes+scC@sJt|j|j|j}|rFt|j|j||j|jndS(N(RR*R+RRROR(RRtroots((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt__call__.s(t__name__t __module__t__doc__RRR(((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyR!s  cC@s|j}|s@t|||}t|||d|d|S|jd}|dkrt||d|d|}|jd|n|r||_n|j|dS(silike strip, but works inside transaction and won't strip irreverent revs nodelist must explicitly contain all descendants. Otherwise a warning will be printed that some nodes are not stripped. Will do a backup if `backup` is True. The last non-None "topic" will be used as the backup topic name. The default backup topic name is "backup". RORsstripN( R]RRt getpostcloseR&Rt addpostcloseRR(R*R+RRRORRtcallback((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt delayedstrip3s   cC@s9|jjd}|j||t||||dS(NR(RHRIRt striptrees(R+R?RR>RD((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyRzJscC@sd|jkrxm|jjD]Y\}}}|jdr|jdr|dd!}|jj|j||qqWndS(Nt treemanifestsmeta/s 00manifest.iii(t requirementsR~t datafilest startswithtendswithRHRIR(R+RR?R>t unencodedtencodedtsizetdir((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyROs  c C@s|j}d|jkr2|jtddS|j|jj}d|krZnt|j}t}t}|j tddtddt |}x|D]}|j |||}x|j D]}} | |krqn|j | d | } d | } |jj| r4|j | n|jj| r|j | qqWqW|jd |jkrxrtj|D]^} d | } d | } |jj| r|j | n|jj| r|j | qqWnt ||} t ||}x/t||D]}|jtd|qWx/t||D]}|jtd|qOW| s||r|jtd| |f||_t|_|jd}|j|WdQXn|jtdWdQXdS(stRebuilds the fncache file from repo history. Missing entries will be added. Extra entries will be removed. tfncachesE(not rebuilding fncache because repository does not support fncache) Nt irrelevantt rebuildingtunitt changesetsttotals data/%s.is data/%s.dRsmeta/%s/00manifest.ismeta/%s/00manifest.ds removing %s s adding %s s(%d items added, %d removed from fncache sfncache already up to date (R`RRRtlockR~RRtentriest makeprogressR<R=R>Rjt_existstcompleteR tdirsR twriteR(t_dirtyRw(R*R+tfnct oldentriest newentriest seenfilestprogressRetctxRRtdRtaddcountt removecountRRR((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pytrebuildfncacheXsb                   c C@s|s dSg}|j}d}xCt|D]5\}}||krT|d7}q,n|j|q,W|jdddt}x-tj|t|jD]}|j|qW|j |S(sDelete some obsmarkers from obsstore and return how many were deleted 'indices' is a list of ints which are the indices of the markers to be deleted. Every invocation of this function completely rewrites the obsstore file, skipping the markers we want to be removed. The new temporary file is created, remaining markers are written there and on .close() this file gets atomically renamed to obsstore, thus guaranteeing consistency.NiiRptwt atomictemp( t_allRoRsR|R(R t encodemarkerst_versionRR( RptindicestlefttcurrentRRRtnewobsstorefiletbytes((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyRs     (&t __future__RRR!ti18nRR.RRRRRRRRR R R R R tutilsRR(R:RARGRJRNRRtobjectRR&RRzRRR(((s6/usr/lib64/python2.7/site-packages/mercurial/repair.pyt s(  F  #      H