403Webshell
Server IP : 50.21.180.56  /  Your IP : 216.73.216.139
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67922704 ( 67922704)
PHP Version : 8.5.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/proc/self/root/usr/lib/python3/dist-packages/breezy/git/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/proc/self/root/usr/lib/python3/dist-packages/breezy/git/__pycache__/cache.cpython-313.pyc
�

p��g�����SrSSKrSSKrSSKJrJrJr SSKJrJ	r	J
r
Jr SSKJr
 SSKJr SSKJr SS	KJr SS
KJrJrJr SrSr\R4"5rS
r"SS5r"SS5r"SS5r"SS5r "SS5r!Sr""SS\ 5r#"SS\5r$"SS\ 5r%Sr&"S S!\5r'"S"S#\5r("S$S%\ 5r)S&r*"S'S(\5r+"S)S*\5r,"S+S,\5r-"S-S.\ 5r."S/S0\!5r/"S1S2\5r0"S3S4\5r1\
Rd\3\4"5r4\4Rk\+"5Rm5\+"55 \4Rk\'"5Rm5\'"55 \4Rk\0"5Rm5\0"55 \4RkS5\0"55 S6r7S7r8S8r9g)9z%Map from Git sha's to Bazaar objects.�N)�ShaFile�
hex_to_sha�
sha_to_hex�)�bedding�osutils�registry�trace)�errors)�btree_index)�index)�
versionedfile)�
FileExists�
NoSuchFile�get_transport_from_pathc���[RR[R"5S5n[RRU5(d[R"U5 U$)N�git)�os�path�joinr�	cache_dir�isdir�mkdir)rs �2/usr/lib/python3/dist-packages/breezy/git/cache.py�
get_cache_dirr sB��
�7�7�<�<��)�)�+�U�3�D�
�7�7�=�=����
������K�c��[USS5nUc[5nOb[RR	[5U5n[RRU5(d[R"U5 [U5$)zORetrieve the transport to use when accessing (unwritable) remote
repositories.
�uuidN)�getattrrrrrrrr)�
repositoryrrs   r�get_remote_cache_transportr!'s]���:�v�t�,�D��|�����w�w�|�|�M�O�T�2���w�w�}�}�T�"�"��H�H�T�N�"�4�(�(rc�z�[R$![a 0[l[Rs$f=f)z-Get a cache for this thread's db connections.)�_mapdbs�cache�AttributeError�rr�mapdbsr'8s1����}�}�������
��}�}���s��%:�:c�T�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rg)�	GitShaMap�Az'Git<->Bzr revision id mapping database.c�,�[UR5e)z�Lookup a Git sha in the database.
:param sha: Git object sha
:return: list with (type, type_data) tuples with type_data:
    commit: revid, tree_sha, verifiers
    blob: fileid, revid
    tree: fileid, revid.
)�NotImplementedError�lookup_git_sha��self�shas  rr-�GitShaMap.lookup_git_shaDs��"�$�"5�"5�6�6rc�,�[UR5e)z�Retrieve a Git blob SHA by file id.

:param file_id: File id of the file/symlink
:param revision: revision in which the file was last changed.
)r,�lookup_blob_id�r/�file_id�revisions   rr3�GitShaMap.lookup_blob_idNs��"�$�"5�"5�6�6rc�,�[UR5e)z#Retrieve a Git tree SHA by file id.)r,�lookup_tree_idr4s   rr9�GitShaMap.lookup_tree_idVs��!�$�"5�"5�6�6rc�,�[UR5e)z0Retrieve a Git commit SHA by Bazaar revision id.)r,�
lookup_commit�r/�revids  rr<�GitShaMap.lookup_commitZs��!�$�"4�"4�5�5rc�,�[UR5e)�List the revision ids known.)r,�revids�r/s rrB�GitShaMap.revids^s��!�$�+�+�.�.rc�|�[UR55n[U[5(d[U5nX-
$)�5Return set of all the revisions that are not present.)�setrB�
isinstance)r/rB�present_revidss   r�missing_revisions�GitShaMap.missing_revisionsbs1���T�[�[�]�+���&�#�&�&���[�F��&�&rc�,�[UR5e)�List the SHA1s.)r,�sha1srCs rrN�GitShaMap.sha1sis��!�$�*�*�-�-rc��g�zStart writing changes.Nr&rCs r�start_write_group�GitShaMap.start_write_groupm��rc��g�zCommit any pending changes.Nr&rCs r�commit_write_group�GitShaMap.commit_write_groupprTrc��g�zAbort any pending changes.Nr&rCs r�abort_write_group�GitShaMap.abort_write_groupsrTrr&N)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r-r3r9r<rBrJrNrRrWr[�__static_attributes__r&rrr)r)As7��1�7�7�7�6�/�'�.�%�*�)rr)c�*�\rSrSrSrSrSrSrSrg)�ContentCache�wz"Object that can cache Git objects.c�,�[UR5e)zAdd an object.)r,�add)r/�objects  rrg�ContentCache.addzs��!�$�(�(�+�+rc�8�UHnURU5 M g)zAdd multiple objects.N)rg)r/�objects�objs   r�	add_multi�ContentCache.add_multi~s���C��H�H�S�M�rc�,�[UR5e)zRetrieve an item, by SHA.)r,�__getitem__r.s  rrp�ContentCache.__getitem__�s��!�$�"2�"2�3�3rr&N)	r]r^r_r`rargrmrprbr&rrrdrdws��,�,��
4rrdc�J�\rSrSrSrSrSrSr\S5r	\S5r
Srg	)
�BzrGitCacheFormat�zBazaar-Git Cache Format.c�,�[UR5e)z@Return a single-line unique format string for this cache format.)r,�get_format_stringrCs rrv�#BzrGitCacheFormat.get_format_string�s��!�$�"8�"8�9�9rc�,�[UR5e)z Open this format on a transport.)r,�open�r/�	transports  rry�BzrGitCacheFormat.open�s��!�$�)�)�,�,rc�D�URSUR55 g)z8Create a new instance of this cache format at transport.�formatN)�	put_bytesrvrzs  r�
initialize�BzrGitCacheFormat.initialize�s�����H�d�&<�&<�&>�?rc���URS5n[RU5nURU5$![a) [RS5nUR	U5 NCf=f)z�Open a cache file present on a transport, or initialize one.

:param transport: Transport to use
:return: A BzrGitCache instance
r~�default)�	get_bytes�formats�getrr�ry)r/r{�format_namer~s    r�from_transport� BzrGitCacheFormat.from_transport�sc��	)�#�-�-�h�7�K��[�[��-�F��{�{�9�%�%���	)��[�[��+�F����i�(�	)�s�&9�0A,�+A,c�H�SSKJn [USS5nUb@[X25(a0[	U5nURS5 URS5nOSnUc[U5nURU5$![a N?f=f![Ra SnNGf=f)aOpen a cache file for a repository.

