Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib64/python3.9/site-packages/hgext/remotefilelog/__pycache__/ |
Upload File : |
a �+�b�? � @ s� d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZ d dl m Z mZ d dlm Z d dlmZmZmZ d dlmZ dd lmZmZ G d d� de�ZG dd � d e�ZdS )� )�absolute_importN)�_)�bin�hex)�open)�error�pycompat�util)�hashutil� )� constants�shallowutilc @ s� e Zd Zd#dd�Zdd� Zd$dd�Zd d � Zdd� Zd d� Zdd� Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd � Zd!d"� ZdS )%� basestoreFc C s� || _ |j| _|| _|| _|| _tjs.t�� nd| _ | j� dd�| _| j� ddd�| _| jdvrfd| _| jdkrvd| _|r�t �| j|� dS ) a� Creates a remotefilelog store object for the given repo name. `path` - The file path where this store keeps its data `reponame` - The name of the repo. This is used to partition data from many repos. `shared` - True if this store is a shared cache of data from the central server, for many repos on this machine. False means this store is for the local data for one repo. N� remotefilelogs validatecachelogs validatecache� on)r � strict� offr F)�repo�ui�_path� _reponame�_sharedr Z iswindows�os�getuid�_uidZconfig�_validatecachelog�_validatecacher �mkstickygroupdir)�selfr �pathZreponameZshared� r �C/usr/lib64/python3.9/site-packages/hgext/remotefilelog/basestore.py�__init__ s$ �� zbasestore.__init__c C s^ g }|D ]P\}}| � ||�}tj�|�}|rF| jdkrF| �|d�sFd}|s|�||f� q|S )Nr s containsF)�_getfilepathr r �existsr �_validatekey�append)r �keys�missing�name�node�filepathr$ r r r! � getmissing8 s �� �zbasestore.getmissingNc C sV |r|� tj�rd S | jrR| �� D ].\}}|D ] }|�| ||� |�| ||� q.q"d S �N)�getr ZOPTION_PACKSONLYr � _getfilesZ markdataentryZmarkhistoryentry)r �ledger�options�filenameZnodesr* r r r! � markledgerJ s zbasestore.markledgerc C s� | j }|j�| g �}d}|jtd�dt|�d�}|D ]B}|jsJ|jrn|jrn|� |� | � |j|j�}t �|� |d7 }q4|�� | �| �� � d S )Nr s cleaning up� files��unit�totalr )r Zsourcesr. �makeprogressr �lenZgcedZdatarepackedZhistoryrepacked�updater# r2 r* r � tryunlink�complete�_cleanupdirectory�_getrepocachepath)r r0 r �entries�count�progress�entryr r r r! �cleanupS s � zbasestore.cleanupc C s� t � }t � }tj�|�D ]�\}}t�|�rftj�||�}| � |� zt� |� W q� tyb Y q�0 qt�|�r|� d�r�|�|dd� � q|�|� q|| D ] }tj�||d �}t�|� q�dS )z�Removes the empty directories and unnecessary files within the root directory recursively. Note that this method does not remove the root directory itself.� _oldN���)�setr Zosutil�listdir�stat�S_ISDIRr r �joinr= �rmdir�OSError�S_ISREG�endswith�addr; ) r ZrootdirZoldfilesZ otherfilesr) �mode�dirpathr2 r+ r r r! r= g s"