https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/hgext/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/hgext/__pycache__/relink.cpython-310.pyc
o

�]Lb��@s�dZddlmZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
ddlmZmZiZe�e�ZdZed	ged
�ejd�ddd
��Zdd�Zdd�Zdd�ZdS)z-recreates hardlinks between repository clones�)�absolute_importN)�_)�open)�error�hg�	registrar�util)�
stringutil�urlutilsships-with-hg-core�relinks[ORIGIN])�helpcategoryc		Ks\t�td�rt�td�st�td���|durd|jvrd}t�d|||�\}}t�	|j
|�}|�td�|jj
|jj
f�|j|jkrM|�td��dSt�|jj
|jj
�s^t�td	���|���B|���%tt||��}t||jj
|jj
|�}t|jj
|jj
||�Wd�n1s�wYWd�dSWd�dS1s�wYdS)
a�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.)
    ssamefiles
samedevices*hardlinks are not supported on this systemNsdefault-relinkrsrelinking %s to %s
sthere is nothing to relink
�/source and destination are on different devices)r�safehasattrr�Abortr�pathsr
�get_unique_pull_pathr�
repository�baseui�status�store�path�root�
samedevice�lock�sorted�collect�prune�	do_relink)	�ui�repo�origin�optsr�__�src�
candidates�targets�r&�./usr/lib/python3/dist-packages/hgext/relink.py�relink$s&�P�r(cCs*ttjj�}g}t|d���}|dd}|jj}|jtd�td�|d�}d}|�td�||f�t�	|�D]K\}}	}
|	�
�|t|�|d�}t|
�D]3}|d	d�d
vrZqOt�tj�
||��}
t�|
j�skqO|d7}|�tj�
||�|
f�|j||d�qOq8|��|�td
�t|��|S)Nstip��s
collecting�files��unit�totalrs6tip has %d files, estimated total number of files: %d
���)s.ds.i���items%collected %d candidate storage files
)�len�osr�sep�manifestr�makeprogressrr�walk�sortr�stat�join�S_ISREG�st_mode�append�update�complete)r#r�seplenr$�liver.�progress�pos�dirpath�dirnames�	filenames�relpath�filename�str&r&r'rXs8���
rc
Cs�dd�}g}|jtd�td�t|�d�}d}|D]5\}}	|d7}tj�||�}
tj�||�}||
||	�}|s>|�d|�q|�||jf�|j	||d	�q|�
�|�td
�t|��|S)NcSsbzt�|�}Wn
tyYdSwt�||�rdSt�||�s't�td���|j	|j	kr/dS|S)NFr
)
r4r:�OSErrorr�samefilerrrr�st_size)r#�dstrJ�tsr&r&r'�
linkfilter}s��zprune.<locals>.linkfilterspruningr+r,rr0�not linkable: %s
r1s,pruned down to %d probably relinkable files
)r7rr3r4rr;�debugr>rMr?r@r)
r$r#rNrrPr%rCrD�fnrJ�srcpath�tgtrOr&r&r'r|s*��rcCs^dd�}d}d}d}|jtd�td�t|�d�}d}	|D]~\}
}|	d7}	tj�||
�}tj�||
�}
t|d	�}t|
d	�}|�|�}|rT|�|�}||krMn|�|�}|sC|��|��|rf|�	d
|
�qz|||
�|j
|	|
d�|d7}||7}Wqty�}z|�d|
t
�|�f�WYd}~qd}~ww|��|�td
�|t�|�f�dS)NcSsP|d}t�||�zt�||�Wnty t�||��wt�|�dS)Ns.bak)r4�renamer�oslinkrK�remove)r#rN�bakr&r&r'�
relinkfile�s�zdo_relink.<locals>.relinkfileirs	relinkingr+r,r0srbrQr1s%s: %s
s!relinked %d files (%s reclaimed)
)r7rr3r4rr;r�read�closerRr?rK�warnr	�forcebytestrr@rr�	bytecount)r#rN�filesrrZ�CHUNKLEN�relinked�
savedbytesrCrD�f�sz�sourcerU�sfp�dfp�sin�din�instr&r&r'r�sR
�




�
$����r)N)�__doc__�
__future__rr4r:�mercurial.i18nr�mercurial.pycompatr�	mercurialrrrr�mercurial.utilsr	r
�cmdtable�command�
testedwith�CATEGORY_MAINTENANCEr(rrrr&r&r&r'�<module>s$
�1$)

https://t.me/RX1948 - 2025