³ò ÷$•Jc@smdZddklZddklZddkZddkZddkZddkZddk Z ddk Z ddk Z ddk Z ddk Z ddkZddkZddkZddkZddkZddkZdeifd„ƒYZdeeifd„ƒYZd eeifd „ƒYZd eeifd „ƒYZd eifd„ƒYZd„ZdS(sRepository class for viewing uncompressed bundles. This provides a read-only repository interface to bundles as if they were part of the actual repository. iÿÿÿÿ(tnullid(t_Nt bundlerevlogcBsteZd d„Zd„Zd„Zd dd„Zd„Zd„Zd d d d„Z d„Z d „Z d „Z RS( c sâtii|||ƒˆ|_h|_‡fd†}t|ƒ}d}x’|ƒD]‡\}} t|ƒ} | djotitdƒƒ‚n| d7} | d8} t i d|d ƒ\} } } }| |i jo | }qSnxF| | fD]8}||i jo"t i | |itdƒƒ‚qñqñW|djo |}n ||ƒ}|p | }nti| dƒ| dd||i| ƒ|i| ƒ| f}||i|<|iid|ƒ||i | <| }|d7}qSWdS( Nc3s?x8tiˆƒD]'}ˆiƒ}||t|ƒfVqWdS(N(t changegroupt chunkiterttelltlen(tchunktpos(t bundlefile(s'/sys/lib/python/mercurial/bundlerepo.pyt chunkpositer#s iPsinvalid changegroupt 20s20s20s20ssunknown parentiiÿÿÿÿi(trevlogt__init__R tbasemapRtNonetutiltAbortRtstructtunpacktnodemapterrort LookupErrort indexfilet offset_typetrevtindextinsert(tselftopenerRR t linkmapperR tntprevRtstarttsizetnodetp1tp2tcstptlinkte((R s'/sys/lib/python/mercurial/bundlerepo.pyR sD         "     !  cCs"|djotSn||ijS(sis rev from the bundlei(tFalseR(RR((s'/sys/lib/python/mercurial/bundlerepo.pytbundleGs cCs |i|S(N(R(RR((s'/sys/lib/python/mercurial/bundlerepo.pyt bundlebaseLsicCs\|i|ƒptii|||ƒSn|ii|i|ƒƒ|ii|i|ƒƒS(N(R+R RR tseekR!treadtlength(RRtdftcachelen((s'/sys/lib/python/mercurial/bundlerepo.pyRMscCsÊ|i|ƒoJ|i|ƒo:|i|i|ƒƒ}||jo|i|ƒSq–n=|i|ƒ o+|i|ƒ otii|||ƒSnti|i|i |ƒƒ|i|i |ƒƒƒS(s1return or calculate a delta between two revisions( R+RR,RR trevdifftmdiffttextdifftrevisionR#(Rtrev1trev2trevb((s'/sys/lib/python/mercurial/bundlerepo.pyR2Vs  "c Cs‡|tjodSnd}g}|}|i|ƒ}xp|i|ƒo_|io&|id|jo|id}Pn|i|ƒ|i|ƒ}|i|ƒ}q9W|djotii||ƒ}nx6|o.|i |i ƒƒ}t i ||gƒ}qÒW|i |ƒ\}}|ti|||ƒjo/titdƒ|i|i|ƒfƒ‚n||i|ƒ|f|_|S(s*return an uncompressed revision of a giventiisintegrity check failed on %s:%dN(RRRR+t_cachetappendR,R R5RtpopR3tpatchestparentsthashRt RevlogErrorRtdatafile( RR#ttexttchaint iter_nodeRtdeltaR$R%((s'/sys/lib/python/mercurial/bundlerepo.pyR5cs.     cCs t‚dS(N(tNotImplementedError(RRBt transactionR(R$R%td((s'/sys/lib/python/mercurial/bundlerepo.pyt addrevision‚scCs t‚dS(N(RF(RtrevsRRG((s'/sys/lib/python/mercurial/bundlerepo.pytaddgroup„scCs t‚dS(N(RF(RRtminlink((s'/sys/lib/python/mercurial/bundlerepo.pytstrip†scCs t‚dS(N(RF(R((s'/sys/lib/python/mercurial/bundlerepo.pyt checksizeˆsN( t__name__t __module__RR R+R,RR2R5RIRKRMRN(((s'/sys/lib/python/mercurial/bundlerepo.pyRs 1     tbundlechangelogcBseZd„ZRS(cCs0tii||ƒti|||i|ƒdS(N(t changelogR RR(RRR ((s'/sys/lib/python/mercurial/bundlerepo.pyR Œs(RORPR (((s'/sys/lib/python/mercurial/bundlerepo.pyRQ‹stbundlemanifestcBseZd„ZRS(cCs3tii||ƒti|||i||ƒdS(N(tmanifestR RR(RRR R((s'/sys/lib/python/mercurial/bundlerepo.pyR ‘s(RORPR (((s'/sys/lib/python/mercurial/bundlerepo.pyRSst bundlefilelogcBseZd„ZRS(cCs6tii|||ƒti|||i||ƒdS(N(tfilelogR RR(RRtpathR R((s'/sys/lib/python/mercurial/bundlerepo.pyR —s(RORPR (((s'/sys/lib/python/mercurial/bundlerepo.pyRU–stbundlerepositorycBseZd„Zeid„ƒZeid„ƒZeid„ƒZeid„ƒZd„Z d„Z d„Z d„Z d „Z d „ZRS( c s^d|_ytii|||ƒWnTtij oEtiƒ|_ti ||idƒtii|||iƒnX|od|d||_ nd||_ d|_t |dƒ|_ |i i dƒ‰ˆidƒptitdƒ|ƒ‚nQˆidƒptitd ƒ|ƒ‚n$ˆd jp ˆd joßtid d ddd|iƒ\}}||_ti|dƒ}‡fd†}|ti|i dƒƒ}z/|idƒx|D]} |i| ƒqËWWd|iƒ|i iƒXt |idƒ|_ |i idƒn+ˆdjontitdƒ|ƒ‚h|_dS(Nisbundle:t+trbitHGs%s: not a Mercurial bundle filetHG10s%s: unknown bundle versiontHG10BZtHG10GZtprefixs hg-bundle-tsuffixs.hg10untdirtwbc3sjˆdjotiƒ}|idƒnˆdjotiƒ}nx|D]}|i|ƒVqNWdS(NR]tBZR^(tbz2tBZ2Decompressort decompresstzlibt decompressobj(tftzdR(theader(s'/sys/lib/python/mercurial/bundlerepo.pyt generator·s   itHG10UNs#%s: unknown bundle compression type(Rt _tempparentt localrepotlocalrepositoryR Rt RepoErrorttempfiletmkdtemptinstancet_urltopenR R.t startswithRRRtmkstempRWtostfdopent filechunkitertwritetcloseR-tbundlefilespos( RtuiRWt bundlenametfdtempttemptfptempRltgenR((Rks'/sys/lib/python/mercurial/bundlerepo.pyR sL        cCs+t|i|iƒ}|iiƒ|_|S(N(RQtsopenerR Rtmanstart(Rtc((s'/sys/lib/python/mercurial/bundlerepo.pyRRÕscCsG|ii|iƒt|i|i|iiƒ}|iiƒ|_|S(N( R R-R†RSR…RRRRt filestart(Rtm((s'/sys/lib/python/mercurial/bundlerepo.pyRTÛscCs|i|iS(N(RRR†(R((s'/sys/lib/python/mercurial/bundlerepo.pyR†âscCs|i|iS(N(RTRˆ(R((s'/sys/lib/python/mercurial/bundlerepo.pyRˆçscCs|iS(N(Ru(R((s'/sys/lib/python/mercurial/bundlerepo.pyturlìscCsø|ipn|ii|iƒxXti|iƒ}|pPn|iiƒ|i| sH$Hw{