-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/hgext/largefiles/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyc

ó
Ì\,Tc@sdZddlZddlZddlZddlZddlmZmZmZ	m
Z
mZddlm
Z
ddlmZdZedZdZd	d
„Zd„Zd„Zd
„Zd„Zdejfd„ƒYZed„Zd„Zddd„Zd„Zd„Zd„Ze d„Z!d„Z"d„Z#d„Z$gid„Z%d„Z&d„Z'd„Z(d„Z)d „Z*dd!„Z+d"„Z,d#„Z-d$„Z.d%„Z/d&„Z0d'„Z1d(„Z2d)„Z3d*„Z4d+„Z5d,e6fd-„ƒYZ7d.„Z8d/„Z9d0„Z:dS(1sGlargefiles utility code: must not import other modules in this package.iÿÿÿÿN(tdirstatethttpconnectiontmatchtutiltscmutil(t_(tnodes.hglft/t
largefilesi
cCsœ|}|r.|r.|jtdd|ƒ}n|rtyt|ƒ}Wqttk
rptjtdƒ|ƒ‚qtXn|dkr˜tjtdƒƒ‚n|S(Ntminsizetdefaults)largefiles: size must be number (not %s)
s-minimum size for largefiles must be specified(tconfigtlongnametfloatt
ValueErrorRtAbortRtNone(tuitassumelfilestoptR
tlfsize((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyt
getminsizes

cCsªtjtjj|ƒƒytj||ƒWnvtk
r¥tj|ƒ}x-tjt	|dƒƒD]}|j
|ƒqeW|jƒtj|tj
|ƒjƒnXdS(Ntrb(RtmakedirstostpathtdirnametoslinktOSErrortatomictempfilet
filechunkitertopentwritetclosetchmodtstattst_mode(tsrctdesttdsttchunk((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytlink)s

cCsa|jtddƒ}|r3tjj||ƒ}n*tjdkrtjdtjdƒƒ}|r]tjj|t|ƒ}q]nÜtj	ƒdkrÌtjdƒ}|r]tjj|ddt|ƒ}q]n‘tjd	krAtjd
ƒ}|rtjj|t|ƒ}q]tjdƒ}|r]tjj|dt|ƒ}q]nt
jtdƒtjƒ‚|S(
Nt	usercachetnttLOCALAPPDATAtAPPDATAtDarwintHOMEtLibrarytCachestposixtXDG_CACHE_HOMEs.cachesunknown operating system: %s
(
t
configpathRRRRtjointnametgetenvtplatformtsystemRRR(RthashRtappdatathome((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyt
usercachepath5s*!cCs%t||ƒ}|o$tjj|ƒS(N(R=RRtexists(RR:R((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytinusercacheOscCs’t||ƒr6|jjtdƒ|ƒt||ƒSt|j|ƒrŽ|jjtdƒ|ƒt||ƒ}tt|j|ƒ|ƒ|SdS(Nsfound %s in store
sfound %s in system cache
(	tinstoreRtnoteRt	storepathR?R)R=R(trepoR:R((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytfindfileSs
tlargefilesdirstatecBsPeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	RS(cCstt|ƒjt|ƒƒS(N(tsuperREt__getitem__tunixpath(tselftkey((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRG_scCstt|ƒjt|ƒƒS(N(RFREtnormalRH(RItf((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRKascCstt|ƒjt|ƒƒS(N(RFREtremoveRH(RIRL((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRMcscCstt|ƒjt|ƒƒS(N(RFREtaddRH(RIRL((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRNescCstt|ƒjt|ƒƒS(N(RFREtdropRH(RIRL((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyROgscCstt|ƒjt|ƒƒS(N(RFREtforgetRH(RIRL((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRPiscCstt|ƒjt|ƒƒS(N(RFREtnormallookupRH(RIRL((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRQkscCstS(N(tFalse(RIRL((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyt_ignorems(
t__name__t
__module__RGRKRMRNRORPRQRS(((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRE^s							c
CsÞ|jtƒ}tj|ƒ}t|||j|jjƒ}|rÚtj	j
tj	j|dƒƒrÚt|ƒ}|jj|gt
t
ƒ}t|ƒdkr­tj|ƒnx*|D]}t|ƒ}	|j|	ƒq´Wn|S(sŠ
    Return a dirstate object that tracks largefiles: i.e. its root is
    the repo root, but it is saved in .hg/largefiles/dirstate.
    Ri(R5RRtopenerREtrootRt	_validateRRR>tgetstandinmatchertwalkRRtlenRRtsplitstandinRQ(
RRCtcreatet
lfstoredirRVt
lfdirstatetmatchertstandinststandintlfile((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytopenlfdirstateps(
cCstj|j|jƒƒ}|j|gtttƒ}|\}}}}}	}
}}x˜|D]}
y||t|
ƒ}Wntk
r’d}nX|sÁ|j	ƒj
ƒt|j|
ƒƒkrÑ|j
|
ƒq[|j
|
ƒ|j|
ƒq[W||||	|
||fS(N(tmatch_talwaysRWtgetcwdtstatusRRRbtLookupErrorRtdatatstripthashfiletwjointappendRK(R_RCtrevRtstunsuretmodifiedtaddedtremovedtmissingtunknowntignoredtcleanRctfctx((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytlfdirstatestatus‰s


.
cCsd|dkrt|ƒ}ng||j|ƒD]1}|dk	sT|j|dkr/t|ƒ^q/S(sNreturn a list of largefiles in the working copy or the
    specified changesett?N(RRYRZRR\(RCRoR`RL((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyt
listlfiles™s
cCstjjt||ƒƒS(N(RRR>RB(RCR:((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyR@¥scCs|jtjjt|ƒƒS(N(R5RRR(RCR:((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRB¨scCs^t||ƒ}|dkrtStjtjj|j|ƒƒƒt	j
||j|ƒƒtS(s.Copy the specified largefile from the repo or system cache to
    filename in the repository. Return true on success or false if the
    file was not found in either cache (which should not happened:
    this is meant to be called only after ensuring that the needed
    largefile exists in the cache).N(RDRRRRRRRRRmtshutiltcopytTrue(RCR:tfilenameR((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyt
copyfromcache«s"cCsBt|||ƒ}t||ƒr%dSt||j|ƒ|ƒdS(N(treadstandinR@tcopytostoreabsoluteRm(RCRotfiletuploadedR:((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytcopytostoreºscCsh||}xW|jƒD]I}t|ƒr||jƒkrt|ƒ}t||jƒ|ƒqqWdS(s4Copy all largefiles in a given revision to the storeN(tfilest	isstandintmanifestR\R†R(RCRtctxR€trealfile((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytcopyalltostoreÀs

cCsÝt|j|ƒr7tt|j|ƒt||ƒƒn¢t|dtƒsÙtjt	j
jt||ƒƒƒtjt||ƒd|j
jƒ}x-tjt|dƒƒD]}|j|ƒq¨W|jƒt||ƒndS(Nt
_isconvertingt
createmodeR(R?RR)R=RBtgetattrRRRRRRRRtstoreRŽRRR R!tlinktousercache(RCR„R:R'R(((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRƒÊs%"
cCs5t|j|ƒ}|r1tt||ƒ|ƒndS(N(R=RR)RB(RCR:R((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyR‘ÖscCsr|jtƒ}|r@g|D]}tjj||ƒ^q}n	|g}tj|d||ƒ}d„|_|S(s@Return a match object that applies pats to the standin directorycSsdS(N(R(RLtmsg((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyt<lambda>åsN(	Rmt	shortnameRRR5RRRtbad(RCtpatstoptst
standindirtpatR((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRYÛs+	cs=t|ˆjƒƒ}|j‰‡‡fd†}||_|S(s©Return a matcher that accepts standins corresponding to the
    files accepted by rmatcher. Pass the list of files in the matcher
    as the paths specified by the user.csˆ|ƒoˆjt|ƒƒS(N(tmatchfnR\(RL(Rˆtrmatcher(s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytcomposedmatchfnîs(RYR‡Rš(RCR›tsmatcherRœ((RˆR›s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytcomposestandinmatcherès
		cCsttj|ƒS(sLReturn the repo-relative path to the standin for the specified big
    file.(tshortnameslashRtpconvert(R€((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRbôs
cCs
|jtƒS(ssReturn true if filename is a big file standin. filename must be
    in Mercurial's internal form (slash-separated).(t
startswithRŸ(R€((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRˆscCsMtj|ƒjddƒ}t|ƒdkrE|dtkrE|dSdSdS(NRiii(RR tsplitR[R”R(R€tbits((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyR\s"cCsY|jt|ƒƒ}tjj|ƒrUt|ƒ}t|ƒ}t||||ƒndS(N(RmR\RRR>Rlt
getexecutabletwritestandin(RCRbR„R:t
executable((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyt
updatestandins
cCs||t|ƒjƒjƒS(scread hex hash from standin for filename at given node, or working
    directory if no node is given(RbRjRk(RCR€R((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyR‚scCs'|j||d|rdpdƒdS(s#write hash to <repo.root>/<standin>s
txtN(twwrite(RCRbR:R¦((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyR¥scCsDtjdƒ}x(|D] }|j|ƒ|j|ƒqW|jƒS(s‡Read bytes from instream (iterable) and write them to outfile,
    computing the SHA-1 hash of the data along the way. Return the hash.R©(Rtsha1tupdateR t	hexdigest(tinstreamtoutfilethasherRj((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytcopyandhashs


cCst|j|ƒƒS(N(RlRm(RCR„((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pythashrepofile(scCsrtjj|ƒsdStjdƒ}t|dƒ}x'tj|dƒD]}|j|ƒqGW|jƒ|j	ƒS(NR©Ri€ii(
RRR>RR«RRR¬R!R­(R„R°tfdRj((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRl+s
cCs7tj|ƒj}|tj@o6|tj@o6|tj@S(N(RR#R$tS_IXUSRtS_IXGRPtS_IXOTH(R€tmode((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyR¤5s

cGs<d„}|||ƒ}x|D]}|||ƒ}qW|S(NcSs@|jdƒs|d7}n|jdƒr8|d}n||S(NRi(tendswithR¡(tlefttright((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyR5<s


((tfirsttsecondtargR5turlta((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyturljoin;s
	
cCs=tjƒ}x$tj|ƒD]}|j|ƒqW|jƒS(sUhexsha1 returns the hex-encoded sha1 sum of the data in the file-like
    object data(RR«RR¬R­(RjthR(((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pythexsha1HscCstj||dƒS(NR(Rthttpsendfile(RR€((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRÃPscCstjtjj|ƒƒS(s@Return a version of path normalized for use with the lfdirstate.(RR RRtnormpath(R((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRHSscCsQd|jkr5tjd„|jjƒDƒƒr5tStjt|j|tƒƒS(NRcss|]}t|dkVqdS(iN(RŸ(t.0RL((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pys	<genexpr>Ys(	trequirementsRtanyRt	datafilesRRdRRR(RC((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytislfilesrepoWs"tstoreprotonotcapablecBseZd„ZRS(cCs
||_dS(N(t
storetypes(RIRË((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyt__init___s(RTRURÌ(((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyRÊ^scCsˆg}t|ƒ}xo|jj|gttƒD]R}t|ƒ}yt||ƒ}Wntk
rld}nX|j||fƒq.W|S(N(	RYRRZRRR\R‚tIOErrorRRn(RCRaR`RbRcR:((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytgetstandinsstatebs"

cCsZt|ƒjt|ƒƒ}g}x2|D]*}|d|kr(|j|dƒq(q(W|S(Ni(tsettsymmetric_differenceRn(toldstandinstnewstandinstchangedstandinstfilelistRL((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytgetlfilestoupdatens
c
Cs®x§|D]Ÿ}g|jj|ƒD]}|tjkr |^q }||}t|jƒƒ}t|ƒdkr]|jƒ}|jƒdjƒ}	|jƒdjƒ}
x*|	D]"}||kr®|j|ƒq®q®Wx*|
D]"}||krÛ|j|ƒqÛqÛWxY|D]N}|||	j	|dƒksF|||
j	|dƒkr|j|ƒqqWnxF|D]>}t|ƒrd||krd||||jƒj
ƒƒqdqdWqWdS(Niii(t	changelogtparentsRtnullidRÏR‡R[R‰RNtgetRRˆRjRk(
RCRutaddfunctntpR×RŠR‡tmctmp1tmp2RLtfn((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pytgetlfilestouploadvs(
4



8
(;t__doc__RR8R}R#t	mercurialRRRReRRtmercurial.i18nRRR”RŸRRR)R=R?RDRERRdRzRR|R@RBRRRR†RŒRƒR‘RYRžRbRˆR\R§R‚R¥R±R²RlR¤RÀRÂRÃRHRÉt	ExceptionRÊRÎRÕRá(((s;/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.pyt<module>	s^(
									
		
				
						
		
						

Copyright © 2017 || Recoded By Mr.Bumblebee