HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //lib64/python2.7/site-packages/hgext/lfs/wrapper.pyo
�
1�3\c@@s�ddlmZddlZddlmZddlmZmZmZm	Z	ddl
mZmZm
Z
mZddlmZmZddlmZd	d
lmZmZd�Zd�Zd
�Zd�Zd�Zd�Zddd�Zdde
jd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*d�Z+d�Z,d�Z-d �Z.d!�Z/d"�Z0e1d#�Z2e1d$�Z3d%�Z4d&�Z5d'�Z6dS((i(tabsolute_importN(t_(tbinthextnullidtshort(terrort
repositorytrevlogtutil(tstorageutilt
stringutili(tlfutili(t	blobstoretpointercK@s5d|kr|jtj�n|d|d||�S(Ntlfstrequirementstfeatures(taddRtREPO_FEATURE_LFS(torigRRtkwargs((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytlocalrepomakefilestorage"scC@s||�}|jd�|S(Nt03(R(Rtuitversions((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytallsupportedversions(s
cC@sW|||�}tj|jd�rSd|jkrC|jd�n|jd�n|S(s5Wrap server command to announce lfs server capabilitytlfslocalblobstoreRs	lfs-serve(R	tsafehasattrtsvfsRtappend(Rtrepotprototcaps((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyt
_capabilities-scC@stS(N(tFalse(tselfttext((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytbypasscheckhash;scC@s�tj|�}|j�}|jj}|j|�s^|j|_|jjj|g|�n|j	|dt
�}i}xD|j�D]6}|jd�r�|t
d�}||||<q�q�W|s�|jd�r�tj||�}n|tfS(s%Read filelog content from local blobstore transform for flagprocessor.

    Default tranform for flagprocessor, returning contents from blobstore.
    Returns a 2-typle (text, validatehash) where validatehash is True as the
    contents of the blobstore should be checked using checkhash.
    tverifysx-hg-s
(RtdeserializetoidtopenerRthastfilenametlfsremoteblobstoret	readbatchtreadR#tkeyst
startswithtlenR
tpackmetatTrue(R$R%tpR)tstorethgmetatktname((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyt
readfromstore>sc
C@s�tj|�\}}|r4|dkr4||}nttj|�j��}|jjj||�d|}t	j
d|ddt|��}tj
|�s�d|d<n|dk	r�x+|j�D]\}}||d|<q�Wn|j�}	|	tfS(	Nis	sha256:%sR)tsizes%dt0sx-is-binarysx-hg-%s(R
t	parsemetaRthashlibtsha256tdigestR*RtwriteRt
gitlfspointerR2RtbinarytNonet	iteritemst	serializeR#(
R$R%R7toffsetR)tlongoidtmetadataR8tvtrawtext((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytwritetostoreZs

"
cC@sv|dkr1|dkrtS|jj|�}n|jj|�}|tkrStS|jj|�}t|tj	@�S(N(
RDR#t_revlogtrevtnodeRtflagstboolRtREVIDX_EXTSTORED(trlogRORNRP((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyt_islfsxsc
K@s�|jjjjd�}|rzt|�}tj|�\}
}|rR||8}n||jj|�rz|	tj	O}	qzn|||||||d|d|d|	|
�S(Ntlfstrackt
cachedeltaRORP(
RMR*toptionstgetR2R
R=R,RRR(RR$R%ttransactiontlinktp1tp2RVRORPtkwdsRUttextlentmetaRG((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytfilelogaddrevision�s
cC@s�t||�rw|jj|dt�}|s1tStj|�}d|krpd|krp|dt|d�fStSn|||�S(Ntraws	x-hg-copysx-hg-copyrev(RTRMtrevisionR4R#RR(R(RR$RORKRI((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytfilelogrenamed�scC@sTt|d|�rG|jj|dt�}tj|�}t|d�S|||�S(NRNRaR;(RTRMRbR4RR(tint(RR$RNRKRI((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytfilelogsize�s
cC@sq|j�rdt|dd���rdtj|j��}tj|j��}|j�|j�kS|||�S(s+returns True if text is different than fctxtislfscS@stS(N(R#(((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyt<lambda>�t(RftgetattrRR(trawdataR)(RR$tfctxR[R\((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyt
filectxcmp�s
$cC@sG|j�r=tj|j��}tt|jdd���S||�S(Nsx-is-binaryi(RfRR(RjRQRdRX(RR$RI((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytfilectxisbinary�scC@st|j�|j��S(N(RTtfilelogtfilenode(R$((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytfilectxislfs�scC@s4||||||�|jd||j��dS(NRj(tdataRj(Rtfmtctxtmatchertpathtdecode((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyt_updatecatformatter�sc@sJ||�}|jdkrFd|jf�fd��Y��|_n|S(Nthgtlfssinkc@seZ�fd�ZRS(c		@s�t�|�j}	|	||||||||�}
d|jjkr�|j|
�t�fd�|D��r�|jjjd�|jj�q�n|
S(NRc3@s1|]'\}}|�ko(�|j�VqdS(N(Rf(t.0tftn(Rs(s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pys	<genexpr>�s(tsupert	putcommitRRtanyRt_writerequirements(R$tfilestcopiestparentstcommittsourcetrevmaptfulltcleanp2tpcRO(Ry(Rss7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyR~�s	
(t__name__t
__module__R~((Ry(s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyRy�s(trepotypet	__class__(Rtsink((Rys7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytconvertsink�s
cC@s�|||�x<|jj�D]+\}}|jd�r||j|<qqWxBddgD]4}tj||�rYt||t||��qYqYWdS(NRRR-(RWtitemsR1R	RtsetattrRi(RR$tothervfsR8RJR9((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytvfsinit�s
c
C@s�tj|jd�sdSg}t�}|jj}x�|D]�}||}x�|j|�D]o}t||�}	|	r[|	j�|kr[|j|	j��r[||	_	|j
|	�|j|	j��q[q[Wq;W|r�tj
|�j||�ndS(sSEnsure that required LFS blobs are present, fetching them as a group if
    needed.RN(R	RRtsetRtwalktpointerfromctxR)R+R,RRR
tremoteR.(
Rtrevstmatchtpointerstoidst
localstoreRNRsR{R5((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyt_prefetchfiles�s	

.	
cC@s/tj|jd�stSt|jjtj�S(NR-(R	RRR4t
isinstanceR-R
t_nullremote(R((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyt_canskipuploadscC@s0tj|jd�stSt|jjtj�S(NR-(R	RRR#R�R-R
R�(R((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytcandownload
scC@s0t|�rdSt||�}t||�dS(suupload lfs blobs introduced by revs

    Note: also used by other extensions e. g. infinitepush. avoid renaming.
    N(R�textractpointerstuploadblobs(RR�R�((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytuploadblobsfromrevsscC@st|j|jj�S(s�Prepush hook.

    Read through the revisions to push, looking for filelog entries that can be
    deserialized into metadata so that we can block the push on their upload to
    the remote blobstore.
    (R�Rtoutgoingtmissing(tpushop((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytprepushscO@s�d|jkr�|j�rZ|jd�rZtd�}tj|ddtd���n|jj}z5tj	||j
��|j_|||||�SWd||j_Xn|||||�SdS(s�bail on push if the extension isn't enabled on remote when needed, and
    update the remote store based on the destination path.Rs:required features are not supported in the destination: %sthints&enable the lfs extension on the serverN(RtlocaltcapableRRtAbortRR-R
R�turl(RRR�targsRtmtremotestore((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytpush%sc		O@s/t||j�|||||||||�S(s;upload LFS blobs added by outgoing revisions on 'hg bundle'(R�R�(	RRRR�R,t
bundletypeR�R�R((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytwritenewbundle?sc	C@s�|jjd�i}|jj}|td�td�t|���r}xO|D]G}||}x*t|�j�D]}|||j�<qsW|j�qPWt	|j�dd��SWdQXdS(s1return a list of lfs pointers added by given revss&lfs: computing set of blobs to upload
s
lfs searcht
changesetstkeycS@s
|j�S(N(R)(R5((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyRgRRhN(
RtdebugtmakeprogressRR2tpointersfromctxtvaluesR)t	incrementtsorted(RR�R�R�tprogresstrRsR5((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyR�Fs'

cC@s|}||kre|sdS||j�kr=|j�}qe||j�kr^|j�}qedSn||}t|j�|j��s�dSy-tj|j��}||kr�|SiSWnDtj	k
r}t
jtd�|t
|j��|f��nXdS(s?return a pointer for the named file from the given changectx, or None if
    the file isn't LFS.

    Optionally, the pointer for a file deleted from the context can be returned.
    Since no such pointer is actually stored, and to distinguish from a non LFS
    file, this pointer is represented by an empty dict.
    s#lfs: corrupted pointer (%s@%s): %s
N(RDR[R\RTRnRoRR(RjtInvalidPointerRR�RRRO(RsR{tremovedt_ctxRkR5tex((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyR�Ts(
cC@ssi}|j�j�}xT|j�D]F}||�s=q%nt||d|�}|dk	r%|||<q%q%W|S(s�return a dict {path: pointer} for given single changectx.

    If ``removed`` == True and the LFS file was removed from ``ctx``, the value
    stored for the path is an empty dict.
    R�N(RtnarrowmatchR�R�RD(RsR�tresultR�R{R5((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyR�rscC@s0|s
dS|jj}|j||jj�dS(s*upload given pointers from local blobstoreN(RR-t
writebatchR(RR�t
remoteblob((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyR��scC@s�|||||�tj|jd�r�tj|jd�r�|jjj}|jjj}xj|j�D]Y\}}}	xG|	D]?}
|jtd�|
�tj	|j
|
�|j
|
��q~WqhWndS(NRscopying lfs blob %s
(R	RRRtvfsR�RARRRZtjoin(RRtsrcrepotdstrepoRt	srclfsvfst	dstlfsvfstdirpathtdirsR�R)((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytupgradefinishdatamigration�s
cC@s/||�}d|jkr+|jd�n|S(NR(RR(RRtreqs((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pytupgraderequirements�s(7t
__future__RR>tmercurial.i18nRtmercurial.nodeRRRRt	mercurialRRRR	tmercurial.utilsR
Rt
largefilesRRhR
RRRR"R&R:RLRDRTtREVIDX_DEFAULT_FLAGSR`RcReRlRmRpRwR�R�R�R�R�R�R�R�R�R�R#R�R�R�R�R�(((s7/usr/lib64/python2.7/site-packages/hgext/lfs/wrapper.pyt<module>sJ""