403Webshell
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/git/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/hgext/git/__pycache__/gitlog.cpython-39.pyc
a

�+�b�C�@s�ddlmZddlmZddlmZmZmZmZddl	m
Z
mZm
Z
mZmZmZmZddlmZmZddlmZddlmZmZmZe��ZGd	d
�d
e�ZGdd�de�Z Gd
d�de�ZGdd�de�Z!e�"ej#�Gdd�de��Z$dS)�)�absolute_import)�_)�bin�hex�nullrev�sha1nodeconstants)�ancestor�	changelog�dagop�encoding�error�manifest�pycompat)�
repository�util)�
stringutil�)�gitutil�indexr
c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�baselogz9Common implementations between changelog and manifestlog.cCs||_||_dS�N)�gitrepo�_db)�self�gr�db�r�6/usr/lib64/python3.9/site-packages/hgext/git/gitlog.py�__init__%szbaselog.__init__cCst|j�d���d�S)NzSELECT COUNT(*) FROM changelogr)�intr�execute�fetchone�rrrr�__len__)s�zbaselog.__len__cCsJ|tjkrdS|j�dt�|�f���}|durBt�|dt	d���|dS)N���z(SELECT rev FROM changelog WHERE node = ?�
00changelog.is
no node %dr)
r�nullidrr r�	togitnoder!r�LookupErrorr�r�n�trrr�rev.s
�zbaselog.revcCsH|tkrtjS|j�d|f���}|dur<t�|dtd���t	|d�S)Nz(SELECT node FROM changelog WHERE rev = ?r%sno noder)
rrr&rr r!rr(rr)r�rr+rrr�node8s�zbaselog.nodecCs"|j�dt�|�f���}|duS)Nz)SELECT node FROM changelog WHERE node = ?)rr r�sysstrr!r)rrr�hasnodeBs

�zbaselog.hasnodeN)	�__name__�
__module__�__qualname__�__doc__rr#r,r.r0rrrrr"s

rc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�baselogindexcCs
||_dSr)�_log)r�logrrrrKszbaselogindex.__init__cCs|j�|�dkS�Nr$)r6r,)rr*rrr�has_nodeNszbaselogindex.has_nodecCs
t|j�Sr)�lenr6r"rrrr#Qszbaselogindex.__len__c
Cs,|j�|�\}}|||d||||j�|�fSr8)r6�
parentrevsr.)r�idxZp1revZp2revrrr�__getitem__Ts
�zbaselogindex.__getitem__N)r1r2r3rr9r#r=rrrrr5Jsr5c@seZdZdZdd�Zdd�Zedd��Zedd	��Zed
d��Z	dd
�Z
d:dd�Zdd�Zdd�Z
dd�Zd;dd�Zd<dd�Zdd�Zd=d d!�Zd"d#�Zd>d$d%�Zd?d&d'�Zd(d)�Zd@d*d+�Zd,d-�Zd.d/�Zd0d1�ZeZd2d3�Zd4d5�Zd6d7�ZdAd8d9�ZdS)Br	sextracCs,z|�|�WdStjy&YdS0dS)NTF)r.rr(�rr,rrr�__contains__ms

zchangelog.__contains__cCstt�t|���Sr)�iterr�xranger:r"rrr�__iter__tszchangelog.__iter__cCst�Sr)�setr"rrr�filteredrevswszchangelog.filteredrevscCst|�Sr)r5r"rrrr}szchangelog.indexcCs$dd�|j�d�D�}t|tj<|S)NcSsi|]}t|d�|d�qS)rr�r)�.0�vrrr�
<dictcomp>�s�z%changelog.nodemap.<locals>.<dictcomp>zSELECT node, rev FROM changelog)rr rrr&)rr-rrr�nodemap�s