This will use the repository's transport to store the cache file, or
use the users global cache directory if the repository has no
transport associated with it.

:param repository: Repository to open the cache for
:return: A `BzrGitCache`
r)�LocalTransport�
_transportNr)�transport.localr�rrH�#remove_readonly_transport_decoratorrr�clone�
bzr_errors�
ReadOnlyErrorr!r�)�clsr r��repo_transportr{s     r�from_repository�!BzrGitCacheFormat.from_repository�s���	5� ��\�4�@���%�*�^�*T�*T�	
8�!D�^�!T���"�(�(��/�+�0�0��7�	��I���2�:�>�I��!�!�)�,�,��"������+�+�
!� �	�
!�s"�B�A8�8
B�B�B!� B!r&N)r]r^r_r`rarvryr��classmethodr�r�rbr&rrrsrs�s=��"�:�-�@��&��&��-��-rrsc�$�\rSrSrSrSrSrSrg)�CacheUpdater��z7Base class for objects that can update a bzr-git cache.c�,�[UR5e)z�Add an object.

:param obj: Object type ("commit", "blob" or "tree")
:param bzr_key_data: bzr key store data or testament_sha in case
    of commit
:param path: Path of the object (optional)
)r,�
add_object)r/rl�bzr_key_datars    rr��CacheUpdater.add_object�s��"�$�/�/�2�2rc�,�[UR5e�N)r,�finishrCs rr��CacheUpdater.finish�s��!�$�+�+�.�.rr&N)r]r^r_r`rar�r�rbr&rrr�r��s��A�3�/rr�c�$�\rSrSrSrSrSrSrg)�BzrGitCache��zCaching backend.c��XlX lgr�)�idmap�_cache_updater_klass)r/r��cache_updater_klasss   r�__init__�BzrGitCache.__init__�s
���
�$7�!rc�$�URX5$)zUUpdate an object that implements the CacheUpdater interface for
updating this cache.
)r�)r/�revs  r�get_updater�BzrGitCache.get_updater�s���(�(��3�3r)r�r�N)r]r^r_r`rar�r�rbr&rrr�r��s���8�4rr�c�2�[[5[5$r�)r��
DictGitShaMap�DictCacheUpdaterr&rr�DictBzrGitCacher��s���}��(8�9�9rc�*�\rSrSrSrSrSrSrSrg)r���z$Cache updater for dict-based caches.c�p�XlURUlURUlSUl/Ulgr��r$�revision_idr>�
parent_ids�
parent_revids�_commit�_entries�r/r$r�s   rr��DictCacheUpdater.__init__��,���
��_�_��
� �^�^��������
rc���[U[5(aUupEO'URRS5nURn[U[
5(d[
U5eUS:XaXl[U5[La[
U5eURnURURRU4nXPRRRUR'OLUS;a@Ub<U=pgUURRRR!US05US'O["eUW4nX�RRR$R!U05W'g)N�ascii�commit)�blob�tree�r)rH�tuple�	type_name�decode�id�bytes�	TypeErrorr��type�dictr>r�r$r��	_by_revid�
_by_fileid�
setdefault�AssertionError�_by_sha)	r/rlr�rr��hexsha�key�	type_data�entrys	         rr��DictCacheUpdater.add_object�s8���c�5�!�!�"%��Y���
�
�,�,�W�5�I��V�V�F��&�%�(�(��F�#�#��� ��L��L�!��-���-�-��*�*�C����T�\�\�%6�%6��E�I�5;�J�J���&�&�t�z�z�2�
�*�
*��'�".�.����
�
� � �+�+�6�6�y��|�R�H��a�L���!� ��I�&��?D�
�
��� � �+�+�F�B�7��<rc�J�URc[S5eUR$�N�No commit object added�r�r�rCs rr��DictCacheUpdater.finish�"���<�<�� �!9�:�:��|�|�r�r�r�r$r�r>N�	r]r^r_r`rar�r�r�rbr&rrr�r��s��.��E�4rr�c�B�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rg)r�iz#Git SHA map that uses a dictionary.c�.�0Ul0Ul0Ulgr�)r�r�r�rCs rr��DictGitShaMap.__init__s����������rc�&�URUU$r��r��r/�fileidr6s   rr3�DictGitShaMap.lookup_blob_id������x�(��0�0rc#�# �[U[5(d[U5eURUR	5Shv�N gN7fr�)rHr�r�r��valuesr.s  rr-�DictGitShaMap.lookup_git_sha s7����#�u�%�%��C�.� ��<�<��$�+�+�-�-�-�s�AA�A	�Ac�&�URUU$r�r�r�s   rr9�DictGitShaMap.lookup_tree_id%r�rc� �URU$r�)r�r=s  rr<�DictGitShaMap.lookup_commit(s���~�~�e�$�$rc#�# �URR5H-upUR5Hup4US:XdM
USv� M M/ g7f)Nr�r)r��itemsr�)r/�_key�entriesr�r�s     rrB�DictGitShaMap.revids+sC���!�\�\�/�/�1�M�D�#*�>�>�#3����8�#�#�A�,�&�$4�2�s
�9A�Ac�6�URR5$r�)r��keysrCs rrN�DictGitShaMap.sha1s1s���|�|� � �"�"r)r�r�r�N)
r]r^r_r`rar�r3r-r9r<rBrNrbr&rrr�r�s(��-��
1�.�
1�%�'�#rr�c�&�\rSrSrSrSrSrSrg)�SqliteCacheUpdateri5c��XlURRRUlURUlSUl/Ul/Ulgr�)r$r��dbr�r>r��_trees�_blobsr�s   rr��SqliteCacheUpdater.__init__6s>���
��*�*�"�"�%�%����_�_��
���������rc��[U[5(aUupEO'URRS5nURn[U[
5(d[
U5eUS:Xa:Xl[U5[La[
U5eURS5UlgUS:Xa(Ub$URRXRSUS45 ggUS:Xa(Ub$URRXRSUS45 gg[e)Nr�r��testament3-sha1r�rr�r�)rHr�r�r�r�r�r�r�r�r�r��_testament3_sha1r��appendr�r��r/rlr�rr�r�s      rr��SqliteCacheUpdater.add_object>s����c�5�!�!�"%��Y���
�
�,�,�W�5�I��V�V�F��&�%�(�(��F�#�#��� ��L��L�!��-���-�-�$0�$4�$4�5F�$G�D�!�
�&�
 ��'����"�"�F��O�\�!�_�#M�N�(�
�&�
 ��'����"�"�F��O�\�!�_�#M�N�(�!� rc��URc[S5eURRSUR5 URRSUR
5 URR
SURRURURRUR45 UR$)Nr�z9replace into trees (sha1, fileid, revid) values (?, ?, ?)z9replace into blobs (sha1, fileid, revid) values (?, ?, ?)zQreplace into commits (sha1, revid, tree_sha, testament3_sha1) values (?, ?, ?, ?))r�r�r��executemanyr�r��executer�r>r�rrCs rr��SqliteCacheUpdater.finishTs����<�<�� �!9�:�:������G����	
�	
�����G����	
�	
�����
"�
�\�\�_�_�d�j�j�$�,�,�*;�*;�T�=R�=R�S�	
�
�|�|�r)r�r�rr�r$r�r>N�r]r^r_r`r�r�r�rbr&rrr�r�5s���!�,rr�c�4�[[U5[5$r�)r��SqliteGitShaMapr���ps r�SqliteBzrGitCacher
es����q�)�+=�>�>rc� �\rSrSrSrSrSrg)�SqliteGitCacheFormatiic��g)Ns'bzr-git sha map version 1 using sqlite
r&rCs rrv�&SqliteGitCacheFormat.get_format_stringjs��:rc��URS5n[	[
RRUS55$![Ra
 [5nNIf=f)N�.zidmap.db)�
local_abspathr��NotLocalUrlrr
rrr�r/r{�basepaths   rry�SqliteGitCacheFormat.openmsQ��	'� �.�.�s�3�H�!������h�
�!C�D�D���%�%�	'�$��H�	'�s�<�A�Ar&N)r]r^r_r`rvryrbr&rrrris
��;�Errc�R�\rSrSrSrSSjrSrSrSrSr	S	r
S
rSrSr
S
rg)r
iuz;Bazaar GIT Sha map that uses a sqlite database for storage.Nc��SSKnXlUcURS5UlO<U[	5;aURU5[	5U'[	5UUl[
URlURRS5 URRS5 g!URa gf=f)Nrz:memory:a
        create table if not exists commits(
            sha1 text not null check(length(sha1) == 40),
            revid text not null,
            tree_sha text not null check(length(tree_sha) == 40)
        );
        create index if not exists commit_sha1 on commits(sha1);
        create unique index if not exists commit_revid on commits(revid);
        create table if not exists blobs(
            sha1 text not null check(length(sha1) == 40),
            fileid text not null,
            revid text not null
        );
        create index if not exists blobs_sha1 on blobs(sha1);
        create unique index if not exists blobs_fileid_revid on blobs(
            fileid, revid);
        create table if not exists trees(
            sha1 text unique not null check(length(sha1) == 40),
            fileid text not null,
            revid text not null
        );
        create unique index if not exists trees_sha1 on trees(sha1);
        create unique index if not exists trees_fileid_revid on trees(
            fileid, revid);
z-ALTER TABLE commits ADD testament3_sha1 TEXT;)	�sqlite3r�connectr�r'�str�text_factory�
executescript�OperationalError)r/rrs   rr��SqliteGitShaMap.__init__xs�����	��<��o�o�j�1�D�G��6�8�#�!(����!6������h�t�n�D�G�"�����������	�2	��G�G�!�!�"Q�R���'�'�	��	�s�B.�.C�Cc�b�SRURRUR5$�N�{}({!r})�r~�	__class__r]rrCs r�__repr__�SqliteGitShaMap.__repr__��#��� � ����!8�!8�$�)�)�D�Drc�x�URRSU45nUR5nUbUS$[e)Nz(select sha1 from commits where revid = ?r�r�r�fetchone�KeyError)r/r>�cursor�rows    rr<�SqliteGitShaMap.lookup_commit�s8�������!K�e�X�V���o�o����?��q�6�M��rc�8�URR5 gr�)r�r�rCs rrW�"SqliteGitShaMap.commit_write_group�s�������rc�~�URRSX45R5nUbUS$[U5e)Nz5select sha1 from blobs where fileid = ? and revid = ?rr+�r/r�r6r/s    rr3�SqliteGitShaMap.lookup_blob_id��A���g�g�o�o�C�f�EW�
�
�(�*�	��?��q�6�M��v��rc�~�URRSX45R5nUbUS$[U5e)Nz5select sha1 from trees where fileid = ? and revid = ?rr+r4s    rr9�SqliteGitShaMap.lookup_tree_id�r6rc#��# �SnURRSU45nUR5H$nSnUSbSUS0nO0nSUSUS	U44v� M& URRS
U45nUR5HnSnSU4v� M
 URRSU45nUR5HnSnS
U4v� M
 U(d[U5eg7f)z�Lookup a Git sha in the database.

:param sha: Git object sha
:return: (type, type_data) with type_data:
    commit: revid, tree sha, verifiers
    tree: fileid, revid
    blob: fileid, revid
FzCselect revid, tree_sha, testament3_sha1 from commits where sha1 = ?TrNr�r�rr�z.select fileid, revid from blobs where sha1 = ?r�z.select fileid, revid from trees where sha1 = ?r�)r�r�fetchallr-)r/r0�foundr.r/�	verifierss      rr-�SqliteGitShaMap.lookup_git_sha�s����������Q�
�F�
���?�?�$�C��E��1�v�!�.��A��7�	��	��c�!�f�c�!�f�i�8�9�9�
%������<�s�f�
���?�?�$�C��E��3�-��%������<�s�f�
���?�?�$�C��E��3�-��%���3�-���s�C#C%c�F�SURRS55$)rAc3�(# �UHuov� M
 g7fr�r&)�.0r/s  r�	<genexpr>�)SqliteGitShaMap.revids.<locals>.<genexpr>�s���O�"N����"N�s�zselect revid from commits)r�rrCs rrB�SqliteGitShaMap.revids�s��O�$�'�'�/�/�2M�"N�O�Orc#�# �SHInURRSRU55HunURS5v� M MK g7f)rM)�blobs�commits�treeszselect sha1 from {}r�N)r�rr~�encode)r/�tabler0s   rrN�SqliteGitShaMap.sha1s�sD���2�E��'�'�/�/�*?�*F�*F�u�*M�N����j�j��)�)�O�3�s�AA�r�rr�)r]r^r_r`rar�r'r<rWr3r9r-rBrNrbr&rrr
r
us6��E�'�RE�����" �HP�*rr
c�*�\rSrSrSrSrSrSrSrg)�TdbCacheUpdateri�z#Cache updater for tdb-based caches.c��XlURRUlURUlUR
UlSUl/Ulgr�)	r$r�r�r�r>r�r�r�r�r�s   rr��TdbCacheUpdater.__init__�s;���
��+�+�.�.����_�_��
� �^�^��������
rc���[U[5(aUupE[U5nO9URR	S5nUR5R
5nUS:Xa{SRXaR45URSUR-'[U5[La[U5eURUR4nXrS4-
nXlOFUS:Xa-UcgX`RSRSUSUS	45'UnOUS
:XaUcgUnO[ eSRUR#S54U-5S-nSU-n	URU	n
U
R%S5(d"S
RU
SU/5URU	'gS
RX�/5URU	'g![a N�f=f![a X�RU	'gf=f)Nr�r���commitr�r��blobrr�r��
�gitr)rHr�rr�r�r0�digestrr�r�r>r�r�r�r-r�r�rH�endswith)r/rlr�rr�r�r0r�r�r��oldvals           rr��TdbCacheUpdater.add_object�s����c�5�!�!�"%��Y��V�$�C��
�
�,�,�W�5�I��'�'�)�"�"�$�C��� �05�
�
�C���?�0K�D�G�G�K�$�*�*�,�-��L�!��-���-�-����S�X�X�.�I�
��+<�=�?�?�	��L�
�&�
 ��#��OR�G�G�E�J�J���a��,�q�/�J�K�L�$�I�
�&�
 ��#��$�I� � ��
�
�I�,�,�W�5�7�)�C�D�u�L����n��	9��W�W�S�\�F��?�?�5�)�)�"�x�x����(>�?������"�x�x���8�������1�
��
��$�	!� �G�G�C�L�	!�s$�F:�G
�:
G�G�
G%�$G%c�J�URc[S5eUR$r�r�rCs rr��TdbCacheUpdater.finish r�r)r�r�r$r�r�r>Nr�r&rrrMrM�s��-��&9�PrrMc�4�[[U5[5$r�)r��TdbGitShaMaprMrs r�TdbBzrGitCacher^&s���|�A���8�8rc�$�\rSrSrSrSrSrSrg)�TdbGitCacheFormati*z"Cache format for tdb-based caches.c��g)Ns$bzr-git sha map version 3 using tdb
r&rCs rrv�#TdbGitCacheFormat.get_format_string-s��7rc���URS5n[	[
RRUS55$![Ra
 [5nNJf=f![a [S5ef=f)Nrz	idmap.tdbzEUnable to open existing bzr-git cache because 'tdb' is not installed.)	rr�rrr^rrr�ImportErrorrs   rry�TdbGitCacheFormat.open0st��	'� �.�.�s�3�H�	�!�"�'�'�,�,�x��"E�F�F���%�%�	'�$��H�	'���	��W��
�	�s�=�(A!�A�A�!A7r&N)r]r^r_r`rarvryrbr&rrr`r`*s��,�8�
rr`c�l�\rSrSrSrSrSrSSjrSrSr	S	r
S
rSrSr
S
rSrSrSrSrSrg)r]i=z�SHA Map that uses a TDB database.

Entries:

"git <sha1>" -> "<type> <type-data1> <type-data2>"
"commit revid" -> "<sha1> <tree-id>"
"tree fileid revid" -> "<sha1>"
"blob fileid revid" -> "<sha1>"
�iP�Nc�4�SSKnXlUc0UlOqU[5;aQUR	XR
UR[R[R-5[5U'[5UUl[URS5S;aI[R"SURSUR5 URR5 SUR-URS'g![a N)f=f)Nrsversion)rrgz8SHA Map is incompatible (%s -> %d), rebuilding database.s%d)�tdbrr�r'�Tdb�
TDB_HASH_SIZE�DEFAULTr�O_RDWR�O_CREAT�intr
�warning�TDB_MAP_VERSION�clearr-)r/rris   rr��TdbGitShaMap.__init__Ks�����	��<��D�G��6�8�#�!$����,�,�c�k�k�2�9�9�r�z�z�;Q�"������h�t�n�D�G�		��4�7�7�:�&�'�v�5��
�
�N��G�G�J�'��(�(��
���
�
��$�d�&:�&:�:����
����	��	�s�A%D
�

D�Dc�8�URR5 grQ)r��transaction_startrCs rrR�TdbGitShaMap.start_write_groupcs�����!�!�#rc�8�URR5 grV)r��transaction_commitrCs rrW�TdbGitShaMap.commit_write_groupg������"�"�$rc�8�URR5 grZ)r��transaction_cancelrCs rr[�TdbGitShaMap.abort_write_groupkrzrc�b�SRURRUR5$r#r%rCs rr'�TdbGitShaMap.__repr__or)rc��[URSU-SS5$![a [SRU55ef=f)NrR�zNo cache entry for {!r})rr�r-r~r=s  rr<�TdbGitShaMap.lookup_commitrsP��	D��d�g�g�k�E�&9�:�3�B�?�@�@���	D��4�;�;�E�B�C�C�	D�s	� �%Ac�T�[URSRSX455$)NrQrS)rr�rr�s   rr3�TdbGitShaMap.lookup_blob_idxs$���$�'�'�%�*�*�g�v�-H�"I�J�K�Krc#�# �[U5S:Xa[U5nURSU-nUR5H�nUR	S5nUSRS5nUS:Xa4[U5S:XaXCSUS	044v� MMXCSUS	S
US044v� MbUS;aU[
USS54v� M|[S
RU55e g7f)z�Lookup a Git sha in the database.

:param sha: Git object sha
:return: (type, type_data) with type_data:
    commit: revid, tree sha
    blob: fileid, revid
    tree: fileid, revid
�(rUrQrr�r�rgr�rr�)r�r�Nzunknown type {!r})	�lenrr��
splitlines�splitr�r�r�r~)r/r0�value�datar�s     rr-�TdbGitShaMap.lookup_git_sha{s�����s�8�r�>��S�/�C�����3��'���$�$�&�D��:�:�e�$�D��Q����w�/�I��H�$��t�9��>�$�A�w��Q���&<�=�=�$�A�w��Q��:K�T�RS�W�9U�&V�W�W��.�.� �%��Q�R��/�2�2�$�%8�%?�%?�	�%J�K�K�'�s�CCc��[5nUH5nURRSU-5bM$URU5 M7 U$)NrR)rGr�r�rg)r/rB�retr>s    rrJ�TdbGitShaMap.missing_revisions�s=���e���E��w�w�{�{�;��.�/�7��������
rc�6�URR5$r�)r�r�rCs r�_keys�TdbGitShaMap._keys�s���w�w�|�|�~�rc#�x# �UR5H"nURS5(dMUSSv� M$ g7f)rArR�N)r��
startswith�r/r�s  rrB�TdbGitShaMap.revids�s/����:�:�<�C��~�~�k�*�*��!�"�g�
� �s�(:�:c#�# �UR5H+nURS5(dM[USS5v� M- g7f)rMrU�N)r�r�rr�s  rrN�TdbGitShaMap.sha1s�s5����:�:�<�C��~�~�h�'�'� ��Q�R��)�)� �s
�(A�ArKr�)r]r^r_r`rarqrkr�rRrWr[r'r<r3r-rJr�rBrNrbr&rrr]r]=sS����O��M�;�0$�%�%�E�D�L�L�2���*rr]c�&�\rSrSrSrSrSrSrg)�VersionedFilesContentCachei�c��Xlgr���_vf)r/�vfs  rr��#VersionedFilesContentCache.__init__�s���rc	��URR[R"UR4/SUR55/5 gr�)r��insert_record_streamr�ChunkedContentFactoryr��as_legacy_object_chunks)r/rls  rrg�VersionedFilesContentCache.add�s?�����%�%��3�3��V�V�I�r�4��)D�)D�)F��
�	
rc���URRU4/SS5n[U5nURS:Xa[	U5e[
R"URS55$)N�	unorderedT�absent�fulltext)r��get_record_stream�next�storage_kindr-r�_parse_legacy_object�get_bytes_as)r/r0�streamr�s    rrp�&VersionedFilesContentCache.__getitem__�s[�����+�+�c�V�H�k�4�H���V�������)��3�-���+�+�E�,>�,>�z�,J�K�Krr�N)r]r^r_r`r�rgrprbr&rrr�r��s���
�Lrr�c�&�\rSrSrSrSrSrSrg)�IndexCacheUpdateri�c�p�XlURUlURUlSUl/Ulgr�r�r�s   rr��IndexCacheUpdater.__init__�r�rc��[U[5(aUupEO'URRS5nURnUS:Xa�Xl[
U5[La[U5eURRRUSURURU45 URRRSURS4SRXQR455 gUS:XaWURRRUSU5 URRRSUSUS	4U5 gUS
:Xa(URRRUSU5 g[ e)Nr�r��commit�X� r�rSrr�r�stree)rHr�r�r�r�r�r�r�r�r$r��_add_git_shar>r��	_add_noderr�rs      rr��IndexCacheUpdater.add_object�sA���c�5�!�!�"%��Y���
�
�,�,�W�5�I��V�V�F��� ��L��L�!��-���-�-��J�J���)�)��	�D�J�J����,�#G�
�
�J�J���&�&��D�J�J��-�t�y�y�&�(�(�9K�/L�
��&�
 ��J�J���)�)�&�'�<�H��J�J���&�&��,�q�/�<��?�;�V�
��&�
 ��J�J���)�)�&�'�<�H� � rc��UR$r�)r�rCs rr��IndexCacheUpdater.finish�s���|�|�rr�Nrr&rrr�r��s���!�4rr�c�,^�\rSrSrSU4SjjrSrU=r$)�IndexBzrGitCachei�c�b>�[URS55n[TU]
U[5 g)Nr
)�IndexGitShaMapr��superr�r�)r/r{�shamapr&s   �rr��IndexBzrGitCache.__init__�s&����	���� 8�9��
����!2�3rr&r�)r]r^r_r`r�rb�
__classcell__�r&s@rr�r��s
���4�4rr�c�4^�\rSrSrSrU4SjrSrSrU=r$)�IndexGitCacheFormati�c��g)Ns0bzr-git sha map with git object cache version 1
r&rCs rrv�%IndexGitCacheFormat.get_format_string�s��Crc�>�[TU]U5 URS5 URS5 SSKJn URUR
S55 g)Nr
rkr�)�TransportObjectStore)r�r�r�transportgitr��initr�)r/r{r�r&s   �rr��IndexGitCacheFormat.initialize�sB���
���9�%����� ����	�"�6��!�!�)�/�/�)�"<�=rc��[U5$r�)r�rzs  rry�IndexGitCacheFormat.open�s
���	�*�*rr&)	r]r^r_r`rvr�ryrbr�r�s@rr�r��s���D�>�+�+rr�c��\rSrSrSrSSjr\S5rSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrg)r�i�z�SHA Map that uses the Bazaar APIs to store a cache.

BTree Index file with the following contents:

("git", <sha1>, "X") -> "<type> <type-data1> <type-data2>"
("commit", <revid>, "X") -> "<sha1> <tree-id>"
("blob", <fileid>, <revid>) -> <sha1>

Nc��SUlUc3SUl[R"SSS9UlURUlgSUlXl[R"/5UlURRS5H{nURS5(dM[R"URX RRU5R5nURRSU5 M} g)Nrrg��key_elementsr�.rix)�_namer��
_mod_index�InMemoryGraphIndex�_index�_builder�CombinedGraphIndex�list_dirrW�_mod_btree_index�BTreeGraphIndex�stat�st_size�insert_index)r/r{�name�xs    rr��IndexGitShaMap.__init__s�����
���"�D�O�$�7�7���J�D�K� �K�K�D�M� �D�M�'�O�$�7�7��;�D�K����0�0��5���}�}�V�,�,��$�4�4��O�O�T�?�?�+?�+?��+E�+M�+M������(�(��A�.�
6rc���[USS5nUb)URS5 U"URS55$U"[	[555$![a N<f=f)Nr�r)rrrr�rr)r�r r{s   rr��IndexGitShaMap.from_repositorysd���J��d�;�	�� �
�����&��y���u�-�.�.��*�=�?�;�<�<���
��
�s�A�
A �A c���URb:SRURRURR5$SRURR5$)Nr$z{}())r�r~r&r]�baserCs rr'�IndexGitShaMap.__repr__$sL���?�?�&��$�$�T�^�^�%<�%<�d�o�o�>R�>R�S�S��=�=����!8�!8�9�9rc��URb[R"S5eUR5 URR	SUR
R
555 /nURRS5H,nURS5(dMURU5 M. UR5 UR
RSS2	UH!nURRX"S-5 M# g)N�builder already openc3�.# �UHupo2U4v� M
 g7fr�r&)r@�_r�r�s    rrA�(IndexGitShaMap.repack.<locals>.<genexpr>.s��� 
�0N�_�a�e�%�L�0N�s�rr�r�z.old)r�r��BzrErrorrR�	add_nodesr��iter_all_entriesr�r�rWrrW�indices�rename)r/�	to_remover�s   r�repack�IndexGitShaMap.repack*s����=�=�$��%�%�&<�=�=���� ��
�
��� 
�04���0L�0L�0N� 
�	
��	��O�O�,�,�S�1�D��}�}�V�$�$�� � ��&�2�	
���!��K�K�����#��D��O�O�"�"�4���7�rc��URb[R"S5e[R"SSS9Ul[
R"5Ulg)Nr�rrgr�)r�r�r�r��BTreeBuilderrr0r�rCs rrR� IndexGitShaMap.start_write_group:s?���=�=�$��%�%�&<�=�=�(�5�5�a�a�H��
��[�[�]��
rc��URc[R"S5eURR5nURR5S-nURRX!5n[R"URX#5nURRSU5 SUlSUlg)N�builder not openr�r)r�r�r�r�r��	hexdigestr��put_filer�r�r�r�)r/r�r��sizer
s     rrW�!IndexGitShaMap.commit_write_group@s����=�=� ��%�%�&8�9�9����%�%�'���z�z�#�#�%��.�����'�'��5�� �0�0����$�M����� � ��E�*���
���
rc�f�URc[R"S5eSUlSUlg)Nr�)r�r�r�r�rCs rr[� IndexGitShaMap.abort_write_groupKs,���=�=� ��%�%�&8�9�9���
���
rc�~�URU5 g![a URRX5 gf=f)NTF)�
_get_entryr-r��add_node)r/r�r�s   rr��IndexGitShaMap._add_nodeQs>��	��O�O�C� �
��	�	��M�M�"�"�3�.��	�s��%<�<c��URRU/5n[U5S$![aU URc[
eURRU/5n[U5Ss$![a [
ef=ff=f)Nr)r��iter_entriesr��
StopIterationr�r-)r/r�r�s   rr�IndexGitShaMap._get_entryZs����+�+�*�*�C�5�1��		���=��#�#���	��}�}�$����m�m�0�0�#��7�G�
��G�}�Q�'�'�� �
���
��
	�s!�
,�9B�&
A6�3B�6B�Bc#��# �URRU/5HnUSUS4v� M URb0URRU/5HnUSUS4v� M gg7f)Nr�r)r��iter_entries_prefixr�)r/�prefixr�s   r�_iter_entries_prefix�#IndexGitShaMap._iter_entries_prefixgsq����[�[�4�4�f�X�>�E���8�U�1�X�&�&�?��=�=�$����:�:�F�8�D���Q�x��q��*�*�E�%�s�A.A0c�0�URSUS45SS$)Nr�r�r��rr=s  rr<�IndexGitShaMap.lookup_commitns�����	�5�$�7�8��"�=�=rc�J�UbcURRU5 US:XaUSUS4nXCSS4-
nOUnURSUS4SR	U4U-55 gURRUSR	U5-5 g![a Ncf=f)	Nr�rr�rr��gitr�r�)r��updater-r�r)r/r�r�r��tds     rr��IndexGitShaMap._add_git_shaqs������J�J���f�%��y� ���l�I�a�L�1����Q�<�(9�:�<�<�B����N�N�F�F�D�1�4�9�9�d�W�r�\�3J�K�
�J�J���d�T�Y�Y�y�%9�9�:�� ����s�B�
B"�!B"c�(�URSX45$)NrSrr�s   rr3�IndexGitShaMap.lookup_blob_id�s�������:�;�;rc#�V# �[U5S:Xa[U5nURSUS45nURSS5nUSS:Xa&US(aSUS0nO0nS	US
USU44v� gUSRS5[
US
S54v� g![a 0nNCf=f7f)
Nr�rr�r�rgrr�r�r�r�rr�)r�rrr��
IndexErrorr�r�)r/r0r�r�r<s     rr-�IndexGitShaMap.lookup_git_sha�s�����s�8�r�>��S�/�C������d� 3�4���{�{�4��#����7�i��
���7�!2�D��G� <�I� "�I��d�1�g�t�A�w�	�:�;�;���7�>�>�'�*�E�$�q�r�(�O�<�<��	�
��	�
�s6�A
B)�
B�B)�B�!6B)�B&�#B)�%B&�&B)c#�N# �URS5HupUSv� M g7f)rA)r�NNr�N�r�r/r��_values   rrB�IndexGitShaMap.revids�s'����4�4�5L�M�K�C��a�&�L�N���#%c��[U5nURRSU55Hup4nURUS5 M U$)rFc3�,# �UH
nSUS4v� M g7f)r�r�Nr&)r@r>s  rrA�3IndexGitShaMap.missing_revisions.<locals>.<genexpr>�s���7
�28��Y��t�$�&�s�r�)rGr�r	�remove)r/rB�missing_revidsr�r�r!s      rrJ� IndexGitShaMap.missing_revisions�sQ���V���"�k�k�6�6�7
�28�7
�
�N�A�F�
�!�!�#�a�&�)�
��rc#�N# �URS5HupUSv� M g7f)rM)rNNr�Nrr s   rrN�IndexGitShaMap.sha1s�s'����4�4�5I�J�K�C��a�&�L�K�r#)r�r�r�r�r�)r]r^r_r`rar�r�r�r'r�rRrWr[r�rrr<r�r3r-rBrJrNrbr&rrr�r��sk���/�$�=��=�:�8� #�	����+�>�;�"<�=�"�
�rr�r�c���[U5nURS5nURS5nU(aU(agURS5 U(a;[	5RUR
S55 URSS5 gU(a;[5RUR
S55 URSS5 gg![a gf=f)Nzgit.dbzgit.tdbrzgit/idmap.dbz
git/idmap.tdb)	r��hasrrrr�r�r�r`)r��
has_sqlite�has_tdbs   r�migrate_ancient_formatsr0�s���8��H�N��#�#�H�-�J�� � ��+�G��������U�#�
���)�)�.�*>�*>�u�*E�F����h��7�	���&�&�~�';�';�E�'B�C����i��9�
������s�C�
C!� C!c��UR5(a
UR$U$![a [R"U5ef=fr�)�is_readonly�
_decoratedr%r�r�)r{s rr�r��sL�������	6��'�'�'�����	6��*�*�9�5�5�	6�s	�%�!Ac��[USS5nUb[U5 [RU5$![Ra N+f=f)z�Open a cache file for a repository.

If the repository is remote and there is no transport available from it
this will use a local file in the users cache directory
(typically ~/.cache/bazaar/git/)

:param repository: A repository object
r�N)rr0r�r�rsr�)r r�s  rr�r��sR���Z��t�<�N��!�	�#�N�3��,�,�Z�8�8���'�'�	��	�s�2�A	�A	):rar�	threading�dulwich.objectsrrr�rrr	r
rr��bzrrr�r
r�rr{rrrrr!�localr#r'r)rdrsr�r�r�r�r�r�r
rr
rMr^r`r]r�r�r�r�r��Registryrr��registerrvr0r�r�r&rr�<module>r<s���",�	��;�;�0�0�#�1�%��G�G��)��/�/�
���3)�3)�l4�4�"=-�=-�@/�/�"4�4�:�'�|�'�T#�I�#�@-��-�`?�	E�,�	E�u*�i�u*�p6�l�6�r9��)��&k*�9�k*�\L��L�*#��#�L4�{�4�
+�+�
+� k�Y�k�\�
�
�C�!2�2�
3�
5�����"�$�6�6�8�:K�:M�N����%�'�9�9�;�=Q�=S�T����$�&�8�8�:�<O�<Q�R�����/�1�2�:�*�9r

Youez - 2016 - github.com/yon3zu
LinuXploit