File: //usr/lib/python3/dist-packages/hgext/largefiles/__pycache__/lfcommands.cpython-310.pyc
o
�]Lb<Z � @ s� d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z m
Z
ddlmZm
Z
mZmZmZmZmZmZmZmZmZ ddlmZ dd lmZmZ d
dlmZmZ ej Z e�� Z!e!j"dd
dded�dfddded�fged�ddd�dd� �Z#dd� Z$dd� Z%dd� Z&d d!� Z'd"d#� Z(d$d%� Z)d&d'� Z*d(d)� Z+d>d*d+�Z,d?d,d-�Z-d.d/� Z. d@d0d1�Z/e!�"d2d3d4g ed5�fgej0 ed6��dAd8d9��Z1e!�"d:g ej0 ed;��d<d=� �Z2dS )Bz=High-level command function for lfconvert, plus the cmdtable.� )�absolute_importN)�_)�bin�hex)�cmdutil�context�error� exthelper�hg�lock�
logcmdutil�match�pycompat�scmutil�util)�hashutil� )�convcmd�filemap� )�lfutil�storefactorys lfconvert� s� size� s9 minimum size (MB) for files to be converted as largefiless SIZEs to-normalFs/ convert from a largefiles repo to a normal repos# hg lfconvert SOURCE DEST [FILE ...]T)�norepo� inferrepoc s t �|�}|d rd}nd}tj| d|�d�dd�}t�|�s(t�t d�| ��t�|�s6t�t d�| ��t�
| |��| �t d�| � tj
| |dd �}d}d } }
�z#�fd
d��j�
d��� �d D �}�j|ji}|�r|�� } |�� }
t� }
t� }|s�| �tjd
�}|r�t��jdt|��}nd}i }| jt d�t d��d �� d�� }|D ]}|�|�� � t�||||
||||� q�W d � n1 s�w Y |j�tj�r�|j� tj� |�!� D ]$}|j�"|�r�|j�#|� z|j�$|j�%|�� W q� t&�y Y q�w |
�r|j'�(d� t)�*|� nEG ��fdd�dt+j,��G � �fdd�dt-j.�� t/| ��\}}|dk�rAt�t d���t-j.}� t-_.zt-j0| ||ddd� W |t-_.n|t-_.w d}W |�rk|j1�2� t3|
| � |�svt4� |j� dS dS |�r�|j1�2� t3|
| � |�s�t4� |j� w w )aM convert 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.s to_normalFTr N)�defaults %s is not a local Mercurial repos initializing destination %s
)�createc 3 s � | ]}� | V qd S �N� )�.0�ctx)�rsrcr �=/usr/lib/python3/dist-packages/hgext/largefiles/lfcommands.py� <genexpr>r s
� �
�zlfconvert.<locals>.<genexpr>r s patternsr s converting revisionss revisionss tip��unit�totals
largefilesc s. e Zd Z� �fdd�Z� ��fdd�Z� ZS )zlfconvert.<locals>.lfsourcec s&