�
zchangelog.nodemapcCs&|j�d���}|r t|d�StjS)Nz4SELECT node FROM changelog ORDER BY rev DESC LIMIT 1r)rr r!rrr&�rr+rrr�tip�s�z
changelog.tiprNcCs0|dur|��}|j�d||f�}dd�|D�S)NzFSELECT rev FROM changelog WHERE rev >= ? AND rev <= ? ORDER BY REV ASCcss|]}t|d�VqdS)rN�r�rFr-rrr�	<genexpr>��z!changelog.revs.<locals>.<genexpr>)�tiprevrr )r�start�stopr+rrr�revs�s�zchangelog.revscCs$|j�d���}|dur |dSdS)Nz3SELECT rev FROM changelog ORDER BY REV DESC LIMIT 1rr$)rr r!rJrrrrP�s�zchangelog.tiprevcCs|tj�|�rtj�dd�|j�dt�|d�f�D�}tj	�|�rN|�
tj�t|�dkrlt�
|dtd���|rx|dSdS)	NcSsg|]}t|d��qS�rrE�rF�xrrr�
<listcomp>�s�z+changelog._partialmatch.<locals>.<listcomp>z,SELECT node FROM changelog WHERE node LIKE ?�%rr%sambiguous identifierr)rZwdirhex�
startswithrZWdirUnsupportedrr rr/Znullhex�appendr&r:ZAmbiguousPrefixLookupErrorr)r�idZ
candidatesrrr�
_partialmatch�s"��
�zchangelog._partialmatchcCsdS)Nrrr>rrr�flags�szchangelog.flagsrc	Csht|�}t�|t|�d�D]F}|d|�}t|j�dt�|d�f���d�}|dkr|Sq|S)Nrz0SELECT COUNT(*) FROM changelog WHERE node LIKE ?rXr)	rrrAr:rrr r/r!)rr.Z	minlengthZnodehexZattempt�	candidate�matchesrrr�shortest�s���
zchangelog.shortestcs8dd�|j�d�D��|r0t�fdd�|D��St��S)NcSsg|]}t|d��qSrTrLrUrrrrW�s�z&changelog.headrevs.<locals>.<listcomp>zISELECT rev FROM changelog INNER JOIN heads ON changelog.node = heads.nodecsg|]}|�vr|�qSrrrM�Z	realheadsrrrW�rO)rr �sorted�rrSrrar�headrevs�s��zchangelog.headrevsc	Cs�t|t�r|�|�}n|}ddi}|tjkr<tj|tjd�St�|�}dd�|j	�
d|tjf�D�}dd�|j	�
d|tjf�D�}|j|}tj|d	|j
j�d
�|j
j�d
�f|j
j|j
jdf|||j�d
�|d�S)
Nsbranch�default)�extrar
cSsg|]}|d�qSrTrrMrrrrW�s�z/changelog.changelogrevision.<locals>.<listcomp>zBSELECT filename FROM changedfiles WHERE node = ? and filenode != ?cSsg|]}|d�qSrTrrMrrrrW�s�zASELECT filename FROM changedfiles WHERE node = ? and filenode = ?s%s <%s>�utf8�<)r
�user�date�files�filesremoved�descriptionrf)�
isinstancerr.rr&�hgchangelogZ_changelogrevisionrr'rr �nullgitrZauthor�name�encode�email�time�offset�message)rZ	nodeorrevr*rf�hnrkrl�crrr�changelogrevision�sB

