³ò ÷$•Jc @sddklZddkZddkZddkZddkZddkZddkZd„Zd„Z d„Z d„Z de fd„ƒYZ hd e fd <d e fd <d d „fd <dd„fdlis7premature EOF reading chunk (got %d bytes, expected %d)(treadtstructtunpacktlentutiltAbortR(tsourcetdtl((s(/sys/lib/python/mercurial/changegroup.pytgetchunk s ccs'x t|ƒ}|pPn|VqdS(s$iterate through the chunks in sourceN(R (Rtc((s(/sys/lib/python/mercurial/changegroup.pyt chunkiters  cCstid|dƒS(s build a changegroup chunk headers>li(Rtpack(tlength((s(/sys/lib/python/mercurial/changegroup.pyt chunkheader#scCstiddƒS(Ns>li(RR(((s(/sys/lib/python/mercurial/changegroup.pyt closechunk'st nocompresscBseZd„Zd„ZRS(cCs|S(N((tselftx((s(/sys/lib/python/mercurial/changegroup.pytcompress+scCsdS(NR((R((s(/sys/lib/python/mercurial/changegroup.pytflush-s(t__name__t __module__RR(((s(/sys/lib/python/mercurial/changegroup.pyR*s RtHG10UNtHG10cCs tiƒS((tbz2t BZ2Compressor(((s(/sys/lib/python/mercurial/changegroup.pyt3stHG10BZtHG10GZcCs tiƒS((tzlibt compressobj(((s(/sys/lib/python/mercurial/changegroup.pyR4sc CsÃd }d }zv|ot|dƒ}n1tiddddƒ\}}ti|dƒ}|}t|\}}|i|ƒ|ƒ}t} d} xÐ| p | djoºt } | d7} xŠt |ƒD]|} t} |i|i t t | ƒƒƒƒd} xE| t | ƒjo1| d } |i|i | | | !ƒƒ| } qýWqÆW|i|i tƒƒƒq”W|i|iƒƒd }|SWd |d j o|iƒn|d j oti|ƒnXd S( súWrite a bundle file and return its filename. Existing files will not be overwritten. If no filename is specified, a temporary file is created. bz2 compression can be turned off. The bundle file will be deleted in case of errors. twbtprefixs hg-bundle-tsuffixs.hgiiiiNi(tNonetopenttempfiletmkstemptostfdopent bundletypestwritetFalsetTrueR RRRRRtclosetunlink(tcgtfilenamet bundletypetfhtcleanuptfdtheadert compressortztemptytcounttchunktpostnext((s(/sys/lib/python/mercurial/changegroup.pyt writebundle:sB     "   csˆdjo|SnXˆidƒp‡fd†}n5ˆdjo d„}nˆdjo d„}nti||ƒƒS(NRtHGc3sˆVx|D] }|Vq WdS(N((tfR<(R7(s(/sys/lib/python/mercurial/changegroup.pyt generatorssRcss/tiƒ}x|D]}|i|ƒVqWdS(N(R t decompressobjt decompress(RAtzdR<((s(/sys/lib/python/mercurial/changegroup.pyRBxs RcssHtiƒ}|idƒx(ti|dƒD]}|i|ƒVq,WdS(NtBZi(RtBZ2DecompressorRDRt filechunkiter(RARER<((s(/sys/lib/python/mercurial/changegroup.pyRB}s   (t startswithRt chunkbuffer(R7R4RB((R7s(/sys/lib/python/mercurial/changegroup.pytunbundlens     cCs |idƒ}|idƒptitdƒ|ƒ‚n|idƒptitdƒ|ƒ‚n+|tjotitdƒ|ƒ‚nt||ƒS(NiR@s%s: not a Mercurial bundle fileRs%s: unknown bundle versions#%s: unknown bundle compression type(RRIRRRR+RK(R4tfnameR7((s(/sys/lib/python/mercurial/changegroup.pyt readbundle„s (ti18nRRRR)RR R'R R RRtobjectRR+tbundlepriorityR?RKRM(((s(/sys/lib/python/mercurial/changegroup.pyss  <     4