-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/mercurial/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/mercurial/store.pyc


\,Tc@sddlmZddlZddlZddlZddlZddlZddlZejZ	dZ
eede
ZdZ
dZe\ZZdZdZd	Zeed
dpeZd(Zd)ZdZdZdZdeddZdZdZdZeedeZdZdZ dZ!de"fdYZ#de#fd YZ$d!e"fd"YZ%d#ej&ej'fd$YZ(d%e#fd&YZ)d'Z*dS(*i(t_NcCs(|jddjddjddS(sI
    >>> _encodedir('data/foo.i')
    'data/foo.i'
    >>> _encodedir('data/foo.i/bla.i')
    'data/foo.i.hg/bla.i'
    >>> _encodedir('data/foo.i.hg/bla.i')
    'data/foo.i.hg.hg/bla.i'
    >>> _encodedir('data/foo.i\ndata/foo.i/bla.i\ndata/foo.i.hg/bla.i\n')
    'data/foo.i\ndata/foo.i.hg/bla.i\ndata/foo.i.hg.hg/bla.i\n'
    s.hg/s.hg.hg/s.i/s.i.hg/s.d/s.d.hg/(treplace(tpath((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt
_encodedirst	encodedircCs8d|kr|S|jddjddjddS(s
    >>> decodedir('data/foo.i')
    'data/foo.i'
    >>> decodedir('data/foo.i.hg/bla.i')
    'data/foo.i/bla.i'
    >>> decodedir('data/foo.i.hg.hg/bla.i')
    'data/foo.i.hg/bla.i'
    s.hg/s.d.hg/s.d/s.i.hg/s.i/s.hg.hg/(R(R((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt	decodedir"s	csGd}gdD]}t|^q
}tgtdD]}t|t|f^q5x9tdtdd|D]}d|t|<qzWxTttdtd	d
t|gD]&}|t|jt|<qWix$jD]\}}||<qWfdfdfd
fS(s
    >>> enc, dec = _buildencodefun()

    >>> enc('nothing/special.txt')
    'nothing/special.txt'
    >>> dec('nothing/special.txt')
    'nothing/special.txt'

    >>> enc('HELLO')
    '_h_e_l_l_o'
    >>> dec('_h_e_l_l_o')
    'HELLO'

    >>> enc('hello:world?')
    'hello~3aworld~3f'
    >>> dec('hello~3aworld~3f')
    'hello:world?'

    >>> enc('thequickshot')
    'the~07quick~adshot'
    >>> dec('the~07quick~adshot')
    'the\x07quick\xadshot'
    Rs\:*?"<>|ii i~is~%02xtAtZic3szd}xm|t|kruxTtddD]=}y#||||!V||7}PWq+tk
rgq+Xq+Wtq	WdS(Niii(tlentxrangetKeyError(tstitl(tdmap(s3/usr/lib/python2.7/dist-packages/mercurial/store.pytdecodeTs

cs$djg|D]}|^q
S(Nt(tjoin(Rtc(tcmap(s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt<lambda>`scsdjt|S(NR(Rtlist(R(R(s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRas(tordtdictR	tchrtrangetlowert	iteritems(tetxtwinreservedtktv((RRRs3/usr/lib/python2.7/dist-packages/mercurial/store.pyt_buildencodefun2s7$3$cCstt|S(s}
    >>> encodefilename('foo.i/bar.d/bla.hg/hi:world?/HELLO')
    'foo.i.hg/bar.d.hg/bla.hg.hg/hi~3aworld~3f/_h_e_l_l_o'
    (t_encodefnameR(R((s3/usr/lib/python2.7/dist-packages/mercurial/store.pytencodefilenameescCstt|S(s}
    >>> decodefilename('foo.i.hg/bar.d.hg/bla.hg.hg/hi~3aworld~3f/_h_e_l_l_o')
    'foo.i/bar.d/bla.hg/hi:world?/HELLO'
    (Rt_decodefname(R((s3/usr/lib/python2.7/dist-packages/mercurial/store.pytdecodefilenamelscsgdD]}t|^q}tgtdD]}t|t|f^q/x9tdtdd|D]}d|t|<qtWxCttdtdd	D]"}t|jt|<qWfd
S(s
    >>> f = _buildlowerencodefun()
    >>> f('nothing/special.txt')
    'nothing/special.txt'
    >>> f('HELLO')
    'hello'
    >>> f('hello:world?')
    'hello~3aworld~3f'
    >>> f('thequickshot')
    'the~07quick~adshot'
    s\:*?"<>|ii i~is~%02xRRics$djg|D]}|^q
S(NR(R(RR(R(s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRs(RRR	RRR(RR((Rs3/usr/lib/python2.7/dist-packages/mercurial/store.pyt_buildlowerencodefunss7$& tlowerencodetauxtcontprntnultcomtlptcCs[xTt|D]F\}}|s%q
n|rd|ddkrddt|d|d}|||<n|jd}|dkrt|}n|dkr|d tks|dkr |dd	kr |dd
kr |d tkr dt|d}|dd!||d}|||<n|ddkr
|d dt|d||<q
q
W|S(s
    Encodes filenames containing names reserved by Windows or which end in
    period or space. Does not touch other single reserved characters c.
    Specifically, c in '\:*?"<>|' or ord(c) <= 31 are *not* encoded here.
    Additionally encodes space or period at the beginning, if dotencode is
    True. Parameter path is assumed to be all lowercase.
    A segment only needs encoding if a reserved name appears as a
    basename (e.g. "aux", "aux.foo"). A directory or file named "foo.aux"
    doesn't need encoding.

    >>> s = '.foo/aux.txt/txt.aux/con/prn/nul/foo.'
    >>> _auxencode(s.split('/'), True)
    ['~2efoo', 'au~78.txt', 'txt.aux', 'co~6e', 'pr~6e', 'nu~6c', 'foo~2e']
    >>> s = '.com1com2/lpt9.lpt4.lpt1/conprn/com0/lpt0/foo.'
    >>> _auxencode(s.split('/'), False)
    ['.com1com2', 'lp~749.lpt4.lpt1', 'conprn', 'com0', 'lpt0', 'foo~2e']
    >>> _auxencode(['foo. '], True)
    ['foo.~20']
    >>> _auxencode([' .foo'], True)
    ['~20.foo']
    is. s~%02xit.iiit9t1i(t	enumerateRtfindRt_winres3t_winres4(Rt	dotencodeRtnR
tec((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt
_auxencodes$
,
'ixiiicCs}t|j}t|jdd}t||}|d}tjj|\}}g}d}	x|d D]}
|
t }|ddkr|d d}n|	dkrt	|}n$|	dt	|}|t
krPn|j||}	qsWdj|}
t	|
dkr(|
d7}
nd|
||}t
t	|}|dkry|| }d|
|||}n|S(Nt/iiis. Rsdh/(t_shat	hexdigestR'tsplitR8tosRtsplitextt
_dirprefixlenRt_maxshortdirslentappendRt_maxstorepathlen(RR5tdigesttletpartstbasenamet_roottexttsdirstsdirslentptdtttdirstrest	spacelefttfiller((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt_hashencodes6





cCsat|}t|jd}djt||}t|tkr]t||}n|S(seencodes 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 _maxstorepathlen, a
    non-reversible hybrid hashing of the path is done instead.
    This encoding uses up to _dirprefixlen characters of all directory
    levels of the lowerencoded path, but not more levels than can fit into
    _maxshortdirslen.
    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 _maxstorepathlen 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.
    R9(RR"R<RR8RRBRR(RR5tefRO((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt
_hybridencodescCs{t|}t|tkr+t|tSt|jd}djt|t}t|tkrwt|tS|S(NR9(	RRRBRRtTrueR"R<RR8(RtdeRSRO((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt_pathencodes

t
pathencodecCs
t|tS(N(RTtFalse(tf((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt_plainhybridencode
scCsRy4|jj}dtj@d|@kr3d}nWntk
rMd}nX|S(Ni(tstattst_modetutiltumasktNonetOSError(tvfstmode((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt	_calcmodes


sNdata 00manifest.d 00manifest.i 00changelog.d 00changelog.i phaseroots obsstoret
basicstorecBsqeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
RS(s&base class for local repository storescCsa||}|j|_t||_|j|_||_tj|t|_|j|_	dS(N(
tbaseRRdt
createmodetrawvfstscmutilt	filtervfsRRbtopener(tselfRtvfstypeRb((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt__init__ s	cCs|jdt|S(NR9(RR(RlRZ((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyR)scCs7|j}|r |d|7}nt|jd}g}|jj|r)|g}|jj}x|r%|j}x||dtD]\}	}
}|d|	}|
tjkr|	ddkrt	j
||}
|jt|
|
|j
fq|
tjkr|r|j|qqWqcWn|j|S(s!yields (unencoded, encoded, size)R9iR\is.ds.i(s.ds.i(RRRhtisdirtreaddirtpopRUR\tS_IFREGR^tpconvertRARtst_sizetS_IFDIRtsort(RltrelpathtrecurseRtstriplenR
tvisitRpRKRZtkindtsttfpR6((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt_walk,s&			""
cCs|jdtS(Ntdata(R~RU(Rl((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt	datafilesBscCst|jdtS(NR(treversedR~RY(Rl((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyttopfilesEsccs<x|jD]}|Vq
Wx|jD]}|Vq)WdS(s!yields (unencoded, encoded, size)N(RR(RlR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pytwalkIs	cCsdgtjS(Ntrequires(t_dataR<(Rl((s3/usr/lib/python2.7/dist-packages/mercurial/store.pytcopylistQscCsdS(N((Rlttr((s3/usr/lib/python2.7/dist-packages/mercurial/store.pytwriteTscCsdS(N((Rl((s3/usr/lib/python2.7/dist-packages/mercurial/store.pytinvalidatecachesWscCsdS(N((Rltfn((s3/usr/lib/python2.7/dist-packages/mercurial/store.pytmarkremovedZscCs[djd|f}|jj|dr/tS|jdsK|d}n|jj|S(s!Checks if the store contains pathR9Rs.i(RRbtexistsRUtendswith(RlR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt__contains__]s
(t__name__t
__module__t__doc__RnRR~RRRRRRRR(((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRes											tencodedstorecBs,eZdZdZdZdZRS(cCse||d}|j|_t||_|j|_||_tj|t|_|j|_	dS(Ns/store(
RfRRdRgRhRiRjR#RbRk(RlRRmRb((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRnis	ccsbx[|jdtD]G\}}}yt|}Wntk
rKd}nX|||fVqWdS(NR(R~RUR%R
R`(Rltatbtsize((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRrs"

cCs|jdt|S(NR9(RR#(RlRZ((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRzscCs+ddggtjD]}d|^qS(NRs
00changelog.isstore/(RR<(RlRZ((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyR}s	(RRRnRRR(((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRhs				tfncachecBsGeZdZdZdZdZdZdZdZRS(cCs||_d|_t|_dS(N(RbR`tentriesRYt_dirty(RlRb((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRns		cCst|_y|jddd}Wntk
rBt|_dSXtt|jj|_d|jkr|j	dxRt
|D]A\}}|jdstd|d	}t
j|qqWn|jdS(
s&fill the entries from the fncache fileRRctrbNRis
s!invalid entry in fncache, line %si(RYRRbtIOErrortsetRRtreadt
splitlinestseekR1trstripRR^tAborttclose(RlR}R6tlineRM((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt_loads	
!
cCsz|jrv|jd|jddddt}|jr`|jtdj|jdn|jt	|_ndS(NRRctwbt
atomictemps
(
Rt	addbackupRbRURRRRRRY(RlRR}((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRs	
	&
cCsK|jdkr|jn||jkrGt|_|jj|ndS(N(RR`RRURtadd(RlR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRs

	cCsQ|jdkr|jny|jj|t|_Wntk
rLnXdS(N(RR`RtremoveRURR
(RlR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRs


cCs)|jdkr|jn||jkS(N(RR`R(RlR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRs
cCs)|jdkr|jnt|jS(N(RR`Rtiter(Rl((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt__iter__s
(	RRRnRRRRRR(((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRs								t_fncachevfscBs&eZdZddZdZRS(cCs)tjj||||_||_dS(N(RitauditvfsRnRtencode(RlRbtfncR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRns	trcOsM|dkr.|jdr.|jj|n|j|j||||S(NRRsdata/(Rsrb(t
startswithRRRbR(RlRRctargstkw((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt__call__scCs3|r|jj|j|S|jj|SdS(N(RbRR(RlR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRs(RRRnRR(((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRs	tfncachestorecBsbeZdZdZdZdZdZdZdZdZ	dZ
d	ZRS(
cCs|rt}nt}||_||d}|j|_|jd|_t||_|j|_||_t	|}||_	t
||||_|j|_dS(Ns/storeR9(
RWR[RRfRtpathsepRdRgRhRRRbRk(RlRRmR5RRbR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRns				cCs|j|j|S(N(RR(RlRZ((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRscCs|jj|jS(N(RhR\Rt(RlR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pytgetsizesccsvxot|jD]^}|j|}y|||j|fVWqtk
rm}|jtjkrnqnqXqWdS(N(tsortedRRRRaterrnotENOENT(RlRZRSterr((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRscCs1d}ddgg|jD]}d|^qS(NsYdata dh fncache phaseroots obsstore 00manifest.d 00manifest.i 00changelog.d 00changelog.iRs
00changelog.isstore/(R<(RlRLRZ((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRs	cCs|jj|dS(N(RR(RlR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRscCsd|j_dS(N(R`RR(Rl((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRscCs|jj|dS(N(RR(RlR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRscCsW|j|}y|j|tSWn,tk
rR}|jtjkrNntSXdS(N(RRRURaRRRY(RlRZRSR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt_existss
cCsdjd|f}|d}||jkrA|j|rAtS|jds]|d7}nx3|jD](}|j|rg|j|rgtSqgWtS(s!Checks if the store contains pathR9Rs.i(RRRRURRRY(RlRR((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyR
s

(RRRnRRRRRRRRR(((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRs										cCsHd|kr;d|kr.t||d|kSt||St||S(NtstoreRR5(RRRe(trequirementsRRm((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyRs

(R(R)R*R+(R,R-(+ti18nRRiR^tparsersR=R\Rtsha1R:RtgetattrRRR!R"R$R#R%R&R`R'R3R4R8RBR?R@RRRTRWR[RdRtobjectReRRtabstractvfsRRRR(((s3/usr/lib/python2.7/dist-packages/mercurial/store.pyt<module>s>$$				1				,		&	
		J=J

Copyright © 2017 || Recoded By Mr.Bumblebee