\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZddlZddlZddlZddlmZddlmZm Z m Z m Z ddl m Z mZmZmZmZmZmZejdZejdZejd Zd ZejZd Zd Zd ZdZedZ de!fdYZ"de"fdYZ#de#fdYZ$de!fdYZ%dZ&dZ'dZ(ee)eeedZ*de!fdYZ+e)e)eedZ,e)e)eedZ-e)e)eed Z.ie,e"fd!6e-e#fd"6e.e$fd#6Z/d$Z0d%Z1d&Z2d'Z3d(Z4eeee)e)eed)Z5ed*Z6d+Z7e)ed,Z8e)eed-Z9d.Z:dS(/i(tabsolute_importNi(t_(thextnullidtnullrevtshort(terrortmatchtmdifftphasestpycompatt repositorytutilt 20s20s20s20st20s20s20s20s20ss>20s20s20s20s20sHtlfscC@sht|d}tjd|d}|dkrW|rStjtd|ndSt||dS(s-return the next chunk from stream as a stringis>lisinvalid chunk length %dt(t readexactlytstructtunpackRtAbortR(tstreamtdtl((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytgetchunk(s cC@stjd|dS(s*return a changegroup chunk header (string)s>li(Rtpack(tlength((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt chunkheader2scC@stjddS(sBreturn a changegroup chunk header (string) for a zero-length chunks>li(RR(((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt closechunk6scC@stt||S(s3Obtain a changegroup chunk header for a named path.(Rtlen(tpath((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt _fileheader:scC@sd}d}z|rE|r0|j|d}qut|dd}n0tjdddd\}}tj|d}|}x|D]}|j|qWd}|SWd|dk r|jn|dk r|r|r|j|qtj|nXdS(sWrite chunks to a file and return its filename. The stream is assumed to be a bundle file. Existing files will not be overwritten. If no filename is specified, a temporary file is created. twbitprefixs hg-bundle-tsuffixs.hgN( tNonetopenR tmkstemptostfdopentwritetclosetunlink(tuitchunkstfilenametvfstfhtcleanuptfdtc((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt writechunks>s(     t cg1unpackercB@seZdZeZejZdZdZddZ dZ dZ dZ dZdZd Zd Zd Zd Zd ZdZdZdZejddZdZRS(sUnpacker for cg1 changegroup streams. A changegroup unpacker handles the framing of the revision data in the wire format. Most consumers will want to use the apply() method to add the changes from the changegroup to a repository. If you're forwarding a changegroup unmodified to another consumer, use getchunks(), which returns an iterator of changegroup chunks. This is mostly useful for cases where you need to know the data stream has ended by observing the end of the changegroup. deltachunk() is useful only if you're applying delta data. Most consumers should prefer apply() instead. A few other public methods exist. Those are used only for bundlerepo and some debug commands - their use is discouraged. t01icC@s|dkrd}n|tjjkrCtjtd|n|dkrXd}ntjj|}|j||_ ||_ |pi|_ d|_ dS(NtUNs#unknown stream compression type: %stBZt _truncatedBZ( R#R t compenginestsupportedbundletypesRRRt forbundletypetdecompressorreadert_streamt_typetextrastcallback(tselfR/talgR?t compengine((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt__init__ws      cC@s|jdk o|jdkS(NR6(R>R#(RA((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt compressedscC@s|jj|S(N(R=tread(RAR((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRFscC@s|jj|S(N(R=tseek(RAtpos((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRGscC@s |jjS(N(R=ttell(RA((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRIscC@s |jjS(N(R=R)(RA((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyR)scC@sxt|jd}tjd|d}|dkrZ|rVtjtd|ndS|jrp|jn|dS(Nis>lisinvalid chunk length %d(RR=RRRRRR@(RARR((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt _chunklengths   cC@siS(s*v10 does not have a changelog header chunk((RA((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytchangelogheaderscC@siS(s)v10 does not have a manifest header chunk((RA((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytmanifestheaderscC@s3|j}|siSt|j|}i|d6S(sBreturn the header of the filelogs chunk, v10 only has the filenameR-(RJRR=(RARtfname((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt filelogheaders  c C@sI|\}}}}|dkr'|}n|}d}||||||fS(Ni(R#( RAt headertupletprevnodetnodetp1tp2tcst deltabasetflags((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt _deltaheaders   c C@s|j}|siSt|j|j}|jj|}t|j||j}|j||\}}}} } } |||| | || fS(N(RJRR=tdeltaheadersizet deltaheaderRRW( RARPRt headerdatatheadertdeltaRQRRRSRURTRV((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt deltachunks $cc@sd}x|d|jkrt}xtrt|}|sm|dkrV|d7}n|ri|d7}nPnt}tt|Vd}x2|t|kr|d}|||!V|}qWq%WtVq WdS(s"returns all the chunks contains in the bundle Used when you need to forward the binary stream to a file or another network API. To do so, it parse the changegroup data, otherwise it will block in case of sshrepo because it don't know the end of the stream. iiiiNi(t_grouplistcounttTrueRtFalseRRR(RAtpartst noentriestchunkRHtnext((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt getchunkss&       cC@sX|j|_|j|j}|jjdj||||jd|_dS(NR( t incrementR@RLt deltaitert manifestlogt getstoragetaddgrouptcompleteR#(RAtrepotrevmapttrptprogtdeltas((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt_unpackmanifestss     c"@sjfd}fd}d} } } zI|jjd|}|jjd|}jddttj|jjj|t j t j |} j jtdtj jtd d td d |} | j|_t fd }|j|j}j||| d|}t|sj jdddnt}|} | jd#|_j jtdj jtdd td d | } |j|| | i}j jddrjj}xxtj|D]a}j|j}||j }x6|j!D](\}}|j|t j"|qWqLWnj jtdt#||| |\}}| |7} | |7} d}rjj }t|t}x:|D]/}|kr4|j$r4|d8}q4q4Wnd}|rtd|}nj jtd| | | |fj%| dkrd|jkr"t&j'|jdsN(RR(1t unfilteredRt setdefaultRR_R Rt changelogt delayupdatetsetRtweakreftproxyR+tstatusRRt makeprogressRfR@RKRgRjt develwarnRkR#Rqt configboolRhtxrangetchangelogrevisiontmanifestt readdeltat iteritemstaddt_addchangegroupfilest closesbranchtinvalidatevolatilesetsRRQtdictt publishingR tpublictdraftt registernewtadvanceboundaryt addpostclosetflush("RARlRtsrctypeRxt targetphaset expectedtotalRuRmR{tfilest revisionsRntprogressRRptcgnodestclendt needfilestmltcsettmfnodetmfesttfRtnewrevstnewfilest deltaheadsRRthtexttrtphasealltret((RRtRRRRRlRs;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytapplys     !           !   '        .        c#@s?dx2tfdiD]}|V|dq"WdS(s returns an iterator of the deltas in this changegroup Useful for passing to the underlying storage system to be stored. c@s jS(N(R]((tchainRA(s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRsiN(R#titer(RAt chunkdata((RRAs;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRgs"N(t__name__t __module__t__doc__t_CHANGEGROUPV1_DELTA_HEADERRYtsizeRXtversionR^R#RDRERFRGRIR)RJRKRLRNRWR]ReRqR RRRg(((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyR4`s,           -  t cg2unpackercB@s,eZdZeZejZdZdZRS(sUnpacker for cg2 streams. cg2 streams add support for generaldelta, so the delta header format is slightly different. All other features about the data remain the same. t02c C@s1|\}}}}}d}||||||fS(Ni(( RARORPRQRRRSRURTRV((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRWs( RRRt_CHANGEGROUPV2_DELTA_HEADERRYRRXRRW(((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRs  t cg3unpackercB@s;eZdZeZejZdZdZdZ dZ RS(sUnpacker for cg3 streams. cg3 streams add support for exchanging treemanifests and revlog flags. It adds the revlog flags to the delta header and an empty chunk separating manifests and files. t03ic C@s.|\}}}}}}||||||fS(N(( RARORPRQRRRSRURTRV((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRWscC@stt|j||||x}t|jiD]i}|d}|jjd||j}|jj |j |||s2t j t dq2q2WdS(NR-sadding %s revisions s"received dir revlog group is empty(tsuperRRqRRNR+RrRgRhRiRjRRR(RARlRmRnRoRRRp((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRqs  !( RRRt_CHANGEGROUPV3_DELTA_HEADERRYRRXRR^RWRq(((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRs  theaderlessfixupcB@seZdZdZRS(cC@s||_||_dS(N(t_ht_fh(RAR/R((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRDs cC@sp|jr`|j| |j|}|_t||kr\|t|j|t|7}n|St|j|S(N(RRRR(RARR((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRFs  #(RRRDRF(((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRs cc@s|jdk r"d|j}}nT|jtkrR|j}tjt|}n$|j}tj|j t|}||}t t|t|t|V|V|r|Vn|VdS(s0Serialize a revisiondelta to changegroup chunks.RN( R\R#tbasenodeRtrevisionRttrivialdiffheaderRtreplacediffheadertbaserevisionsizeR(R\theaderfnR!tdatatmeta((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt_revisiondeltatochunkss     %c@s"fd}t|d|S(s&Sort nodes for changegroup generation.c@sj|S(N(Rv(R(Rttlookup(s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRstkey(tsorted(tstoretnodesRtRR((RtRs;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt_sortnodesellipsissc @s|} fd| sMjttfkr]tt} } n\t| dkrtfd| D\} t} n"tfd| D\} } j| j| } } | | |fS(Nc@s7|tkrtSr|S|g}x |r2|d}|d}|krT|S|kr|jgj|D]}|tkrv|^qvq&|kr|jg|D]}|tkr|^qq&x6tjddD]}j||kr|SqWtjdj|fq&WtS(sTurn a changelog revnum into a local revnum. The ellipsis dag is stored as revnums on the changelog, but when we're producing ellipsis entries for non-changelog revlogs, we need to turn those numbers into something local. This does that for us, and during the changelog sending phase will also expand the stored mappings as needed. iiis=unable to resolve parent while packing %r %r for changeset %r( Rtextendt parentrevsR RtlinkrevRRt indexfile(tclrevtwalktptppti(Rttclrevtolocalrevt fullclnodest ischangelogtprecomputedellipsisRvR(s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytlocal!s.        ic3@s|]}|VqdS(N((t.0R(R(s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pys csc3@s|]}|VqdS(N((RR(R(s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pys fs(RRRRRQ(RtRRRvRtlinknodeRRRt linkparentsRRRStp1nodetp2node((RtRRRRRRvRs;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt_resolvenarrowrevisioninfos !> "c  c@sb|s dS|j} |r"d} n*|rFt||| |}d} nd} |r1g} i}i}x|D]}|j|}||}| j|}|||<|| kr|||} t| |j}x#|D]} |t| 7}| VqWqoWt} |t| 7}| Vq2W|jtd ||j Vd}|jrH|jrHg|jD](\}}|jj|j|f^q}n|jtfd |D}|j|||||||}x|D]\}} t |}t|}|VxF| D]>} t| |j}x#|D]} |t| 7}| VqWqWt} |t| 7}| V|jtd ||fqWtV|r{|jd d t|dd|ndS(sYield a sequence of changegroup byte chunks. If changelog is False, changelog data won't be added to changegroup s%uncompressed size of bundle content: is%8.i (changelog) t clrevorderRt changedfilest treemanifesttclrevtomanifestrevs%8.i (manifests) c3@s|]}j|VqdS(N(Rv(RRs(Rt(s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pys oss %8.i %s toutgoingRQRwN(R#RR'Rt_generatechangelogRRRRt requirementstgeneratemanifestsRRR#RR RRhRFtclearRt generatefilesRR(RAt commonrevstclnodestfastpathlinkrevRwRRlRtclstateRpR\RcR)R0RR1tfnodestitttreeR,tmfdictsRtlrtclrevsRR((Rts;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytgenerates               ;          !c@siijjtifd}id6d6d6d6}tj|t|jdjdtdd id jd j }||fS( sGenerate data for changelog chunks. Returns a 2-tuple of a dict containing state and an iterable of byte chunks. The state will not be fully populated until the chunk stream has been fully consumed. c@sj|}t|<jr|jksOj|jkr|j}j||jj|j|njrj |jj j qj |j n#j|j|j |j |S(N( RRRR!RvR"RRR R~RFtkeysR(RsR2t manifestnode(R1RtR0R3RtmflRA(s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytlookupcls   #R0RR1R3RRR{RRR( R#RhRRR_RRRR!R"(RARtRRHtstatetgen((R1RtR0R3RRGRAs;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyR5s(  !%      c#@sn|j}|jid6fd} x*rij\} } j| } |jj| jd pdsg} n|j| | |} | r| rq@n| | | }t|j| | t ||j d|j dt dd|d |j d |j}|jj| jd p-dsA| |fVq@x|D]}qHW| s@| gfVq@q@Wd S( sReturns an iterator of changegroup chunks containing manifests. `source` is unused here, but is used by extensions like remotefilelog to change what is sent based in pulls vs pushes, etc. Rc@s/r jSfd}|S(Nc @s|}j|jdt}x|jD]\}}}|dkr|d}j|i}|j||}||kr|||RGRttmfnodesR@(s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytlookupmflinknodes   (t __getitem__(R@RRY(R0R<R>RRGRX(RR@s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytmakelookupmflinknodes it.RRRRRRN(R#RhtpopitemRiRtvisitdirR@t_prunemanifestsRR`RRRR!R"R(RAR:R0R<RR>RwRRlR[R@RRt prunednodestlookupfnRpR((R0R<R>RRGRXs;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyR7s6   '         cC@sB|j|j}}g|D]$}||||kr|^qS(N(RvR(RARRR:tfrevtflrR((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyR_.sc#@sJg|D]+}|j|r|j| r|^q}|sPfdn!|jjjfdi|jrg|D]} |j| ^q|jjjfd} n} |j} | jjt ddt ddt |} x-t t |D]\} }| j |}|s\tjt d|nj| ||fd}|j|j}}gD]$}||||kr|^q}|sqn| j| d d |t|j||t||jd |jd d |jd|j}||fVqW| jdS(Nc@sj|iS(N(RM(tunusedRM(R>(s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytnormallinknodes?sc@sH|j|jfd|D}tfd|DS(Nc3@s!|]}||fVqdS(N((RR(tflinkrev(s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pys Gsc3@s9|]/\}}|kr||fVqdS(N((RRRB(tclnRCtfnode(s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pys Hs(RRQR(RRMtrevs(RgRC(RfRhs;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyReDs   c@sxQD]I}y,|j|}|j||jRCRR2RRlRRRMt filerevlogRrRbRcRt filenodesRp(( RgRRCRRpR>RqRARes;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyR99sL +   !   $    N( RRR`R#RDR_RDR5R7R_R9(((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRs> o G \ c C@sLd}t|||dd|dddtd|d|d |d |d |S( NcS@s"tj|j|j|j|jS(N(RRRQRRR(R((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRsR5R*R+RRR,RR-R.R/(RR_( RlR(R)R,RR-R.R/R*((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt_makecg1packers c C@sFd}t|||dd|ddd|d|d|d |d |S( NcS@s(tj|j|j|j|j|jS(N(RRRQRRRR(R((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRsRR*R+RR,RR-R.R/(R( RlR(R)R,RR-R.R/R*((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt_makecg2packers c C@sId}t|||dd|dtd|d|d|d|d |S( NcS@s.tj|j|j|j|j|j|jS(N(RRRQRRRRRV(R((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyRsRR*R+R,RR-R.R/(RR( RlR(R)R,RR-R.R/R*((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt_makecg3packers  R5RRcC@s_ttj}|jjddpH|jjddpHd|jks[|jdn|S(Nt experimentalt changegroup3R2R(Rt _packermapRER+RR6tdiscard(Rltversions((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytallsupportedversionss cC@s t|S(N(R(Rl((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytsupportedincomingversionsscC@st|}d|jkr8|jd|jdntj|jkrg|jd|jdnt|jkr|jd|jdn|S(NR2R5R(RR6R}R tNARROW_REQUIREMENTtLFS_REQUIREMENT(RlR~((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytsupportedoutgoingversionss    cC@stt|S(N(tmaxR(Rl((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt localversionscC@s5t|}d|jkr+|jdnt|S(Nt generaldeltaR5(RR6R}Rl(RlR~((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt safeversions c C@s|dkr$tj|jd}n|dkrHtj|jd}n|dkrs|j rstjdn|r|d krtjt d|n|j |}t |d} | ||||d|d|d |d |S( NRR5s;version 01 changegroups do not support sparse file matchersRsSellipsis nodes require at least cg3 on client and server, but negotiated version %siRR-R.R/(R5R( R#tmatchmodt alwaysmatchertroott nevermatchertalwaysRtProgrammingErrorRRt narrowmatchR|( RRlR,R(R)RR-R.R/tfn((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt getbundlers     cC@st|d||d|S(NiR?(R|(RR/RBR?((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt getunbundlerscC@s|jjs|dkr;|jjtdt|n|jjr|jjdx+|D] }|jjdt|q^WndS(Ntbundles%d changesets found slist of changesets: s%s (R+R$RRRR%RrR(RlRRwRQ((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyt_changegroupinfos #  c C@sMt||||d|d|}t|tj|dit|jd6S(NtfastpathR,tclcount(t makestreamRR t chunkbufferR#Rtmissing(RlR4RRwRR,tcgstream((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytmakechangegroup sc C@st||d|d|}|j}|j}|j} |j} | j|pv|jdkov| t|j k} |j ddt d|t || ||j || | |S(NR,R)t preoutgoingRzRw(RRtcommonRt missingheadstsortt filternameR#RRRR_RRD( RlR4RRwRR,R)tbundlerR:tcsetsRR<((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyR's      'cC@sMd}d}|jjtddtdd|}xvt|jiD]b} |d7}| d} |jjd| |j|j| } t| } y=|j } | j | ||st j tdnWn/t j k r }t j td |nX|t| | 7}| |krI|| }x`tj| t| D]F}| j|}||kr|j|qNt j td qNW|s|| =qqIqIW|jx|jD]y\} }|j| } x[|D]S}y| j|Wqt jk r:t j td | t|fqXqWqW||fS( NiRR|R}iR-sadding %s revisions s#received file revlog group is emptys#received delta base is censored: %ss#received spurious file revlog entrys+missing file data for %s:%s - run hg verify(R+RRRRNRrRfRtRRgRjRRtCensoredBaseErrorR RRQtremoveRkRRvt LookupErrorR(RlRwRmRnt expectedfilesRRRRRRRRtoRptetneedstnewR((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pyR;sN!            "(;t __future__RR&RRti18nRRQRRRRRRRRRR R R R tStructRRRRRRRRRR#R3tobjectR4RRRRRRR`RRRwRxRyR|RRRRRRRRRRR(((s;/usr/lib64/python2.7/site-packages/mercurial/changegroup.pytsj   "4      "X   P  j