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/mercurial/dirstateutils/__pycache__/ |
Upload File : |
a �+�b} � @ sn d dl mZ d dlZd dlZd dlZddlmZ dZejG dd� de ��Z dd � Zd d� Zdd � Z dd� ZdS )� )�absolute_importN� )�errori���c s0 e Zd ZdZ� fdd�Zdd� Zdd� Z� ZS )� timestampa� A Unix timestamp with optional nanoseconds precision, modulo 2**31 seconds. A 3-tuple containing: `truncated_seconds`: seconds since the Unix epoch, truncated to its lower 31 bits `subsecond_nanoseconds`: number of nanoseconds since `truncated_seconds`. When this is zero, the sub-second precision is considered unknown. `second_ambiguous`: whether this timestamp is still "reliable" (see `reliable_mtime_of`) if we drop its sub-second component. c s* |\}}}|t @ ||f}tt| ��| |�S )N)� rangemask�superr �__new__)�cls�valueZtruncated_seconds�subsec_nanosZsecond_ambiguous�� __class__� �G/usr/lib64/python3.9/site-packages/mercurial/dirstateutils/timestamp.pyr $ s ztimestamp.__new__c C s t �d��d S �Nz+timestamp should never be compared directly�r ZProgrammingError��self�otherr r r �__eq__) s �ztimestamp.__eq__c C s t �d��d S r r r r r r �__gt__. s �ztimestamp.__gt__)�__name__� __module__�__qualname__�__doc__r r r � __classcell__r r r r r s r c C sL | � � \}}z$tt�|��W t�|� | �|� S t�|� | �|� 0 dS )z~return a timestamp for "now" in the current vfs This will raise an exception if no temporary files could be created. N)Zmkstemp�mtime_of�os�fstat�close�unlink)ZvfsZtmpfdZtmpnamer r r � get_fs_now4 s � � r! c C s t �td�S )z4 Returns the `timestamp` at the Unix epoch. )r r )�tupler r r r r r �zeroA s r# c C sR z | j }W n ty* | tj }d}Y n0 td�}|| }|| }t||df�S )zo Takes an `os.stat_result`-like object and returns a `timestamp` object for its modification time. r g e��AF)�st_mtime_ns�AttributeError�stat�ST_MTIME�intr )�stat_resultZnanosZsecsr Zbillionr r r r H s r c C sz t | �}|d }|d }|d }|d }||krR|rN|rN||k rNt||df�S dS || k rjd| k rrn ndS |S dS )a4 Same as `mtime_of`, but return `None` or a `Timestamp` with `second_ambiguous` set if the date might be ambiguous. A modification time is reliable if it is older than "present_time" (or sufficiently in the future). Otherwise a concurrent modification might happens with the same mtime. r � TNi�Q )r r )r) Z present_mtimeZ file_mtimeZfile_secondZfile_nsZboundary_secondZboundary_nsr r r �reliable_mtime_ofb s r+ )Z __future__r � functoolsr r&