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 :  /usr/lib64/python3.9/site-packages/hgext/git/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

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

�+�b}-�@s�ddlmZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZddl
mZe��ZdZdeZd	d
�ZdZer�ejejBejBZdZd
d�Zdd�Zdd�dd�fdd�Zdd�dd�fdd�ZdS)�)�absolute_importN)�_)�sha1nodeconstants)�encoding�error�pycompat�)�gitutila�
CREATE TABLE refs (
  -- node and name are unique together. There may be more than one name for
  -- a given node, and there may be no name at all for a given node (in the
  -- case of an anonymous hg head).
  node TEXT NOT NULL,
  name TEXT
);

-- The "possible heads" of the repository, which we use to figure out
-- if we need to re-walk the changelog.
CREATE TABLE possible_heads (
  node TEXT NOT NULL
);

-- The topological heads of the changelog, which hg depends on.
CREATE TABLE heads (
  node TEXT NOT NULL
);

-- A total ordering of the changelog
CREATE TABLE changelog (
  rev INTEGER NOT NULL PRIMARY KEY,
  node TEXT NOT NULL,
  p1 TEXT,
  p2 TEXT
);

CREATE UNIQUE INDEX changelog_node_idx ON changelog(node);
CREATE UNIQUE INDEX changelog_node_rev_idx ON changelog(rev, node);

-- Changed files for each commit, which lets us dynamically build
-- filelogs.
CREATE TABLE changedfiles (
  node TEXT NOT NULL,
  filename TEXT NOT NULL,
  -- 40 zeroes for deletions
  filenode TEXT NOT NULL,
-- to handle filelog parentage:
  p1node TEXT,
  p1filenode TEXT,
  p2node TEXT,
  p2filenode TEXT
);

CREATE INDEX changedfiles_nodes_idx
  ON changedfiles(node);

PRAGMA user_version=%d
cCs~t�t�|��}t|_|�d���d}|dkrXt�	d�D]}|�|�
��q:|��n|tkrbnt
�td���|�d�|S)NzPRAGMA user_versionr�;s(sqlite database has unrecognized versionzPRAGMA journal_mode=WAL)�sqlite3ZconnectrZstrfromlocal�bytesZtext_factory�execute�fetchone�_SCHEMA�split�strip�commit�_CURRENT_SCHEMA_VERSIONrZAbortr)�path�db�resZ	statement�r�5/usr/lib64/python3.9/site-packages/hgext/git/index.py�	_createdbMs

rri cCs�t|t�sJdt|���t|t�s4Jdt|���dd�|�d||f�D�}|�|t�}|D]}|jj|vr^|jjSq^t�	d|||f��dS)a�Find the nearest ancestor that introduces a file node.

    Args:
      db: a handle to our sqlite database.
      gitrepo: A pygit2.Repository instance.
      file_path: the path of a file in the repo
      walk_start: a pygit2.Oid that is a commit where we should start walking
                  for our nearest ancestor.

    Returns:
      A hexlified SHA that is the commit ID of the next-nearest parent.
    zfile_path must be str, got %rzfilenode must be str, got %rcSsh|]}|d�d��qS)r�ascii)�decode)�.0�rowrrr�	<setcomp>�s�z:_find_nearest_ancestor_introducing_node.<locals>.<setcomp>zASELECT node FROM changedfiles WHERE filename = ? AND filenode = ?z8Unable to find introducing commit for %s node %s from %sN)
�
isinstance�str�typer
�walk�
_OUR_ORDER�id�hexr�ProgrammingError)r�gitrepoZ	file_pathZ
walk_start�filenodeZparent_optionsZinner_walker�wrrr�'_find_nearest_ancestor_introducing_nodess(�����r*c
Cs�t|t�sJdt|���t|t�s4Jdt|���t�||fg�}|�r�|��\}}||}g}	|jD]n}
|
j}|�d�D]0}z|||j	}Wq|t
y�YqhYq|0q|t||||
j	|j	j�}
|	�
|
|j	jf�qhtj}}}}|	D]J\}}t|�d|||f���d�}|dkr�|du�s*J�|�
||f�q�|	�rL|	d\}}t|	�dk�rf|	d\}}t|	�dk�r~t�d	��|�d
|||||j	j||f�qD|��dS)a�Given a starting commit and path, fill in a filelog's parent pointers.

    Args:
      gitrepo: a pygit2.Repository
      db: a handle to our sqlite database
      startcommit: a hexlified node id for the commit to start at
      path: the path of the file whose parent pointers we should fill in.
      filenode: the hexlified node id of the file at startcommit

    TODO: make filenode optional
    zstartcommit must be str, got %rz!startfilenode must be str, got %r�/zfSELECT COUNT(*) FROM changedfiles WHERE node = ? AND filename = ? AND filenode = ? AND p1node NOT NULLrN�rs'git support can't handle octopus mergeszUPDATE changedfiles SET p1node = ?, p1filenode = ?, p2node = ?, p2filenode = ? WHERE node = ? AND filename = ? AND filenode = ?)rr r!�collections�deque�popleft�parents�treerr$�KeyErrorr*r%�appendr	�nullgit�intr
