403Webshell
Server IP : 74.208.236.16  /  Your IP : 216.73.217.15
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : u102440577 ( 7172810)
PHP Version : 8.4.26
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/lib/python3/dist-packages/mercurial/__pycache__/branchmap.cpython-313.pyc
�

6�hߗ��r�SSKJr SSKJrJrJr SSKJrJrJ	r	J
r
JrJrJ
r
JrJrJrJr SSKJrJrJrJrJr SSKJrJr \(aSSKJr \/(de\R8r"SS	5rS
rSr"SS
5r Sr!Sr"Sr#"SS\ 5r$SSjr%Sr&"SS\$5r'"SS\$5r("SS\ 5r)g)�)�annotations�)�bin�hex�nullrev)�Any�Callable�Dict�Iterable�List�Optional�Set�
TYPE_CHECKING�Tuple�Union�cast)�encoding�error�obsolete�scmutil�util)�repoviewutil�
stringutil)�	localrepoc�F�\rSrSrSrSrSrSSjrSrSr	Sr
S	rS
rg)
�BranchMapCache�3z8mapping of filtered views of repo with their branchcachec��0Ulg�N��_per_filter��selfs �5/usr/lib/python3/dist-packages/mercurial/branchmap.py�__init__�BranchMapCache.__init__6s
�����c���URU5 URURnURU5 URUR:XdURUR45eU$r)�updatecacher!�
filtername�_ensure_populated�_filtername)r#�repo�bcaches   r$�__getitem__�BranchMapCache.__getitem__9sm��������!�!�$�/�/�2��� � ��&��!�!�T�_�_�4�	
�����O�O�7
�	
�4��
r'c�^�URU5 URURnURUR:XdURUR45eU(aUR	U5 UR5n[
USS5(aURU5 gg)a�ensure and up-to-date cache is (or will be) written on disk

The cache for this repository view is updated  if needed and written on
disk.

If a transaction is in progress, the writing is schedule to transaction
close. See the `BranchMapCache.write_dirty` method.

