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 : |
a �+�b}- � @ s� d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl m Z mZmZ ddl mZ e�� ZdZde Zd d � ZdZer�ejejB ejB ZdZd 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 c C s~ t �t�| ��}t|_|�d��� d }|dkrXt� d�D ]}|�|� � � q:|�� n|tkrbnt �td���|�d� |S )NzPRAGMA user_versionr �;s( sqlite database has unrecognized versionzPRAGMA journal_mode=WAL)�sqlite3Zconnectr Zstrfromlocal�bytesZtext_factory�execute�fetchone�_SCHEMA�split�strip�commit�_CURRENT_SCHEMA_VERSIONr ZAbortr )�path�db�resZ statement� r �5/usr/lib64/python3.9/site-packages/hgext/git/index.py� _createdbM s r r i c C s� t |t�sJ dt|� ��t |t�s4J dt|� ��dd� | �d||f�D �}|�|t�}|D ]}|jj|v r^|jj S q^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 %rc S s h | ]}|d � d��qS )r �ascii)�decode)�.0�rowr r r � <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_optionsZinner_walker�wr r r �'_find_nearest_ancestor_introducing_nodes s( �����r* c C s� t |t�sJ dt|� ��t |t�s4J dt|� ��t�||fg�}|�r�|�� \}}| | }g } |jD ]n} | j}|�d�D ]0}z| || j }W q| t y� Y qhY q|0 q|t|| || j |j j�} | � | |j jf� 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 NULLr N� r s'