r�lenrr&r)r'rZstartcommitrZ
startfilenodeZvisitZcnoder(rr0�parent�t�compZ
introducerZp1nodeZp1fnodeZp2nodeZp2fnodeZparZparfnode�foundrrr�fill_in_filelog�sh�
��
�
������r;cCsdS�Nr��xrrr�<lambda>��r?cOsdSr<r��args�kwargsrrrr?�r@cCs|��}t�}|d�}t|�D]~\}}|dur8|�|�|�d�sb|�d�sb|�d�sb|�d�sbqz|�|��tj�}	Wnt	y�YqYn0|�
|	j�qdd�|�d�D�}
d}d	d�|D�}||
kr�dS|d
�|D]$}	|dur�|�
|	t�}q�|�|	�q�|�d�|du�r|��|d�}t|�D�]T\}}
|du�rL|�|�tj}}t|
j�d
k�rzt�dt|
j���|
j�r�|
jdjj}t|
j�d
k�r�|
jdjj}|�d||
jj||f�|�d|
jjf���d}|�s.i}|
j�r|
jdjjnd}|du�r$|j||
jjtd�}n|
jjdtd�}dd�|D�}dd�|D�}|��D](\}}|�d|
jj||ddddf��qX�q.|�d�|�d�|D]F}|j}|�d|f�|�d||f���d}|�s�|�d|f��q�|��|du�r|��dS) Nsrefszrefs/heads/z
refs/tags/z
refs/remotes/zrefs/hg/cSsh|]}t�|d��qS)r)rZsysstr)rr>rrrr�s�z_index_repo.<locals>.<setcomp>zSELECT node FROM possible_headscSsh|]
}|j�qSr)r%)r�hrrrrr@s$heads mismatch, rebuilding dagcache
zDELETE FROM changelogscommitsr,sJgit support can't handle octopus merges, found a commit with %d parents :(rrz<INSERT INTO changelog (rev, node, p1, p2) VALUES(?, ?, ?, ?)z0SELECT COUNT(*) from changedfiles WHERE node = ?)�flagsT)ZswaprEcss|]}|jjVqdSr<)ZdeltaZnew_file)r�prrr�	<genexpr><r@z_index_repo.<locals>.<genexpr>cSs&i|]}|jjtjkr|j|jj�qSr)r$�rawrZnullidrr%)rZnfrrr�
<dictcomp>=s�z_index_repo.<locals>.<dictcomp>zwINSERT INTO changedfiles (node, filename, filenode, p1node, p1filenode, p2node, p2filenode) VALUES(?, ?, ?, ?, ?, ?, ?)zDELETE FROM headszDELETE FROM possible_headsz+INSERT INTO possible_heads (node) VALUES(?)z5SELECT COUNT(*) FROM changelog WHERE p1 = ? OR p2 = ?z"INSERT INTO heads (node) VALUES(?))Zlistall_references�set�	enumerate�update�
startswithZlookup_referenceZpeel�pygit2ZGIT_OBJ_COMMIT�
ValueError�addr$r
r"r#�pushZcompleter	r4r6r0rr&r%r�diff�_DIFF_FLAGSr1Zdiff_to_tree�itemsr)r'r�logfn�progress_factoryZall_refsZpossible_heads�prog�pos�ref�startZcache_headsZwalkerZcur_cache_headsrZp1Zp2Znum_changedfiles�filesZpatchgenZ	new_filesrF�nZhidrDZhaschildrrr�_index_repo�s�
����
	�




�����
���

��
r]cCsdSr<rr=rrrr?]r@cOsdSr<rrArrrr?]r@cCsXtj�t�|j�ddd�}tj�|�s0t�|�tj�|d�}t|�}t||||�|S)Ns..s.hgscachesgit-commits.sqlite)	�osr�joinr�fsencode�exists�makedirsrr])r'rUrVZ	cachepathZdbpathrrrr�	get_index\s�
rc)Z
__future__rr-r^rZmercurial.i18nrZmercurial.noderZ	mercurialrrr�r	Z
get_pygit2rNrrrr#ZGIT_SORT_TOPOLOGICALZ
GIT_SORT_TIMEZGIT_SORT_REVERSErSr*r;r]rcrrrr�<module>s>2��7���'D�
�

Youez - 2016 - github.com/yon3zu
LinuXploit