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/__pycache__/ |
Upload File : |
a �+�b�� � @ sl d Z ddlmZ ddlZddlZddlZddlZddlmZ ddl m Z mZmZ ddl mZ ddlmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZmZ dd lm Z m!Z! zdd lm"Z" e"j# W n e$y� dZ"Y n0 i Z%e�&e%�Z&e&dde"r�d nddd� dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dddddd d!d"e- gZ4dGd#d$�Z5d%d&� Z6G d'd(� d(ej7�Z8ej9G d)d*� d*e:��Z;e�<ej=�ej9dd+�G d,d-� d-e:���Z>e�<ej?�ej9dd.�G d/d0� d0e:���Z@e�<ejA�G d1d2� d2e:��ZBG d3d4� d4ejC�ZDd5d6� ZEd7d8� ZFd9d:� ZGe�<ejH�G d;d<� d<e:��ZId=d>� ZJd?d@� ZKdAdB� ZLdCdD� ZMdEdF� ZNdS )Ham store repository data in SQLite (EXPERIMENTAL) The sqlitestore extension enables the storage of repository data in SQLite. This extension is HIGHLY EXPERIMENTAL. There are NO BACKWARDS COMPATIBILITY GUARANTEES. This means that repositories created with this extension may only be usable with the exact version of this extension/Mercurial that was used. The extension attempts to enforce this in order to prevent repository corruption. In addition, several features are not yet supported or have known bugs: * Only some data is stored in SQLite. Changeset, manifest, and other repository data is not yet stored in SQLite. * Transactions are not robust. If the process is aborted at the right time during transaction close/rollback, the repository could be in an inconsistent state. This problem will diminish once all repository data is tracked by SQLite. * Bundle repositories do not work (the ability to use e.g. `hg -R <bundle-file> log` to automatically overlay a bundle on top of the existing repository). * Various other features don't work. This extension should work for basic clone/pull, update, and commit workflows. Some history rewriting operations may fail due to lack of support for bundle repositories. To use, activate the extension and set the ``storage.new-repo-backend`` config option to ``sqlite`` to enable new repositories to use SQLite for storage. � )�absolute_importN��_)�nullrev�sha1nodeconstants�short)�attr)�ancestor�dagop�encoding�error� extensions� localrepo�mdiff�pycompat� registrar�requirements�util�verify)� repositoryr )�hashutil�storageutil)�zstd� storage� sqlite.compression� zstd� zlibT)�defaultZexperimentals ships-with-hg-cores exp-sqlite-001s exp-sqlite-comp-001=zstds exp-sqlite-comp-001=zlibs exp-sqlite-comp-001=nones exp-sqlite-shallow-files� � � � z�CREATE TABLE delta ( id INTEGER PRIMARY KEY, compression INTEGER NOT NULL, hash BLOB UNIQUE ON CONFLICT ABORT, delta BLOB NOT NULL )zKCREATE TABLE filepath ( id INTEGER PRIMARY KEY, path BLOB NOT NULL )z4CREATE UNIQUE INDEX filepath_path ON filepath (path)ac CREATE TABLE fileindex ( id INTEGER PRIMARY KEY, pathid INTEGER REFERENCES filepath(id), revnum INTEGER NOT NULL, p1rev INTEGER NOT NULL, p2rev INTEGER NOT NULL, linkrev INTEGER NOT NULL, flags INTEGER NOT NULL, deltaid INTEGER REFERENCES delta(id), deltabaseid INTEGER REFERENCES fileindex(id), node BLOB NOT NULL )zJCREATE UNIQUE INDEX fileindex_pathrevnum ON fileindex (pathid, revnum)zBCREATE UNIQUE INDEX fileindex_pathnode ON fileindex (pathid, node)a� CREATE VIEW filedata AS SELECT fileindex.id AS id, filepath.id AS pathid, filepath.path AS path, fileindex.revnum AS revnum, fileindex.node AS node, fileindex.p1rev AS p1rev, fileindex.p2rev AS p2rev, fileindex.linkrev AS linkrev, fileindex.flags AS flags, fileindex.deltaid AS deltaid, fileindex.deltabaseid AS deltabaseid FROM filepath, fileindex WHERE fileindex.pathid=filepath.idzPRAGMA user_version=%dc C s� | � djd�dgt|� �d�t||gt|�� � ��}g }d}|D ]Z\} } }| }| tkrf|�|�}n.| t krt|}n | t kr�t�|�}ntd| ��|� |� qD||v r�||| }n|�� }|�� t�||�} t| t�s�t|�} | S )z&Resolve a delta chain for a file node.a WITH RECURSIVE deltachain(deltaid, baseid) AS ( SELECT deltaid, deltabaseid FROM fileindex WHERE pathid=? AND node=? UNION ALL SELECT fileindex.deltaid, deltabaseid FROM fileindex, deltachain WHERE fileindex.id=deltachain.baseid AND deltachain.baseid IS NOT NULL AND fileindex.id NOT IN ({stops}) ) SELECT deltachain.baseid, compression, delta FROM deltachain, delta WHERE delta.id=deltachain.deltaid�,�?)ZstopsNs unhandled compression type: %d)�execute�format�join�len�tuple�list�keys�COMPRESSION_ZSTD� decompress�COMPRESSION_NONE�COMPRESSION_ZLIB�zlib�SQLiteStoreError�append�pop�reverser Zpatches� isinstance�bytes)�db�pathid�nodeZ revisioncache�stoprids�zstddctx�res�deltasZlastdeltabaseidZdeltabaseid�compression�deltaZbasetext�fulltext� r@ �7/usr/lib64/python3.9/site-packages/hgext/sqlitestore.py�resolvedeltachain� s8 ��� rB c C sF z| � d|||f�jW S tjy@ | � d|f��� d Y S 0 d S )Nz=INSERT INTO delta (compression, hash, delta) VALUES (?, ?, ?)z!SELECT id FROM delta WHERE hash=?r )r$ � lastrowid�sqlite3ZIntegrityError�fetchone)r6 r= �hashr>