�
����
�
�zchangelog.changelogrevisionFcCsHt|�}|�|���}|D]}||krtd|��qtj|j|||d�S)NsInvalid rev %r)�stoprev�	inclusive)�listr,rK�
IndexErrorrZ
lazyancestorsr;)rrSrzr{rKr-rrr�	ancestorss
�zchangelog.ancestorscCst�||j|j�Sr)r
ZdescendantrevsrSr;rcrrr�descendantsszchangelog.descendantscCs|durtg}t�|j|�S)aOReturn an object that can be used to incrementally compute the
        revision numbers of the ancestors of arbitrary sets that are not
        ancestors of common. This is an ancestor.incrementalmissingancestors
        object.

        'common' is a list of revision numbers. If common is not supplied, uses
        nullrev.
        N)rrZincrementalmissingancestorsr;)r�commonrrr�incrementalmissingrevss	z changelog.incrementalmissingrevscsh|durtjg}|dur ���}�fdd�|D�}�fdd�|D�}�j|d�}�fdd�|�|�D�S)a.Return the ancestors of heads that are not ancestors of common.

        More specifically, return a list of nodes N such that every N
        satisfies the following constraints:

          1. N is an ancestor of some node in 'heads'
          2. N is not an ancestor of any node in 'common'

        The list is sorted by revision number, meaning it is
        topologically sorted.

        'heads' and 'common' are both lists of node IDs.  If heads is
        not supplied, uses all of the revlog's heads.  If common is not
        supplied, uses nullid.Ncsg|]}��|��qSr�r,�rFr*r"rrrW3rOz)changelog.findmissing.<locals>.<listcomp>csg|]}��|��qSrr�r�r"rrrW4rO)r�csg|]}��|��qSr�r.rMr"rrrW7rO)rr&�headsr�Zmissingancestors)rr�r�Zincrr"r�findmissingszchangelog.findmissingcCs|g}|�|�}|j|dd�D]X}dd�|�|�D�}|r^|D]}||kr>|�|�|��q>q|tkr|�|�|��q|S)z!find the children of a given noder)rQcSsg|]}|tkr|�qSr)r)rF�prrrrrW>rOz&changelog.children.<locals>.<listcomp>)r,rSr;rZr.r)rr.rx�pr-Zprevsr�rrr�children9s
zchangelog.childrencCst�|j||||�Sr)r
Z_reachablerootspurer;)rZminrootr��roots�includepathrrr�reachablerootsGs�zchangelog.reachablerootscCs"|�|�|�|�}}|�||�Sr)r,�
isancestorrev�r�a�brrr�
isancestorMszchangelog.isancestorcCs>|tkrdS||krdS||kr$dSt|j||g|gdd��S)NTF)r�)r�boolr�r�rrrr�Rszchangelog.isancestorrevcCs�|�|�}t�|�}|tjkr*|j|}nttfSt}}|jr�|�|jdjj	�}t
|j�dkrlt�d��t
|j�dkr�|�|jdjj	�}||fS)Nr�sTODO octopus merge handlingr)
r.rr'rprr�parentsr,r[�rawr:rZAbort)rr,r*rwrx�p1�p2rrrr;[s



zchangelog.parentrevscs4��|���|�}}�fdd�t��j||�D�S)Ncsg|]}��|��qSrr�r�r"rrrWrs�z2changelog.commonancestorsheads.<locals>.<listcomp>)r,r�commonancestorsheadsr;r�rr"rr�ns
�zchangelog.commonancestorsheadscCsdS)zAGit doesn't do named branches, so just put everything on default.)reFrr>rrr�
branchinfowszchangelog.branchinfocCsdSrr)r�trrrr�delayupdate{szchangelog.delayupdatec	Cs�g}t�|�t�|�}}|tjkr.|�|�|rF|tjkrF|�|�|dusRJ�|\}}t�t�t	�
|��t�t	�|��t|�t|d��}|j
�d|||t�|�|�}|j
jjd|dd�t�|j
|j�|jS)Nrhzrefs/hg/internal/latest-commitT)�force)rr'rr&rZ�pygit2Z	SignaturerZunifromlocalrZpersonrsrrZ
create_commitZ
referencesZcreaterZ_index_reporr�)rr
rkZdesc�transactionr�r�rirjrfZp1copiesZp2copiesZ
filesaddedrlr�Zhp1Zhp2Z	timestampZtzZsigZoidrrr�add�s,