This method exist independently of __getitem__ as it is sometime useful
to signal that we have no intend to use the data in memory yet.
�	finalizedTN)r)r!r*r,�_detect_pure_topo�currenttransaction�getattr�	sync_disk)r#r-�detect_pure_topor.�trs     r$�update_disk�BranchMapCache.update_diskCs���	
������!�!�$�/�/�2���!�!�T�_�_�4�	
�����O�O�7
�	
�4���$�$�T�*�
�
$�
$�
&���2�{�D�)�)����T�"�*r'c�^�URnURnURRU5mTbTR	U5(d[U5m/nTc�[RU5nUb�URU5nURU5 URURRU5mURRUR-
nURU4SjU55 O[U5mURURTRS-S95 U(aTRX5 TR	U5(dU5eTURUR'g)z<Update the cache for the given filtered view on a repositoryNc3�J># �UHoTR::dMUv� M g7fr)�tiprev)�.0�rr.s  �r$�	<genexpr>�-BranchMapCache.updatecache.<locals>.<genexpr>ss����G�y�!����4F�A�A�y���#�	#r)�start)�	changelogr*r!�get�validfor�branch_cache_from_file�subsettable�filteredr)�inherit_for�filteredrevs�extend�new_branch_cache�revsr=�update)	r#r-�clr*rN�
subsetname�subset�	extrarevsr.s	        @r$r)�BranchMapCache.updatecache[s<����^�^���_�_�
��!�!�%�%�j�1���>�����!6�!6�+�D�1�F����>�%����4�J��%����z�2��� � ��(��)�)�&�*;�*;�<�H�H��N��"�,�,�9�9�B�O�O�K�	����G�y�G�G�*�$�/�����B�G�G�&�-�-�!�"3�G�4�5���M�M�$�%����t�$�$�0�j�0�$�,2�������)r'c�>^�URnURmURn/n[5nUR	5H<nXW-
nUH/nT"U5n	U"U	5up�U(dMURU5 M1 M> U(a�[
U4SjU55n[UUXR5UUS9n
SH\nURU5nU
RU5(dM,X�lX�RU'[U
lU
RU5  g gg)z�Replace the branchmap cache for a repo with a branch mapping.

This is likely only called during clone with a branch map from a
remote.

c3�F># �UHn[T"U55v� M g7fr)�int)r>�node�clrevs  �r$r@�)BranchMapCache.replace.<locals>.<genexpr>�s����?�w�t�#�e�D�k�*�*�w���!)�closednodes)sbases	immutablesservedN)rD�rev�
branchinfo�set�values�add�maxrMrXrIrFr,r!�STATE_DIRTY�_state�write)r#r-�remotebranchmaprP�clbranchinfo�rbheads�closed�bheads�hr?�b�c�rtiprev�cache�	candidate�rviewrYs                @r$�replace�BranchMapCache.replaces����^�^�������}�}�������%�,�,�.�F���G����!�H��#�A�����1��J�J�q�M�	�/���?�w�?�?�G�$����
�"�"�$��"��E�@�	��
�
�i�0���>�>�%�(�(�(1�%�27�$�$�Y�/�#.�E�L��K�K��&��@�r'c�8�URR5 gr)r!�clearr"s r$ru�BranchMapCache.clear�s������� r'c���UR5n[R"5HKnURR	U5nUcM#UcUnOURU5nUR
U5 MM gr)�
unfilteredr�get_ordered_subsetr!rErIr6)r#r-�unfir*ros     r$�write_dirty�BranchMapCache.write_dirty�sd����� ��&�9�9�;�J��$�$�(�(��4�E��}���!����}�}�Z�0���O�O�D�!�<r'r N�F)
�__name__�
__module__�__qualname__�__firstlineno__�__doc__r%r/r9r)rrrur{�__static_attributes__�r'r$rr3s*��B���#�0"3�H'�R!�
"r'rc�:�[SUR5-5e)zEraises ValueError when branchcache found a node which does not existsznode %s does not exist)�
ValueErrorr�rXs r$�_unknownnoder��s��
�-����
�:�
;�;r'c�<�URbSUR-$g)Nsbranch cache (%s)sbranch cache)r*�r-s r$�_branchcachedescr��s�����"�#�d�o�o�5�5�r'c��\rSrSrSrSSSjjrSrSrSrSr	S	r
\
rS
rSr
SrS
rSSjrSrSrSrSrSrg)�_BaseBranchCache��z�A dict like object that hold branches heads cache.

This cache is used to avoid costly computations to determine all the
branch heads of a repo.
Nc�^�Uc
[5n[U5Ul[U5Ulg)��hasnode is a function which can be used to verify whether changelog
has a given node or not. If it's not provided, we assume that every node
we have exists in changelogN)r_�_closednodes�dict�_entries)r#r-�entries�closed_nodess    r$r%�_BaseBranchCache.__init__�s)�����5�L���-����W�
��
r'c�,�[UR5$r)�iterr�r"s r$�__iter__�_BaseBranchCache.__iter__�s���D�M�M�"�"r'c� �X RU'gr�r�)r#�key�values   r$�__setitem__�_BaseBranchCache.__setitem__�s��"�
�
�c�r'c� �URU$rr��r#r�s  r$r/�_BaseBranchCache.__getitem__�s���}�}�S�!�!r'c��XR;$rr�r�s  r$�__contains__�_BaseBranchCache.__contains__�s���m�m�#�#r'c�6�URR5$r)r��itemsr"s r$�	iteritems�_BaseBranchCache.iteritems�s���}�}�"�"�$�$r'c��XR;$�z2checks whether a branch of this name exists or notr�)r#�labels  r$�	hasbranch�_BaseBranchCache.hasbranch�s���
�
�%�%r'c�h�USnSn[U5HnX@R;dMUnSn X#4$ X#4$)z`Return tuple with last open head in heads and false,
otherwise return last closed head and true.���TF)�reversedr�)r#�heads�tiprirks     r$�
_branchtip�_BaseBranchCache._branchtip�sK���B�i�����%��A��)�)�)�������{��!�
�{�r'c�.�URX5S$)z�Return the tipmost open head on branch head, otherwise return the
tipmost closed head on branch.
Raise KeyError for unknown branch.r)r�)r#�branchs  r$�	branchtip�_BaseBranchCache.branchtip�s�����t�|�,�Q�/�/r'c�^�U4SjU5$)Nc3�J># �UHoTR;dMUv� M g7fr�r��r>�nr#s  �r$r@�,_BaseBranchCache.iteropen.<locals>.<genexpr>s����?�5�a�T�->�->�$>���5�rBr�)r#�nodess` r$�iteropen�_BaseBranchCache.iteropens���?�5�?�?r'c�f�URUnU(d[URU55nU$r)r��listr�)r#r�rir�s    r$�branchheads�_BaseBranchCache.branchheadss+���
�
�f�%�������u�-�.�E��r'c#�l# �UR5HupX4URU5-v� M g7fr)r�r�)r#�bnr�s   r$�iterbranches�_BaseBranchCache.iterbranchess-�������I�B��+����� 6�6�6�&�s�24c�6�URR5$�zreturns all the heads)r�r`r"s r$�	iterheads�_BaseBranchCache.iterheadss���}�}�#�#�%�%r'c��^�[R"5nURm[R"US5n0n[5n[5nUR
5RnSn	UHkn
[X�5n	X�;aURU
5 M&U"U
5up�URU/5RU
5 U(dMZURU
5 Mm U	S:aSn
[R"U
5eURUUUUU	5 URR!U4SjU55 [R"5U-
nUR"R%SS['U5U5 U	$)z�Given a branchhead cache, self, that may have extra nodes or be
missing heads, and a generator of nodes that are strictly a superset of
heads missing, this function updates self to be correct.
�obsoleter�rz5running branchcache.update without revision to updatec3�F># �UHnTRU5v� M g7frr�)r>r]rPs  �r$r@�*_BaseBranchCache.update.<locals>.<genexpr><s���� D��#��������r[�branchcachesupdated %s in %.4f seconds
)r�timerrDr�getrevsr_�revbranchcacher^rbra�
setdefault�appendr�ProgrammingError�_process_newr�rO�ui�logr�)r#r-�revgen�	starttime�obsrevs�newbranches�
new_closed�obs_ignored�
getbranchinfo�max_revr?r��closesbranch�msg�durationrPs               @r$rO�_BaseBranchCache.updatesI���
�J�J�L�	�
�^�^���"�"�4��5�����U�
��e���+�+�-�8�8�
����A��'�o�G��|�����"��#0��#3� �F��"�"�6�2�.�5�5�a�8��|����q�!���Q�;�I�C��(�(��-�-���������	
�	
��� � � D�� D�D��:�:�<�)�+��������+��T�"��		
��r'c��SnURnUR5Rn[R"US5n	UR
n
UR
5GHup�URRU/5n
U
Vs1sHo�RU5iM nn[5n[U5GH nU(dURU5 MU
"U5Vs/sHnU[:wdMUPM nn[5n[5n[5nUHUnUU	;aURU5 MUU;dU"U5SU:XaURU5 MDURU5 MW [U5[U5s=:XaS:Xd$O URU5 URU5 UR!U5 URU5 GM# U(a_Uc[UR#55nX�-
(a:[%U5nU['U5::a [UR)UU55nUU-nU(dGM�[U5Vs/sHnUR+U5PM snX'GM gs snfs snfs snf)z2update the branchmap from a set of new informationNr�rr)rDr�r^rr��_uncheckedparentrevsr�r�rEr]r_�sortedrar�lenrO�difference_update�headrevs�minrb�	ancestorsrX)r#r-r�r�r�r��	topoheadsrPr�r��
parentrevsr��newheadrevsrjrX�bheadset�	uncertain�newrev�p�parents�
samebranch�otherbranch�
obsparents�floorrevr�r]s                          r$r��_BaseBranchCache._process_newGs���	�
�^�^���+�+�-�8�8�
��"�"�4��5���,�,�
�#.�#4�#4�#6��F�H�]�]�&�&�v�r�2�F�17�8�����t���H�8���I� ��-����L�L��(��&0��&8�I�&8��A��L�1�&8��I� �U�
�!�e�� �U�
� �A��G�|�#���q�)��h��-��*:�1�*=��*G�"���q�)�#����*�!��H�
��Z��=�A�=��$�$�[�1��$�$�Z�0��*�*�:�6����V�$�3.�6��$� #�B�K�K�M� 2�I��'�"�8�}�H��3�y�>�1�$'����Y��(I�$J�	� �I�-���x�8>�x�8H�I�8H�������8H�I���W$7��J9��J��> Js�I;�J�-J�J)r�r��r�N)r-�localrepo.localrepositoryr��DUnion[Dict[bytes, List[bytes]], Iterable[Tuple[bytes, List[bytes]]]]r��Optional[Set[bytes]]�return�Noner})r~rr�r�r�r%r�r�r/r�r�r�r�r�r�r�r�r�r�rOr�r�r�r'r$r�r��s����
�-1�
&�'�&�
�&�+�
&�
�&�&#�#�"�$�%�
�E�&�
�0�@��7�&�/�baJr'r���c�z^�\rSrSr%SrSr\"\\S5r	S\
S'SS\SSSSS4S U4SjjjrS!S	jr
S
rS"SjrSr\S
5r\S#Sj5rSr\S5rSrSrSrS"SjrS$SjrSrSrU4SjrU4SjrU4Sjr\r U4Sjr!U4Sjr"S%U4Sjjr#U4Sjr$Sr%U=r&$)&�_LocalBranchCachei�z:base class of branch-map info for a local repo or repoviewNr��Tuple[bytes]�_default_key_hashesFc
�>�URUlUcURUlOX0lX@lUcUR
UlOXPl[UlU	(a[Ul[T
U]-XUS9 X�l[5UlSUlUR(aUR R"Ulgg)r�N�r-r�r�)r*r,�nullid�tipnoder=r
�
key_hashes�STATE_CLEANrd�STATE_INHERITED�superr%�_verify_noder_�_verifiedbranches�_hasnoderD�hasnode)r#r-r�rr=rr\r�verify_node�	inherited�	__class__s          �r$r%�_LocalBranchCache.__init__�s����" �?�?����?��;�;�D�L�"�L�����"�6�6�D�O�(�O�!����)�D�K�
���d�+��N�(��!$������
���� �N�N�2�2�D�M�r'c��[er��NotImplementedError�r#r-s  r$�_compute_key_hashes�%_LocalBranchCache._compute_key_hashes����!�!r'c��g)�6make sure any lazily loaded values are fully populatedNr�rs  r$r+�#_LocalBranchCache._ensure_populated�s�r'c��grr�rs  r$r3�#_LocalBranchCache._detect_pure_topo�s��r'c���URRUR5nURU:wagURU5nURU:H$![a gf=f)z�check that cache contents are valid for (a subset of) this repo

- False when the order of changesets changed or if we detect a strip.
- True when cache is up-to-date for the current repo or its subset.F)rDrXr=�
IndexErrorrrr)r#r-rX�repo_key_hashess    r$rF�_LocalBranchCache.validfor�si��
	��>�>�&�&�t�{�{�3�D�
�<�<�4����2�2�4�8�����/�1�1���	��	�s�%A�
A%�$A%c��SnURURU55n[U5nURX5nU"U4SS0UD6nUR	U5(d[S5eUR
X5 U(aUR5 U$![a U(aUR5 gg[ahnURR(aASnU[U5[R"U54-nURRU5 SnSnAN�SnAff=f!U(aUR5 ff=f)NrTztip differssinvalid %s: %s
)�cachevfs�	_filenamer��_load_headerrFr��_load_heads�OSError�close�	Exceptionr��	debugflagr�r�forcebytestr�debug)�clsr-�f�lineiter�init_kwargsr.�instr�s        r$�fromfile�_LocalBranchCache.fromfiles,����	��
�
�c�m�m�D�1�2�A��A�w�H��*�*�4�:�K���� ����F�
�?�?�4�(�(� ��/�/����t�.�����	��
��#�	������	���	��w�w� � �)���$�T�*��+�+�D�1�������
�
�c�"��F��	������	��s7�A9B�
D+� D.�:	D+�AD&�!D.�&D+�+D.�.Ec��[err)r6r-r8s   r$r.�_LocalBranchCache._load_header#s��!�!r'c��UH�nURS5nU(dMURSS5upEnUS;a[S5e[R"UR55n[
U5nURRU/5RU5 US:XdM�URRU5 M� g)�Sfully loads the branchcache by reading from the file using the line
iterator passed�
� rsoczinvalid branch state�cN)�rstrip�splitr�r�tolocal�striprr�r�r�r�ra)r#r-r8�linerX�stater�s       r$r/�_LocalBranchCache._load_heads's����D��;�;�u�%�D���!%���D�!�!4��D���E�!� �!7�8�8��$�$�U�[�[�]�3�E��t�9�D��M�M�$�$�U�B�/�6�6�t�<���}��!�!�%�%�d�+�r'c�j�URnUceUR(aSX!R4-nU$)z7name of a branchcache file for a given repo or repoviews%s-%s)�_base_filenamer*)r6r-�filenames   r$r-�_LocalBranchCache._filename7s8���%�%���#�#�#��?�?��8�_�_�"=�=�H��r'c�(�URUR:wde[U5"UURURUR
UR[UR5URSS9n[UR5Ul
U$)z,return a deep copy of the branchcache objectT)r-r�rr=rr\rr)r*r,�typer�rr=rr_r�rr)r#r-�others   r$rJ�_LocalBranchCache.inherit_for@s}�����$�"2�"2�2�2�2��T�
���M�M��L�L��;�;�����D�-�-�.��)�)��
��#&�d�&<�&<�"=����r'c���UR[:XaURU5 gUR[:Xa-UR	U5nUR
R
U5 gg)a'synchronise the on disk file with the cache state

If new value specific to this filter level need to be written, the file
will be updated, if the state of the branchcache is inherited from a
subset, any stalled on disk file will be deleted.

That method does nothing if there is nothing to do.
N)rdrcrerr-r,�	tryunlink)r#r-rMs   r$r6�_LocalBranchCache.sync_diskTsM���;�;�+�%��J�J�t��
�[�[�O�
+��~�~�d�+�H��M�M�#�#�H�-�,r'c�,�URUR:XdURUR45eUR[:XdUR5eUR	5n[USS5(dSn[R"U5eURU5nURUSSS9nURU5 URX5nSSS5 URRSS[U5[UR 5W5 ["Ulg!,(df   NU=f![$[R&4a<nURR)S[*R,"U5-5 SnAgSnAff=f)	Nr2Tz2writing branchcache in the middle of a transaction�w)�
atomictempr�s%wrote %s with %d labels and %d nodes
s couldn't write branch cache: %s
)r,r*rdrcr4r5rr�r-r,�
_write_header�_write_headsr�r�r�r�r�rr0�Abortr5rr4)r#r-r8r�rMr7�	nodecountr:s        r$re�_LocalBranchCache.writecsX�����4�?�?�2�	
�����O�O�5
�	
�2��{�{�k�)�6�4�;�;�6�)�
�
$�
$�
&���r�;��-�-�F�C��(�(��-�-�	��~�~�d�+�H����x��$��?�1��"�"�1�%� �-�-�d�6�	�@�
�G�G�K�K��9� ��&��D�M�M�"��
�&�D�K�@�?������%�	��G�G�M�M�4��)�)�$�/�0�
�
��	�s1�"D=�:#D,�AD=�,
D:�6D=�=F�2F�Fc��[err)r#�fps  r$rY�_LocalBranchCache._write_header�r!r'c��Sn[URR55H\upE[R"U5nUH;nUS-
nX`R
;aSnOSnUR
S[U5Xt4-5 M= M^ U$)�Bwrite list of heads to a file

Return the number of heads written.rrrC�o�	%s %s %s
)r�r�r�r�	fromlocalr�rer)r#r-r_r\r�r�rXrIs        r$rZ�_LocalBranchCache._write_heads�s����	�"�4�=�=�#6�#6�#8�9�L�E��&�&�u�-�E����Q��	��,�,�,� �E� �E�����#�d�)�U�)B�B�C�
�:��r'c�,�UR(dgXR;dXR;agURceURUH&nURU5(aM[	U5 M( URRU5 g)z'verify head nodes for the given branch.N)rr�rrr�ra)r#r�r�s   r$�
_verifybranch�_LocalBranchCache._verifybranch�su��� � �����&�&�4J�4J�*J���}�}�(�(�(����v�&�A��=�=��#�#��Q��'�	
���"�"�6�*r'c��URR5H%nXR;dMURU5 M' g)z"verifies nodes of all the branchesN)r��keysrrh)r#rls  r$�
_verifyall�_LocalBranchCache._verifyall�s3�����#�#�%�A��.�.�.��"�"�1�%�&r'c�D>�URU5 [TU]	U5$r)rhrr/�r#r�rs  �r$r/�_LocalBranchCache.__getitem__�s!������3���w�"�3�'�'r'c�D>�URU5 [TU]	U5$r)rhrr�ros  �r$r��_LocalBranchCache.__contains__�s!������3���w�#�C�(�(r'c�@>�UR5 [TU]	5$r)rlrr��r#rs �r$r��_LocalBranchCache.iteritems�s��������w� �"�"r'c�@>�UR5 [TU]	5$r�)rlrr�rts �r$r��_LocalBranchCache.iterheads�s��������w� �"�"r'c�D>�URU5 [TU]	U5$r�)rhrr�)r#r�rs  �r$r��_LocalBranchCache.hasbranch�s!������5�!��w� ��'�'r'c�@>�URU5 [TU]	XS9$)N)ri)rhrr�)r#r�rirs   �r$r��_LocalBranchCache.branchheads�s$������6�"��w�"�6�"�9�9r'c�>�URUR:XdURUR45eURn[TU]X5nUb,X@R
:�aX@lUR
U5UlO+UR
UR
5UR:XdeURU5(d<URU5Ul
[R"UUR
5Ul
[UlUR!5n[#USS5(aUR%U5 gg)Nr2T)r,r*rDrrOr=rXrrFrrr�#combined_filtered_and_obsolete_hash�filteredhashrcrdr4r5re)r#r-r�rPr�r8rs      �r$rO�_LocalBranchCache.update�s������4�?�?�2�	
�����O�O�5
�	
�2��^�^���'�.��.����7�[�[�#8�!�K��7�7�7�+�D�L��7�7�4�;�;�'�4�<�<�7�7�7��}�}�T�"�"�#�6�6�t�<�D�O� '� K� K�����!�D��
"���
�
$�
$�
&���2�{�D�)�)�
�J�J�t��	*r')	r,rrdrrr~rrr=)r-rr�rrzOptional[bytes]r=z
Optional[int]rzOptional[Tuple[bytes]]r\rrz!Optional[Callable[[bytes], bool]]r�boolrr�rr�rr	�rr�rzdict[str, Any]�rrWr})'r~rr�r�r�rLrr�bytesr
�__annotations__rr%rr+r3rF�classmethodr;r.r/r-rJr6rerYrZrhrlr/r�r�r�r�r�r�rOr��
__classcell__�rs@r$rr�sQ���D��N�(,�U�5�\�2�(>���>�
�#'� '�-1�,0�59�!��*3�'�*3�
�*3�!�
*3��*3�+�*3�*�*3�3�*3��*3��*3�
�*3�*3�X"�E�
�2�*� �� �D�"��"�,� �����(
.��>"�� +�&�(�)�#�
�E�#�
(�
:�$�$r'rc��URRSS5(a[RU5$[RU5$)z{Build a branch cache from on-disk data if possible

Return a branch cache of the right format depending of the repository.
�experimental�branch-cache-v3)r��
configbool�
BranchCacheV3r;�
BranchCacheV2r�s r$rGrG�s>��
�w�w���/�+=�>�>��%�%�d�+�+��%�%�d�+�+r'c��URRSS5(a[U/UQ70UD6$[U/UQ70UD6$)zoBuild a new branch cache from argument

Return a branch cache of the right format depending of the repository.
r�r�)r�r�r�r�)r-�args�kwargss   r$rMrM�sF��
�w�w���/�+=�>�>��T�3�D�3�F�3�3��T�3�D�3�F�3�3r'c�D�\rSrSrSrSr\S	Sj5rS
SjrSSjr	Sr
g)r�ia�a branch cache using version 2 of the format on disk

The cache is serialized on disk in the following format:

<tip hex node> <tip rev number> [optional filtered repo hex hash]
<branch head hex node> <open/closed state> <branch name>
<branch head hex node> <open/closed state> <branch name>
...

The first line is used to check if the cache is still valid. If the
branch cache is for a filtered repo view, an optional third hash is
included that hashes the hashes of all filtered and obsolete revisions.

The open/closed state is represented by a single letter 'o' or 'c'.
This field can be used to avoid changelog reads when determining if a
branch head closes a branch or not.
sbranch2c���[U5RS5RSS5nUSSupE[U5[	U5pTSn[U5S:�a[US54nUUUS.$)zaparse the head of a branchmap file

return parameters to pass to a newly created class instance.
rArBrNr�)rr=r)�nextrDrErrWr�)r6r-r8�cachekey�last�lrevr~s       r$r.�BranchCacheV2._load_headersv����>�(�(��/�5�5�d�A�>���b�q�\�
����Y��D�	�d����x�=�1������,�.�L���&�
�	
r'c��[UR5SUR-/nUR(a'UR	[URS55 URSR
U5S-5 g)z'write the branch cache header to a file�%drrBrAN)rrr=rr�re�join)r#r_r�s   r$rY�BranchCacheV2._write_header(sY������%�u�t�{�{�':�;���?�?��O�O�C����� 2�3�4�
������8�$�u�,�-r'c��[R"UURSS9n[[[
S5nUbU4nU$)�:return the cache key hashes that match this repoview stateT)�needobsoleter�)rr}r=rrr�)r#r-�
filtered_hashrks    r$r�!BranchCacheV2._compute_key_hashes/sD���C�C���K�K��
�
�
"�%��,��3���$�"/�!1�D��r'r�Nr�r�r�)r~rr�r�r�rLr�r.rYrr�r�r'r$r�r�s*���$ �N��
��
�".�
r'r�c�^�\rSrSrSrSrSrSS.U4SjjrU4SjrS	r	SS
jr
SSjr\S5r
U4S
jrSSjrSU4SjjrSrSSjrSrU=r$)r�i<u�a branch cache using version 3 of the format on disk

This version is still EXPERIMENTAL and the format is subject to changes.

The cache is serialized on disk in the following format:

<cache-key-xxx>=<xxx-value> <cache-key-yyy>=<yyy-value> […]
<branch head hex node> <open/closed state> <branch name>
<branch head hex node> <open/closed state> <branch name>
...

The first line is used to check if the cache is still valid. It is a series
of key value pair. The following key are recognized:

- tip-rev: the rev-num of the tip-most revision seen by this cache
- tip-node: the node-id of the tip-most revision sen by this cache
- filtered-hash: the hash of all filtered revisions (before tip-rev)
                 ignored by this cache.
- obsolete-hash: the hash of all non-filtered obsolete revisions (before
                 tip-rev) ignored by this cache.

The tip-rev is used to know how far behind the value in the file are
compared to the current repository state.

The tip-node, filtered-hash and obsolete-hash are used to detect if this
cache can be used for this repository state at all.

The open/closed state is represented by a single letter 'o' or 'c'.
This field can be used to avoid changelog reads when determining if a
branch head closes a branch or not.

Topological heads are not included in the listing and should be dispatched
on the right branch at read time. Obsolete topological heads should be
ignored.
sbranch3-exp)NNN)�pure_topo_branchc�X>�[TU]"U0UD6 XlURSLUlgr)rr%�_pure_topo_branch�_needs_populate)r#r�r�r�rs    �r$r%�BranchCacheV3.__init__ds.���
���$�)�&�)�!1��#�5�5�T�A��r'c�j>�[TU]U5nURUlURUlU$r)rrJr�r�)r#r-�newrs   �r$rJ�BranchCacheV3.inherit_foris3����g�!�$�'�� $� 6� 6���"�2�2����
r'c���URnUR[:Xa/$URUR5:XaUR5$URURS-S9nU$)zDreturns the topological head of a repoview content up to self.tiprevr)�stop_rev)rDr=rr�)r#r-rPr�s    r$�_get_topo_heads�BranchCacheV3._get_topo_headsosW��
�^�^���;�;�'�!��I�
�[�[�B�I�I�K�
'��;�;�=� ��K�K����q��K�9�E��Lr'c�J�[UR5SUR-S.nUR(aVURSb[URS5US'URSb[URS5US'URbSUS'S	[UR
555nURS
RU5S-5 URb5[R"UR5nURUS-5 gg)Nr�)�tip-node�tip-revr�
filtered-hashr�
obsolete-hash�pure�	topo-modec3�,# �UH
nSU-v� M g7f)s%s=%sNr�)r>�is  r$r@�.BranchCacheV3._write_header.<locals>.<genexpr>�s���C�(B�1�(�Q�,�(B�s�rBrA)rrr=rr�r�r�rer�rre)r#r_�
cache_keys�piecesr�s     r$rY�BranchCacheV3._write_headerzs����T�\�\�*�����+�
�
��?�?����q�!�-�/2�4�?�?�1�3E�/F�
�+�,����q�!�-�/2�4�?�?�1�3E�/F�
�+�,��!�!�-�'.�J�|�$�C��z�/?�/?�/A�(B�C��
������6�"�U�*�+��!�!�-��&�&�t�'=�'=�>�E��H�H�U�U�]�#�.r'c���URRnSnSnURc&URU5Vs1sH
oc"U5iM nn[	UR
R
55HwupxXpR:XaM[R"U5nUHEn	UbX�;aM
X�R;aSn
OSn
US-
nURS[U	5X�4-5 MG My U$s snf)rbrNrCrcrrd)rDrXr�r�r�r�r�rrer�rer)r#r-r_�to_noder\�
topo_headsr?r�r�rXrIs           r$rZ�BranchCacheV3._write_heads�s����.�.�%�%���	��
��!�!�)�/3�.B�.B�4�.H�I�.H��'�!�*�.H�J�I�"�4�=�=�#6�#6�#8�9�L�E��.�.�.���&�&�u�-�E����)��)� ��,�,�,� �E� �E��Q��	�����#�d�)�U�)B�B�C��:����!Js�C.c��[U5nURS5RS5nUHnSU;dMSU-n[U5e [	SU55n0nSn	Sn
SnUR5H�up�US:Xa[
U
5US'MUS	:Xa[U
5US
'M1US:Xa
[U
5n	MDUS:Xa
[U
5n
MWUS
:XaU
S:XaSnMgSU
-n[U5eSU-n[U5e X�4US'U(a3[U5RS5n[R"U5US'U$)NrArB�=sinvalid header_line: %rc3�D# �UHoRSS5v� M g7f)r�rN)rE)r>r�s  r$r@�-BranchCacheV3._load_header.<locals>.<genexpr>�s���;�F�q�'�'�$��*�*�F�s� Fr�r=r�rr�r�r�r�Tsunknown topo-mode: %rsunknown cache key: %rrr�)
r�rDrEr�r�r�rWrrrF)r6r-r8�header_liner�r�r�r�r�r��
obsolete_hash�has_pure_topo_heads�k�v�	pure_lines               r$r.�BranchCacheV3._load_header�sR���8�n���#�#�E�*�0�0��6���A��1�}�0�;�>�� ��o�%���;�F�;�;�
����
��
�#���$�$�&�D�A��J��!$�Q���X���k�!�"%�a�&��Y���&�&� #�A��
��&�&� #�A��
��l�"���<�*.�'�2�Q�6�C�$�S�/�)�.��2�� ��o�%�#'�$,�;��\����X��-�-�e�4�I�'/�'7�'7�	�'B�D�#�$��r'c�z>�[T
U]X5 URbgURnUR	5R
n[R"US5nURn[5nURU5HznX�;aM
U"U5n	U"U5up�URRU
/5RU	5 U(aURRU	5 URU
5 M| UR R"nUHn
URU
R%US9 M! g)r@Nr�)r�)rr/r�rDr�r^rr�rXr_r�r�r�r�r�ra�indexr]�sort)r#r-r8rPr�r�r��touched_branch�headrXr�ri�to_revrs             �r$r/�BranchCacheV3._load_heads�s	���	���D�+��!�!�-��
�^�^���+�+�-�8�8�
��"�"�4��5���'�'������(�(��.�D�����4�=�D�*�4�0�N�F��M�M�$�$�V�R�0�7�7��=���!�!�%�%�d�+����v�&�/�������$�F��M�M�&�!�&�&�6�&�2�%r'c�D�[R"UUR5$)r�)r�filtered_and_obsolete_hashr=rs  r$r�!BranchCacheV3._compute_key_hashes�s���1�1���K�K�
�	
r'c�>�U(d�U(d�U(a3[U5S:Xa�UR[:XdURU;agU(a_[U5S:Xde[	UR55SUlSUlURRURS5 gURU5 SUl[TU]-UUUUU5 g)NrrT)r�r=rr�r�rkr�r��popr+rr�)r#r-r�r�r�r�rs      �r$r��BranchCacheV3._process_new�s���� �
����$��)����w�.��1�1�[�@�
��;�'�1�,�,�,�)-�k�.>�.>�.@�)A�!�)D��&�'+��$��
�
�!�!�$�"8�"8�$�?�����t�$�!%���
��������	
r'c��UR(aoURceURnURnUR	U5nUVs/sH
oS"U5PM nnX`R
UR'SUlggs snf)r#NF)r�r�rDrXr�r�)r#r-rPr�r�r?r�s       r$r+�BranchCacheV3._ensure_populateds{������)�)�5�5�5����B��g�g�G��-�-�d�3�J�)3�4��A�W�Q�Z��E�4�49�M�M�$�0�0�1�#(�D� � ��
5s�Bc�R^�TRbgURRnTRU5Vs/sH
o2"U5PM nn[	U4SjU55(agTR
R
5HupVXd:XdMUTl[Tl g gs snf)Nc3�@># �UHoTR;v� M g7frr�r�s  �r$r@�2BranchCacheV3._detect_pure_topo.<locals>.<genexpr>,s����:�z�!�D�%�%�%�z�s�)	r�rDrXr��anyr�r�rcrd)r#r-r�r?r�r�r�s`      r$r3�BranchCacheV3._detect_pure_topo&s�����!�!�-���.�.�%�%��*.�*>�*>�t�*D�E�*D�Q�g�a�j�*D�
�E��:�z�:�:�:��!�]�]�0�0�2�M�F��"�)/��&�)����	3��Fs�B$)r�r�rdr�r�r�)r~rr�r�r�rLr
r%rJr�rYrZr�r.r/rr�r+r3r�r�r�s@r$r�r�<sw���"�H$�N�&��/3�B�B�
�	�$�$�8�#��#�J3�2
�+
�
�+
�Z	)��r'r�c�F^�\rSrSrSrSSU4SjjjrSrU=r$)�remotebranchcachei5z@Branchmap info for a remote connection, should not write locallyr�c�">�[TU]XUS9 g)Nr)rr%)r#r-r�r\rs    �r$r%�remotebranchcache.__init__8s���	���d�+��Nr'r�)r-rr�rr\rrr)r~rr�r�r�r%r�r�r�s@r$r�r�5sD���J�
�,0�
O�'�O�
�O�*�
O�
�O�Or'r�N)rzOptional[_LocalBranchCache])*�
__future__rrXrrr�typingrr	r
rrr
rrrrr�rrrrr�utilsrrrrHrr�r�r�rrrcrrGrMr�r�r�r�r'r$�<module>r�s���#����������
���;��;��&�&��B"�B"�J<�
�dJ�dJ�N������x�(�x�v	,�4�8�%�8�vv�%�v�rO�(�Or'

Youez - 2016 - github.com/yon3zu
LinuXploit