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: //usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyc
�
1�3\c@@s3dZddlmZddlZddlZddlZddlZddlmZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZmZddlmZmZdd	lmZmZejZiZeje�Zed
ddd
ed�dfd
deed�fged�de de �d��Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)eed�Z*dd�Z,dd �Z-dded!�Z.ed"d#d$ged%�fge
j/ed&��d'd(��Z0ed)ge
j/ed*��d+��Z1dS(,s=High-level command function for lfconvert, plus the cmdtable.i(tabsolute_importN(t_(tcmdutiltcontextterrorthgtlocktmatchtnodetpycompatt	registrartscmutiltutili(tconvcmdtfilemapi(tlfutiltstorefactoryt	lfconverttstsizets9minimum size (MB) for files to be converted as largefilestSIZEs	to-normals/convert from a largefiles repo to a normal repos#hg lfconvert SOURCE DEST [FILE ...]tnorepot	inferrepoc@stj|�}|dr"t}n*t}tj|t|jd�dd�}tj	|�swt
jtd�|��ntj	|�s�t
jtd�|��ntj
||��|jtd�|�tj
||dt�}t}d}	}
z��fd��jjd�j��dD�}itjtj6}|r�|j�}	|j�}
t�}
t�}|s�|jtjd	�}n|r�tj�jd
t|��}nd}i}|jtd�dtd
�d�dj���M}xC|D];}|j|j��t �||||
||||�	q�WWdQX|j!j"tj#�rd|j!j$tj#�nxm|j%�D]_}|j!j&|�r�|j!j'|�ny |j!j(|j!j)|��Wqqt*k
r�qqXqqW|
r�|j+j,d�|j-�q�n�dt.j/f��fd��Y�dt0j1f��fd��Y�t2|��\}}|dkrwt
jtd���nt0j1}�t0_1z#t0j3|||dddd�Wd|t0_1Xt}Wd|r�|j4j5�t6|
|	�n|s�t7j$|j�nXdS(sMconvert a normal repository to a largefiles repository

    Convert repository SOURCE to a new repository DEST, identical to
    SOURCE except that certain files will be converted as largefiles:
    specifically, any file that matches any PATTERN *or* whose size is
    above the minimum size threshold is converted as a largefile. The
    size used to determine whether or not to track a file as a
    largefile is the size of the first version of the file. The
    minimum size can be specified either with --size or in
    configuration as ``largefiles.size``.

    After running this command you will need to make sure that
    largefiles is enabled anywhere you intend to push the new
    repository.

    Use --to-normal to convert largefiles back to normal files; after
    this, the DEST repository can be used without largefiles at all.t	to_normalRtdefaults %s is not a local Mercurial reposinitializing destination %s
tcreatec3@s|]}�|VqdS(N((t.0tctx(trsrc(sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pys	<genexpr>esitpatternsRsconverting revisionstunitt	revisionsttotalttipNt
largefilestlfsourcec@s)eZ�fd�Z��fd�ZRS(c@s3t�|�j||d�d|jjtj<dS(Nt.(tsupert__init__tNonet
filemappertrenameRt	shortname(tselftuitsource(R$(sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR'�sc@s�|\}}t�|�j||�}|jtj�sJ|ddkrN|S|dj�}tj�|�}|dkr�tj	t
d�||f��ntj|�|dfS(Nis missing largefile for '%s' in %si(
R&tgetfilet
startswithRtshortnameslashR(tstriptfindfileRtAbortRRtreadfile(R,tnametrevtrealnametrealrevtfthashtpath(R$R(sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR/�s(t__name__t
__module__R'R/((R$R(sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR$�st	converterc@seZ��fd�ZRS(c@s5�||�}t�|�j|||||�dS(N(R&R'(R,R-R.tdestt
revmapfiletoptstsrc(R?R$(sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR'�s(R=R>R'((R?R$(sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR?�ss&all largefiles must be present locallytsource_typeRt	dest_type(8R	tbyteskwargstFalsetTrueRt
getminsizetgetR(RtislocalRR4Rt
repositorytstatust	changelogtnodesbetweentheadsRtnullidtwlockRtsett
configlisttlongnametmatchmodRtroottlisttmakeprogressR7tupdatet_lfconvert_addchangesettwvfstexistsR+trmtreetkeystisfiletunlinkt
removedirstdirnametOSErrortrequirementstaddt_writerequirementsRtfilemap_sourceR
R?tdownloadlfilestconverttdirstatetcleartreleasetshutil(R-RCR@tpatsRBttolfileRtrdsttsuccesstdstwlocktdstlocktctxstrevmaptlfilestnormalfilestmatchertlfiletohashtprogressRR:tfoundtmissingtorig((R?R$RsA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR2s�
	$
		!
 
""		#


c	@s�t���}	t�|	�}
g}x`|
D]X}||kr&||kr&t|�||�}
|�j�kr�j|�}|j�}|dkr�t}n|o�|d|k}|
|O}
d|j�kr|r�t	j
td�|��nt}
qn|
r|j|�q&|j|�n||krvt
j|�}|j|�|�j�kr��j|�}d|j�kr�|j�}|r�|d|kr�t	j
td�|��q�ntjd�}|j�|j��|j�}|�ks�||krs|j|�|j��|j��d�|j�k}t
j||||�|�|<qsq�q+|j|�q+W���fd�}t||	�||��dS(Nitls+renamed/copied largefile %s becomes symlinkslargefile %s becomes symlinkRtxc@s�tj|�}|dk	r�y�j|�}Wntjk
rEdSX|j�}|rntj|d�}ntj	|||�|dd|j
�kd|j
�k|�St|�|��SdS(Nis
RR�(RtsplitstandinR(tfilectxRtLookupErrortrenamedtstandinRt
memfilectxtflagst_getnormalcontext(trepotmemctxR:tsrcfnametfctxR�(RRzRv(sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyt
getfilectx�s(t_convertparentst_getchangedfilest_islfiletmanifestR�R�R(RGR�RR4RRfRR�tappendthashlibtsha1RZtdatat	hexdigesttwwritetwritestandint_commitcontext(RRqRRvRwRxRyRRztparentstfilestdstfilesR:tislfileR�R�trenamedlfiletfstandintmR;t
executableR�((RRzRvsA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR[�sV
	
	

'c	C@s�tj|||j�|||j�|j�|j��}|j|�}tj||�|j	|�|j
j�||j�<dS(N(
RR�tdescriptiontusertdatetextrat	commitctxRtcopyalltostoret
setparentsRNR"R(RqR�RR�R�Rvtmctxtret((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR�s$
cC@s�t|j��}tj|kr�|j�}|j�dj�}|j�dj�}|t|�t|�Bt|�O}xY|D]N}|||j|d�ks�|||j|d�kr�|j|�q�q�Wn|S(Nii(	RSR�RRQR�R�RJR(Rf(RR�R�tmctmp1tmp2R:((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR� s$
8cC@sag}x+|j�D]}|j||j��qWx&t|�dkr\|jtj�q7W|S(Ni(R�R�RtlenRQ(RRvR�tp((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR�-scC@s�y|j|�}Wntjk
r*dSX|j�}|rJ|d}n|j�}|dkrzt|j||�}ntj	||||d|j
�kd|j
�k|�S(Nis.hgtagsRR�(R�RR�R(R�R�t_converttagsR-RR�R�(R�RR:RvR�R�R�((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR�6s
!cC@sg}x�|j�D]�}y|jdd�\}}Wn+tk
rb|jtd�|�qnXytj|�}Wn+tk
r�|jtd�|�qnXy(|jdtj	||�|f�Wqt
k
r�|jtd�|�qqXqWdj|�S(Nt is&skipping incorrectly formatted tag %s
s%skipping incorrectly formatted id %s
s%s %s
sno mapping for id %s
R(t
splitlinestsplitt
ValueErrortwarnRRtbint	TypeErrorR�thextKeyErrortjoin(R-RvR�tnewdatatlinetidR6tnewid((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR�Fs*


cC@s|dks$|dks$|dkr(tS|r>||�r>tSy%|j|�j�|ddkSWntjk
rztSXdS(slReturn true if file should be considered a largefile, i.e.
    matcher matches it or it is larger than size.s.hgtagss	.hgignores.hgsigsiN(RGRHR�RRR�(tfileRRyR((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR�]s$%cC@s.|s
dStj||dt�}d}|jdt|��|j|�}g|D]}||sU|^qU}|jdt|��|jtd�dtd�d	t|���s}xi|D]a}	|j|�t	j
||	�}
|
stjtd
�|	��n|j
|
|	�|d7}q�WWdQXdS(s&upload largefiles to the central storeNtputis,sending statlfile command for %d largefiles
s"%d largefiles need to be uploaded
suploading largefilesRR�R!s6largefile %s missing from store (needs to be uploaded)i(Rt	openstoreRHtdebugR�R]RYRRZRR3RR4R�(R-RRqR�tstoretattretvalthR{R;R.((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pytuploadlfilesjs$#


cC@sC|r|jd�}n	dg}tj|�}|j|d|�S(s)Verify that every largefile revision in the current changeset
    exists in the central store.  With --contents, also verify that
    the contents of each local largefile file revision are correct (SHA-1 hash
    matches the revision ID).  With --all, check every changeset in
    this repository.sall()R%tcontents(trevsRR�tverify(R-R�tallR�R�R�((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pytverifylfiles�s
	cC@s�tj||�}|r1t|�t|�@}ng}||}x�|D]}y tj|tj|��}Wn.tk
r�}	|	jtjkr�qHn�nXtj||�sH|j	||f�qHqHW|r�t
j|�}
|
j|�}|SggfS(s.cachelfiles ensures that all largefiles needed by the specified revision
    are present in the repository's largefile cache.

    returns a tuple (cached, missing).  cached is the list of files downloaded
    by this operation; missing is the list of files that were needed but could
    not be found.(
Rt
listlfilesRSt
readasstandinR�tIOErrorterrnotENOENTR3R�RR�RJ(R-R�RtfilelistRwttogetRtlfiletexpectedhashterrR�R�((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pytcachelfiles�s&

 c
C@s�tj|d|jtj�gi�}d�}d}d}|gkr�xhtj||i|d6|�D]D}t|||j	��\}}	|t
|�7}|t
|	�7}qiWn|jtd�|�|dkr�|jtd�|�n||fS(NcS@sdS(N((Rtfns((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pytprepare�siR7s %d additional largefiles cached
s!%d largefiles failed to download
(
RRR(twjoinRR+RtwalkchangerevsR�RR�RMR(
R-R�R7RR�ttotalsuccessttotalmissingRRrR}((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyRi�s(	
cC@shtj|||�}|j��Atj||�}ttj|��t|�B}|dk	r�t|�}g|D]}||krr|^qr}ni}	t�}
d
\}}|j}
|d}x�|D]�}|}tj	j
tj|||
j
|��d|j�}tj|�}tj	j
tj|||
j
|��d|j�}|
j|�r)|
j|�r�|
j|�r�tj|
j
|�|
j
|��|
j|�ntj||�}|dkrj||kr|j|dkr�|
j|dt�q|
j|�n|j|�||	|<qjq�|
j|�r�|jj|�|kr�|
j|�|d7}q�q�W|j�|r	g|D]}||
kr�|^q�}x=|
D]5}|jjtj|��tj||||�q�W|td��t||d|�nx%|D]}d}|	j|�}|rbtj|||�sLqn|j |�d}n|}tj|�}|
j|�r
|
j!|�j"d@}|
j!|�}|j"}||d@kr
|dM}|r�||d
?d	@t#j$@O}n|
j%||�d}q
n||7}tj||||�qW|j�|r^|td�||f�nWdQXdS(s�Update largefiles according to standins in the working directory

    If ``printmessage`` is other than ``None``, it means "print (or
    ignore, for false) message forcibly".
    itstartRt?t
ignoremissingisgetting changed largefiles
i@iIis"%d largefiles updated, %d removed
N(iii����(&RtgetstatuswriterRRtopenlfdirstateRSR�R(R\tosR<trelpathRtorigpathR�RWR�R]Rntcopyfilet
unlinkpathR�RkRHRftnormallookupt	normalizetwritetsynclfdirstateRR�RJt
copyfromcachetnormaltstattst_modeRtumasktchmod(R-R�R�tprintmessageR�tstatuswritert
lfdirstateRwR:RZtdroppedtupdatedtremovedR\twctxR�trellfiletrellfileorigt
relstandintrelstandinorigt
expecthashtupdate1tstandinexectsttmode((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pytupdatelfiles�s�
(		

		


%


		


tlfpulltrR7s#pull largefiles for these revisionss--r REV... [-e CMD] [--remotecmd CMD] [SOURCE]Rc	K@s�||_|jdg�}|s9tjtd���ntj||�}d}xM|D]E}|jtd�|�t|||�\}}|t	|�7}qXW|j
td�|�dS(s0pull largefiles for the specified revisions from the specified source

    Pull largefiles that are referenced from local changesets but missing
    locally, pulling from a remote repository to the local cache.

    If SOURCE is omitted, the 'default' path will be used.
    See :hg:`help urls` for more information.

    .. container:: verbose

      Some examples:

      - pull largefiles for all branch heads::

          hg lfpull -r "head() and not closed()"

      - pull largefiles on the default branch::

          hg lfpull -r "branch(default)"
    R7sno revisions specifiedis#pulling largefiles for revision %d
s%d largefiles cached
N(tlfpullsourceRJRR4RRtrevrangetnoteR�R�RM(	R-R�R.RBR�t	numcachedR7tcachedR}((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR3s	
t
debuglfputtFILEcK@s=tj|�}tj|�j||�|jd|�dS(Ns%s
i(RthashfileRR�R�R�(R-R�tfilepathtkwargsR;((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyR
Zs(2t__doc__t
__future__RR�R�R�Rntmercurial.i18nRt	mercurialRRRRRRRVRR	R
RRRjR
RRRRRmtcmdtabletcommandRGRHRR[R�R�R�R�R�R�R�R�R(R�RiRt
remoteoptsRR
(((sA/usr/lib64/python2.7/site-packages/hgext/largefiles/lfcommands.pyt<module>	sRL			�	T			
					
	q#