³ò ø$•Jc@s8ddklZddkZddkZddkZddkZeiZd„Zd„Z d„Z e ƒ\Z Z d„Z e ƒZdiƒZd„Zd Zd Zd ed d Zd „Zd„ZdZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdd„ZdS(iÿÿÿÿ(t_NcCs@|idƒp|Sn|iddƒiddƒiddƒS(Nsdata/s.hg/s.hg.hg/s.i/s.i.hg/s.d/s.d.hg/(t startswithtreplace(tpath((s"/sys/lib/python/mercurial/store.pyt encodedirs   cCs@|idƒp|Sn|iddƒiddƒiddƒS(Nsdata/s.d.hg/s.d/s.i.hg/s.i/s.hg.hg/s.hg/(RR(R((s"/sys/lib/python/mercurial/store.pyt decodedirs   csWd}g}dD]}|t|ƒq~}tg}tdƒD]}|t|ƒt|ƒfqA~ƒ‰x9tdƒtddƒ|D]}d|ˆt|ƒ|ii i~is~%02xtAtZic 3s~d}xq|t|ƒjo]xVtddƒD]?}y#ˆ||||!V||7}PWq,tj oq,Xq,Wt‚q WdS(Niii(tlentxrangetKeyError(tstitl(tdmap(s"/sys/lib/python/mercurial/store.pytdecode+s  cs2dig}t|ƒD]}|ˆ|q~ƒS(t(tjoinR(R t_[1]tc(tcmap(s"/sys/lib/python/mercurial/store.pyt7scstditˆ|ƒƒƒƒS(R(RRtlist(R (R(s"/sys/lib/python/mercurial/store.pyR8s(tordtdictR tchrtrangetlowert iteritems(teRtxt win_reservedt_[2]tktv((RRRs"/sys/lib/python/mercurial/store.pyt_buildencodefun s '?-$  c sõg}dD]}|t|ƒq ~}tg}tdƒD]}|t|ƒt|ƒfq;~ƒ‰x9tdƒtddƒ|D]}d|ˆt|ƒ|ii i~is~%02xRRics,dig}|D]}|ˆ|q~ƒS(R(R(R RR(R(s"/sys/lib/python/mercurial/store.pyRCs(RRR RRR(RRRR ((Rs"/sys/lib/python/mercurial/store.pyt_build_lower_encodefun<s'?  sqcon prn aux nul com1 com2 com3 com4 com5 com6 com7 com8 com9 lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9c CsÎg}x¸|idƒD]§}|o|idƒd}|o>|tjo1dt|dƒ}|dd!||d}n|ddjo |d dt|dƒ}q°n|i|ƒqWdi|ƒS( Nt/t.is~%02xiiiÿÿÿÿs. (tsplitt_windows_reserved_filenamesRtappendR(Rtrestntbasetec((s"/sys/lib/python/mercurial/store.pyt auxencodeJs$ixiiicCsÁ|idƒp|Snt|ƒ}|tdƒ}dtt|ƒƒ}t|ƒtjo`t|ƒiƒ}tt|ƒƒ}t i i |ƒ\}}|i dƒ}|d}g} x{|d D]o} | t } | ddjo| d d} ndi| ƒd| } t| ƒtjoPn| i| ƒqÃWdi| ƒ} t| ƒdjo| d7} nd| ||}tt|ƒ}|djo$|| }d| |||}q½n|S(szencodes path with a length limit Encodes all paths that begin with 'data/', according to the following. Default encoding (reversible): Encodes all uppercase letters 'X' as '_x'. All reserved or illegal characters are encoded as '~xx', where xx is the two digit hex code of the character (see encodefilename). Relevant path components consisting of Windows reserved filenames are masked by encoding the third character ('aux' -> 'au~78', see auxencode). Hashed encoding (not reversible): If the default-encoded path is longer than MAX_PATH_LEN_IN_HGSTORE, a non-reversible hybrid hashing of the path is done instead. This encoding uses up to DIR_PREFIX_LEN characters of all directory levels of the lowerencoded path, but not more levels than can fit into _MAX_SHORTENED_DIRS_LEN. Then follows the filler followed by the sha digest of the full path. The filler is the beginning of the basename of the lowerencoded path (the basename is everything after the last path separator). The filler is as long as possible, filling in characters from the basename until the encoded path has MAX_PATH_LEN_IN_HGSTORE characters (or all chars of the basename have been taken). The extension (e.g. '.i' or '.d') is preserved. The string 'data/' at the beginning is replaced with 'dh/', if the hashed encoding was used. sdata/R%iÿÿÿÿs. Risdh/(RRRR.tencodefilenametMAX_PATH_LEN_IN_HGSTOREt_shat hexdigestt lowerencodetosRtsplitextR'tDIR_PREFIX_LENRt_MAX_SHORTENED_DIRS_LENR)(RtndpathR*tdigesttaept_roottexttpartstbasenametsdirstptdtttdirst space_lefttfiller((s"/sys/lib/python/mercurial/store.pyt hybridencode\s<      cCsYy9ti|ƒi}dti@d|@jo d}nWntj o d}nX|S(Niÿ(R4tstattst_modetutiltumasktNonetOSError(Rtmode((s"/sys/lib/python/mercurial/store.pyt _calcmode›s s;data 00manifest.d 00manifest.i 00changelog.d 00changelog.it basicstorecBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s&base class for local repository storescsR||_||_t|ƒ|_||iƒ‰|iˆ_‡fd†|_dS(Ncsˆt|ƒ||ŽS((R(tftargstkw(top(s"/sys/lib/python/mercurial/store.pyR°s(t pathjoinerRRNt createmodetopener(tselfRRVRT((RSs"/sys/lib/python/mercurial/store.pyt__init__ªs    cCs|i|it|ƒƒS(N(RTRR(RWRP((s"/sys/lib/python/mercurial/store.pyR²sc Cs6|i|i|ƒ}t|iƒttiƒ}g}tii|ƒoâ|g}xÖ|oÊ|iƒ}x·ti|dt ƒD] \}} } |i||ƒ} | t i joG|ddjo6t i | |ƒ} |it| ƒ| | ifƒq| t ijo|o|i| ƒqqWqVWnt|ƒS(s!yields (unencoded, encoded, size)RGiþÿÿÿs.ds.i(s.ds.i(RTRRR4tseptisdirtpoptosutiltlistdirtTrueRGtS_IFREGRItpconvertR)Rtst_sizetS_IFDIRtsorted( RWtrelpathtrecurseRtstriplenR tvisitR@RPtkindtsttfpR+((s"/sys/lib/python/mercurial/store.pyt_walkµs    !#cCs|idtƒS(Ntdata(RkR^(RW((s"/sys/lib/python/mercurial/store.pyt datafilesÇsccsHx|iƒD] }|Vq Wx%t|idtƒƒD] }|Vq5WdS(s!yields (unencoded, encoded, size)RN(RmtreversedRktFalse(RWR((s"/sys/lib/python/mercurial/store.pytwalkÊs   cCsdgtiƒS(Ntrequires(t_dataR'(RW((s"/sys/lib/python/mercurial/store.pytcopylistÓs( t__name__t __module__t__doc__RXRRkRmRpRs(((s"/sys/lib/python/mercurial/store.pyRO¨s     t encodedstorecBs,eZd„Zd„Zd„Zd„ZRS(csa||_|i|dƒ|_t|iƒ|_||iƒ‰|iˆ_‡fd†|_dS(Ntstorecsˆt|ƒ||ŽS((R/(RPRQRR(RS(s"/sys/lib/python/mercurial/store.pyRÝs(RTRRNRURV(RWRRVRT((RSs"/sys/lib/python/mercurial/store.pyRX×s   ccsdx]|idtƒD]I\}}}yt|ƒ}Wntj o d}nX|||fVqWdS(NRl(RkR^tdecodefilenameR RK(RWtatbtsize((s"/sys/lib/python/mercurial/store.pyRmßs cCs|i|it|ƒƒS(N(RTRR/(RWRP((s"/sys/lib/python/mercurial/store.pyRçscCs;ddgg}tiƒD]}||id|ƒq~S(NRqs 00changelog.iRx(RrR'RT(RWRRP((s"/sys/lib/python/mercurial/store.pyRsês (RtRuRXRmRRs(((s"/sys/lib/python/mercurial/store.pyRwÖs   tfncachecBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs||_d|_dS(N(RVRKtentries(RWRV((s"/sys/lib/python/mercurial/store.pyRXñs cCsÏtƒ|_y|idddƒ}Wntj o dSnXxt|ƒD]q\}}t|ƒdjp|ddjo'tdƒ|d }ti|ƒ‚n|ii t |d ƒƒqLW|i ƒdS( s&fill the entries from the fncache fileR}RMtrbNiiÿÿÿÿs s!invalid entry in fncache, line %si( tsetR~RVtIOErrort enumerateRRRItAborttaddRtclose(RWRjR+tlineRB((s"/sys/lib/python/mercurial/store.pyt_loadõs   $cCsZ|idddƒ}x%|D]}|it|ƒdƒqW|iƒt|ƒ|_dS(NR}RMtwbs (RVtwriteRR…R€R~(RWtfilesRjR@((s"/sys/lib/python/mercurial/store.pytrewrites  cCsE|idjo|iƒn|iddƒit|ƒdƒdS(NR}tabs (R~RKR‡RVR‰R(RWtfn((s"/sys/lib/python/mercurial/store.pyR„ scCs+|idjo|iƒn||ijS(N(R~RKR‡(RWR((s"/sys/lib/python/mercurial/store.pyt __contains__scCs+|idjo|iƒnt|iƒS(N(R~RKR‡titer(RW((s"/sys/lib/python/mercurial/store.pyt__iter__s(RtRuRXR‡R‹R„RŽR(((s"/sys/lib/python/mercurial/store.pyR}îs      t fncachestorecBs,eZd„Zd„Zd„Zd„ZRS(cs‚||_|i|dƒ|_t|iƒ|_||iƒ‰|iˆ_tˆƒ‰ˆ|_d‡‡fd†}||_dS(NRxtrcsT|djo.|idƒo|ˆjoˆi|ƒnˆt|ƒ|||ŽS(NR’Rsdata/(R’srb(RR„RF(RRMRQRR(tfncRS(s"/sys/lib/python/mercurial/store.pyt fncacheopener$s   (RTRRNRUR}RV(RWRRVRTR”((R“RSs"/sys/lib/python/mercurial/store.pyRXs    cCs|i|it|ƒƒS(N(RTRRF(RWRP((s"/sys/lib/python/mercurial/store.pyR,sccs³t}g}|i}|i}xs|iD]h}t|ƒ}y:ti|||ƒƒ}|||ifV|i|ƒWq(t j o t }q(Xq(W|o|ii |ƒndS(N( RoRTRR}RFR4RGRaR)RLR^R‹(RWR‹texistingtpjointspathRPtefRi((s"/sys/lib/python/mercurial/store.pyRm/s    cCsEtd}ddgg}|iƒD]}||id|ƒq$~S(Ns dh fncacheRqs 00changelog.iRx(RrR'RT(RWRARRP((s"/sys/lib/python/mercurial/store.pyRsBs  (RtRuRXRRmRs(((s"/sys/lib/python/mercurial/store.pyR‘s   cCse|p tii}d|jo5d|jot|||ƒSnt|||ƒSnt|||ƒS(NRxR}(R4RRR‘RwRO(t requirementsRRVRT((s"/sys/lib/python/mercurial/store.pyRxGs   (ti18nRR\RIR4RGtsha1R1RRR#R/RyR$R3R'R(R.R0R6R7RFRNRrtobjectRORwR}R‘RKRx(((s"/sys/lib/python/mercurial/store.pyss,        ? .,-