���z
changelog.add)rN)r)N)rF)N)NN)F)NNNNNN) r1r2r3Z_copiesstorager?rB�propertyrDrrIrKrSrPr\r]r`rdryr~rr�r�r�r�r�r�r;Z_uncheckedparentrevsr�r�r�r�rrrrr	hsJ



	

,



		�r	c@s eZdZeZdd�Zdd�ZdS)�manifestlogcCs|�d|�S�NrO)�get�rr.rrrr=�szmanifestlog.__getitem__cCsf|tjkrt�||�S|jt�|�}|j}|rX|�d�}|D]}||}|j|j	}q>t
�|j|�S)N�/)rr&r
Zmemtreemanifestctxrrr'Ztree�splitr[�gitmanifestZgittreemanifestctx)r�relpathr.�commitr+�partsr��terrrr��s

zmanifestlog.getN)r1r2r3rZ
nodeconstantsr=r�rrrrr��sr�csneZdZ�fdd�Zdd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
�ZS)�filelogcs2tt|��||�t|t�s J�||_tj|_dSr)�superr�rrn�bytes�pathrr&)rrrr���	__class__rrr�szfilelog.__init__cCs |tjkrdS|jt�|�jSr�)rr&rrr'�datar�rrr�read�s
zfilelog.readcCsnt|�dvrt|�}t|t�r*ds*Jd��t|�dkr>t|�}t�|�}||jvrV|St�|j	|t
d���dS)N)��(Fstodo revnums for nodesr�sno match found)r:rrnrrr'rrr(r�r)rr.Zhnoderrr�lookup�s


zfilelog.lookupcCs|�|�|kS)z9Returns True if text is different than content at `node`.)r�)rr.�textrrr�cmp�szfilelog.cmpNcCs|rJ�|j�|�jSr)rZcreate_blobr�)rr��metar��linkr�r�rrrr��szfilelog.addccs0|j�dt�|j�tjf�D]}|dVqdS)Nz�
SELECT rev FROM changelog
INNER JOIN changedfiles ON changelog.node = changedfiles.node
WHERE changedfiles.filename = ? AND changedfiles.filenode != ?
        r)rr r�fsdecoder�rrp)rZclrevrrrrB�s
�zfilelog.__iter__cCs|Srr)r�frrrr�linkrev�szfilelog.linkrevcCsL|j�dt�|j�t�|�f���}|dur@t�	|j|t
d���t|d�S)Nz�
SELECT rev FROM changelog
INNER JOIN changedfiles ON changelog.node = changedfiles.node
WHERE changedfiles.filename = ? AND changedfiles.filenode = ?sno such noder)rr rr�r�rr'r!rr(rr)rr.�rowrrrr,�s�zfilelog.revcCsD|j�d|t�|j�f���}|dur8td|j|f��t|d�S)Nz�SELECT filenode FROM changedfiles
INNER JOIN changelog ON changelog.node = changedfiles.node
WHERE changelog.rev = ? AND filename = ?
zgitlog %r out of range %dr)rr rr�r�r!r}r)rr,�mayberrrr.�s�zfilelog.nodecCs�t�|�}t�|j�}g}|j�d||f���D]h}|dur�|j�d||f���d}tjrf|�	d�}t
�|j|j|||�|�
|�S|�t|��q0|S)NzTSELECT p1filenode, p2filenode FROM changedfiles
WHERE filenode = ? AND filename = ?
zASELECT node FROM changedfiles WHERE filenode = ? AND filename = ?r�ascii)rr'rr�r�rr r!Zispy3�decoderZfill_in_filelogrr�rZr)rr.ZgnZgpZpsr�r�rrrr�	s(
���
zfilelog.parentscCsdS)NFrr�rrr�renamed#szfilelog.renamed)NN)r1r2r3rr�r�r�r�rBr�r,r.r�r��
__classcell__rrr�rr��s
r�N)%Z
__future__rZmercurial.i18nrZmercurial.noderrrrZ	mercurialrr	ror
rrr
rZmercurial.interfacesrrZ
interfaceutilZmercurial.utilsr�rrr�Z
get_pygit2r��objectrr5r�ZimplementerZifilestorager�rrrr�<module>s$	(H


Youez - 2016 - github.com/yon3zu
LinuXploit