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/mercurial/__pycache__/ |
Upload File : |
o �]Lb�I � @ s d dl mZ d dlZddlmZ ddlmZmZ ddlm Z m Z mZmZm Z mZmZmZmZmZmZmZmZ ddlmZmZmZ d)d d �Zdd� Zd d� Zdd� Zd*dd�Zd*dd�Zdd� Z dd� Z!dd� Z"G dd� de#�Z$d+dd�Z%d d!� Z&d"d#� Z'd,d%d&�Z(d'd(� Z)dS )-� )�absolute_importN� )�_)�hex�short) �bundle2�changegroup� discovery�error�exchange�obsolete�obsutil�pathutil�phases�pycompat�requirements�scmutil�util)�hashutil� stringutil�urlutilTc C s� d}| j }|�|�s|�|� | �d||�} tdd� | D ��} t�d�| ���� }d|t |�t |dd� �|f }t�| �} d}| d krKd }|rJd}n|rPd}nd }t j| ||d�}| |dd�}tj| j| d||||||d� S )z8create a bundle with the specified revisions as a backups strip-backups %ln::%lnc s s � | ]}|� � V qd S �N)r ��.0�c� r �2/usr/lib/python3/dist-packages/mercurial/repair.py� <genexpr>4 � � zbackupbundle.<locals>.<genexpr>� s %s/%s-%s-%s.hgN� s 01s HG20s BZs HG10BZs HG10UN)�missingroots�ancestorsofT)s cg.versions obsolescences phases� strip)�compression)�vfs�isdir�mkdir�set�sortedr �sha1�join�digestr r r �localversionr �outgoingr �writenewbundle�ui)�repo�bases�heads�node�suffix�compress�obsolescence� backupdirr% � allcommits� allhashes� totalhash�name� cgversion�comp� bundletyper. �contentoptsr r r �backupbundle( sN � ���rA c C s6 t � }t�|t| ��D ]}|�| | �� � qt|�S )z+find out the filelogs affected by the strip)r( r �xrange�len�update�filesr) )r1 �striprevrE �xr r r � _collectfiles[ s rH c s � � |�\}}� fdd�|D �S )Nc � g | ]}� � |��qS r )�linkrev�r �r��revlogr r � <listcomp>g � z"_collectrevlog.<locals>.<listcomp>)� getstrippoint)rN rF r � brokensetr rM r �_collectrevloge s rS c C sH t � }t| �D ] }|�t||�� q|D ] }|�t| �|�|�� q|S )z<return the changesets which will be broken by the truncation)r( �manifestrevlogsrD rS �file)r1 rE rF �srN �fnamer r r �_collectbrokencsetsj s rX � backupc $ s^ �� � d urt�d��|dv rd}��� ���� �j}�j �j� t|t �r*|g}� fdd�|D �}t |�}t�|�}t�||�} t |��t | �} � j|d d�D ]+}t�fdd �� �|�D ��rg��|� |�vr}| �|� | �� �|�� | �|� qR� fd d�| D �} | r�t � �| ��}| �|� � fdd�| D �} � fdd��D �}d }��j�dd�r�t��|���rƇfdd�t�j�D �}t���\�}d }|d }|r�t�|||�}d }| r�t�| | |dddd�}| �� ��� �zp��d���}t |j� � �}|�!|j"� |�#� � �$||� t%�|||� |D ]}��&|��$||� �q|�'� |�(� }|D ]5\}}||v �r;�q0�j)|ddd�� }|�*|� W d � n 1 �sTw Y |dk�rd�j+�,|� �q0t-�j|� �`��.� �j/�0�� W d � n 1 �s�w Y |�r�| �1t2d�� |�3|d�}t4�5| |||�}�jj6�s��j�7� nt8�9� }|�? d|�:|� }d}t|t;j<��s�dt=�>|� }��|��}t;j?�||d|d� W d � n 1 �s�w Y W d � n 1 �s�w Y |�@� ��d��}��fdd�|D �} �j�A�|| � W d � n 1 �sw Y ��B� D ]8\}!}"z|!�C|"� W �q( tD�y` }# z|#jEtEjFk�rU| �Gt2d �|!�:|"�tH�I|#�f � W Y d }#~#�q(d }#~#ww W n. |�ru| �Gt2d!�|�:|� � |�r�| �Gt2d"�|�:|� � | �Gt2d#�|�:|� � � |�r�|�C|� W d � n 1 �s�w Y ��J� |S )$Ns&