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: //proc/self/root/usr/lib64/python2.7/site-packages/hgext/relink.pyc
�
1�3\c@@s�dZddlmZddlZddlZddlmZddlmZm	Z	m
Z
mZddlm
Z
iZe
je�ZdZedged	�d
ej�dd��Zd�Zd
�Zd�ZdS(s-recreates hardlinks between repository clonesi(tabsolute_importN(t_(terrorthgt	registrartutil(t
stringutilsships-with-hg-coretrelinks[ORIGIN]thelpcategoryc
K@srtjtd�s&tjtd�r>tjtd���ntj|j|j|pYd|pbd��}|j	td�|j
j|j
jf�|j|jkr�|j	td��dStj
|j
j|j
j�s�tjtd	���n|j��m|j��Ztt||��}t||j
j|j
j|�}t|j
j|j
j||�WdQXWdQXdS(
s�recreate hardlinks between two repositories

    When repositories are cloned locally, their data files will be
    hardlinked so that they only use the space of a single repository.

    Unfortunately, subsequent pulls into either repository will break
    hardlinks for any files touched by the new changesets, even if
    both repositories end up pulling the same changes.

    Similarly, passing --rev to "hg clone" will fail to use any
    hardlinks, falling back to a complete copy of the source
    repository.

    This command lets you recreate those hardlinks and reclaim that
    wasted space.

    This repository will be relinked to share space with ORIGIN, which
    must be on the same local disk. If ORIGIN is omitted, looks for
    "default-relink", then "default", in [paths].

    Do not attempt any read operations on this repository while the
    command is running. (Both repositories will be locked against
    writes.)
    tsamefilet
samedevices*hardlinks are not supported on this systemsdefault-relinktdefaultsrelinking %s to %s
sthere is nothing to relink
Ns/source and destination are on different devices(RtsafehasattrRtAbortRRt
repositorytbaseuit
expandpathtstatuststoretpathtrootR
tlocktsortedtcollecttprunet	do_relink(tuitrepotorigintoptstsrct
candidatesttargets((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyR!s )

!cC@s�ttjj�}g}t|dj��}|dd}|jj}|jtd�dtd�d|�}d}|jtd	�||f�x�tj	|�D]�\}}	}
|	j
�|t|�|}x�t|
�D]�}|d
dkr�q�ntjtjj
||��}
tj|
j�s.q�n|d
7}|jtjj
||�|
f�|j|d|�q�Wq�W|j�|jtd�t|��|S(Nttipiit
collectingtunittfilesttotalis6tip has %d files, estimated total number of files: %d
i����s.ds.iititems%collected %d candidate storage files
(s.ds.i(tlentosRtseptmanifestRtmakeprogressRRtwalktsortRtstattjointS_ISREGtst_modetappendtupdatetcomplete(RRtseplenRtliveR%tprogresstpostdirpathtdirnamest	filenamestrelpathtfilenametst((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyRNs0'

"
c
C@sd�}g}|jtd�dtd�dt|��}d}x�|D]�\}}	|d7}tjj||�}
tjj||�}||
||	�}|s�|jd|�qIn|j||jf�|j	|d	|�qIW|j
�|jtd
�t|��|S(NcS@s�ytj|�}Wntk
r'tSXtj||�r>tStj||�shtjt	d���n|j
|j
kr~tS|S(Ns/source and destination are on different devices(R(R.tOSErrortFalseRR	R
RR
Rtst_size(RtdstR>tts((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyt
linkfilterps
tpruningR#R$R%iisnot linkable: %s
R&s,pruned down to %d probably relinkable files
(R+RR'R(RR/tdebugR2RAR3R4R(
RRRBRRDR R7R8tfnR>tsrcpathttgtRC((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyRos$	

cC@s�d�}d}d}d}|jtd�dtd�dt|��}d}	xO|D]G\}
}|	d7}	tjj||
�}tjj||
�}
t|d	�}t|
d	�}|j|�}x8|r�|j|�}||kr�Pn|j|�}q�W|j�|j�|r.|j	d
|
�qUny8|||
�|j
|	d|
�|d7}||7}WqUtk
r�}|jd|
t
j|�f�qUXqUW|j�|jtd
�|tj|�f�dS(NcS@sf|d}tj||�ytj||�Wn$tk
rTtj||��nXtj|�dS(Ns.bak(R(trenameRtoslinkR?tremove(RRBtbak((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyt
relinkfile�s

iit	relinkingR#R$R%itrbsnot linkable: %s
R&s%s: %s
s!relinked %d files (%s reclaimed)
(R+RR'R(RR/topentreadtcloseRFR3R?twarnRtforcebytestrR4RRt	bytecount(RRBR$RRNtCHUNKLENtrelinkedt
savedbytesR7R8tftsztsourceRItsfptdfptsintdintinst((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyR�sD	

	



(
(t__doc__t
__future__RR(R.tmercurial.i18nRt	mercurialRRRRtmercurial.utilsRtcmdtabletcommandt
testedwithtCATEGORY_MAINTENANCEtNoneRRRR(((s2/usr/lib64/python2.7/site-packages/hgext/relink.pyt<module>s",	!	$