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 �]LbY � @ sN d dl mZ d dlZddlmZ ddlmZmZmZm Z G dd� de j �ZdS )� )�absolute_importN� )�_)�error� narrowspec�requirements�utilc @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� ZdS ) � dirstateguardan Restore dirstate at unexpected failure. At the construction, this class does: - write current ``repo.dirstate`` out, and - save ``.hg/dirstate`` into the backup file This restores ``.hg/dirstate`` from backup file, if ``release()`` is invoked before ``close()``. This just removes the backup file at ``close()`` before ``release()``. c sx � | _ d| _d| _� fdd�}|d| �| _� j�� �� | j� d | _tj � jv r7|d| �| _t �� | j� d| _d S )NFc s � j j| d�\}}t�|� |S )N)�prefix)�vfs�mkstemp�os�close)r �fd�fname��repo� �9/usr/lib/python3/dist-packages/mercurial/dirstateguard.py�getname( s z'dirstateguard.__init__.<locals>.getnames dirstate.backup.%s.s narrowspec.backup.%s.T)�_repo�_active�_closed�_backupname�dirstate� savebackup�currenttransaction�_narrowspecbackupnamer �NARROW_REQUIREMENTr �savewcbackup)�selfr �namer r r r �__init__# s � zdirstateguard.__init__c C s | j r | �� d S d S )N)r �_abort�r r r r �__del__9 s �zdirstateguard.__del__c C s\ | j std�| j }t�|��| jj�| j�� | j� | j r&t �| j| j � d| _ d| _d S )Ns* can't close already inactivated backup: %sFT) r r r r �Abortr r �clearbackupr r r � clearwcbackupr �r �msgr r r r A s �� � zdirstateguard.closec C s8 | j rt�| j| j � | jj�| j�� | j� d| _d S )NF) r r �restorewcbackupr r � restorebackupr r r r$ r r r r# Q s � zdirstateguard._abortc C s4 | j s| jstd�| j }t�|��| �� d S d S )Ns, can't release already inactivated backup: %s)r r r r r r&