403Webshell
Server IP : 50.21.180.56  /  Your IP : 216.73.216.208
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/lib/python3/dist-packages/breezy/bzr/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/lib/python3/dist-packages/breezy/bzr/__pycache__/vf_search.cpython-313.pyc
�

p��g`F����SrSSKrSSKJrJrJr SSKJrJrJ	r	 SSK
Jr "SS5r"S	S
\5r
"SS\5r"S
S\5r"SS\5r"SS\5r"SS\5rSrSrSrSrg)z)Searching in versioned file repositories.�N�)�debug�revision�trace)�DictParentsProvider�Graph�invert_parent_map)�AbstractSearchResultc��\rSrSrSrSrSrg)�AbstractSearch�zZA search that can be executed, producing a search result.

:seealso: AbstractSearchResult
c�,�[UR5e)z�Construct a network-ready search result from this search description.

This may take some time to search repositories, etc.

:return: A search result (an object that implements
    AbstractSearchResult's API).
)�NotImplementedError�execute��selfs �6/usr/lib/python3/dist-packages/breezy/bzr/vf_search.pyr�AbstractSearch.execute s��"�$�,�,�/�/��N)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r�__static_attributes__rrrrrs���
0rrc�B�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rg)�SearchResult�+z�The result of a breadth first search.

A SearchResult provides the ability to reconstruct the search or access a
set of the keys the search found.
c�8�SXU4Ul[U5Ulg)a�Create a SearchResult.

:param start_keys: The keys the search started at.
:param exclude_keys: The keys the search excludes.
:param key_count: The total number of keys (from start to but not
    including exclude).
:param keys: The keys the search found. Note that in future we may get
    a SearchResult from a smart server, in which case the keys list is
    not necessarily immediately available.
�searchN)�_recipe�	frozenset�_keys)r�
start_keys�exclude_keys�	key_count�keyss     r�__init__�SearchResult.__init__2s��!�*�I�F����t�_��
rc�L�URupp4[U5S:�a[[U5SS5SSS-nO[U5n[U5S:�a[[U5SS5SSS-nO[U5nSURR
SUSUSUSUS3$)	N�����, ...]�<� z:(z, z)>)r"�len�repr�list�	__class__r)r�kindr%r&r'�start_keys_repr�exclude_keys_reprs       r�__repr__�SearchResult.__repr__@s���48�L�L�1��,��z�?�Q��"�4�
�#3�B�Q�#7�8��"�=��H�O�"�:�.�O��|��q� � $�T�,�%7���%;� <�S�b� A�H� L�� $�\� 2���4�>�>�*�*�+�1�T�F�"�_�4E�R�HY�GZ�Z\�]f�\g�gi�j�jrc��UR$)aReturn a recipe that can be used to replay this search.

The recipe allows reconstruction of the same results at a later date
without knowing all the found keys. The essential elements are a list
of keys to start and to stop at. In order to give reproducible
results when ghosts are encountered by a search they are automatically
added to the exclude list (or else ghost filling may alter the
results).

:return: A tuple ('search', start_keys_set, exclude_keys_set,
    revision_count). To recreate the results of this search, create a
    breadth first searcher on the same graph starting at start_keys.
    Then call next() (or next_with_ghosts()) repeatedly, and on every
    result, call stop_searching_any on any keys from the exclude_keys
    set. The revision_count value acts as a trivial cross-check - the
    found revisions of the new search should have as many elements as
    revision_count. If it does not, then additional revisions have been
    ghosted since the search was executed the first time and the second
    time.
�r"rs r�
get_recipe�SearchResult.get_recipeLs��*�|�|�rc�*�SRURS5nSRURS5n[URS5RS5nURSRS5SRXU454$)N� �r��asciir�
)�joinr"�str�encode)rr%�	stop_keys�counts    r�get_network_struct�SearchResult.get_network_structcs|���Y�Y�t�|�|�A��/�
��I�I�d�l�l�1�o�.�	��D�L�L��O�$�+�+�G�4���L�L��O�"�"�7�+��J�J�
�u�5�6�
�	
rc��UR$)z?Return the keys found in this search.

:return: A set of keys.
)r$rs r�get_keys�SearchResult.get_keysls��
�z�z�rc�&�URSS:H$)�5Return false if the search lists 1 or more revisions.rArr;rs r�is_empty�SearchResult.is_emptyss���|�|�A��!�#�#rc�x�URSnURSnURSnUR5n[U5nURU5 UR	U5 UR	U5 URU5nURU5 Xa-
nU[
U5-n[XtXV5$)��Create a new search by refining this search.

:param seen: Revisions that have been satisfied.
:param referenced: Revision references observed while satisfying some
    of this search.
r@rrA)r"rL�set�update�difference_update�intersectionr1r)	r�seen�
referenced�start�excluderHr(�pending_refs�
seen_headss	         r�refine�SearchResult.refinews������Q����,�,�q�/�����Q����}�}����:������E�"��&�&�t�,��&�&�w�/��'�'��-�
����z�"��{��
��T�����L�5�?�?r)r$r"N�
rrrrrr)r8r<rIrLrPr^rrrrrr+s,���%�
k��.
��$�@rrc�H�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
g)
�PendingAncestryResult�z�A search result that will reconstruct the ancestry for some graph heads.

Unlike SearchResult, this doesn't hold the complete search result in
memory, it just holds a description of how to generate it.
c�0�[U5UlX lg)z�Constructor.

:param heads: an iterable of graph heads.
:param repo: a repository to use to generate the ancestry for the given
    heads.
N)r#�heads�repo)rrerfs   rr)�PendingAncestryResult.__init__�s���u�%��
��	rc�F�[UR5S:�aD[[UR5SS5SSnUS[UR5S-
S3-
nO[UR5nSR	UR
RXR5$)Nr,r-z, <z
 more>...]z<{} heads:{} repo:{!r}>)r1rer2r3�formatr4rrf)r�
heads_reprs  rr8�PendingAncestryResult.__repr__�s����t�z�z�?�Q���d�4�:�:�.�r��2�3�C�R�8�J��C��D�J�J��!� 3�4�J�?�?�J��d�j�j�)�J�(�/�/��N�N�#�#�Z���
�	
rc�2�SUR[5S4$)a9Return a recipe that can be used to replay this search.

The recipe allows reconstruction of the same results at a later date.

:seealso SearchResult.get_recipe:

:return: A tuple ('proxy-search', start_keys_set, set(), -1)
    To recreate this result, create a PendingAncestryResult with the
    start_keys_set.
zproxy-searchr-)rerTrs rr<� PendingAncestryResult.get_recipe�s����
�
�C�E�2�6�6rc�B�S/nURUR5 U$)Nsancestry-of)�extendre)r�partss  rrI�(PendingAncestryResult.get_network_struct�s��� ��
���T�Z�Z� ��rc�T�URURR55$)ziSee SearchResult.get_keys.

Returns all the keys for the ancestry of the heads, excluding
NULL_REVISION.
)�	_get_keysrf�	get_graphrs rrL�PendingAncestryResult.get_keys�s ���~�~�d�i�i�1�1�3�4�4rc��[RnURUR5VVs/sHup4X2:wdMUcMUPM nnnU$s snnf�N)r�
NULL_REVISION�
iter_ancestryre)r�graphrx�key�parentsr(s      rrs�PendingAncestryResult._get_keys�sZ�� �.�.�
�#(�"5�"5�d�j�j�"A�
�"A����#�
�(/�
�"A�	
�
�
���
s�A�A�Ac��[RUR;a[UR5S:H$[UR5S:H$)rOr@r)rrxrer1rs rrP�PendingAncestryResult.is_empty�s:���!�!�T�Z�Z�/��t�z�z�?�a�'�'��t�z�z�?�a�'�'rc�h�URRU5n[X!-
UR5$)rS)re�unionrbrf)rrXrYs   rr^�PendingAncestryResult.refine�s,���Z�Z�%�%�j�1�
�$�Z�%6��	�	�B�Br)rerfN)rrrrrr)r8r<rIrLrsrPr^rrrrrbrb�s0����
�7��
5��(�Crrbc��\rSrSrSrSrSrg)�EmptySearchResult��zAn empty search result.c��g)NTrrs rrP�EmptySearchResult.is_empty�s��rrN)rrrrrrPrrrrr�r��s
��!�rr�c�B�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rg)�EverythingResult��zBA search result that simply requests everything in the repository.c��Xlgrw��_repo)rrfs  rr)�EverythingResult.__init__�s���
rc�b�SRURRUR5$)Nz{}({!r}))rir4rr�rs rr8�EverythingResult.__repr__�s#��� � ����!8�!8�$�*�*�E�Erc�,�[UR5erw)rr<rs rr<�EverythingResult.get_recipe�s��!�$�/�/�2�2rc��g)N)s
everythingrrs rrI�#EverythingResult.get_network_struct�s��rc���S[R;aBSSKJn [	UR
UR5(a[R"SS5 UR
R5$)N�evilr@)�remoterz6EverythingResult(RemoteRepository).get_keys() is slow.)
r�debug_flags�r��
isinstancer��RemoteRepositoryr�mutter_callsite�all_revision_ids)rr�s  rrL�EverythingResult.get_keys�sS���U�&�&�&� ��$�*�*�f�&=�&=�>�>��%�%��O���z�z�*�*�,�,rc��g)NFrrs rrP�EverythingResult.is_emptys��rc��[URR55nURU5 UR	U5 [X0R5$rw)rTr�r�rVrUrb)rrXrYres    rr^�EverythingResult.refinesB���D�J�J�/�/�1�2��
����%�
���Z� �$�U�J�J�7�7rr�Nr`rrrr�r��s)��L��F�3� �	-��8rr�c�(�\rSrSrSrSSjrSrSrg)�EverythingNotInOtheriz=Find all revisions in that are in one repo but not the other.c�(�XlX lX0lgrw)�to_repo�	from_repo�find_ghosts)rr�r�r�s    rr)�EverythingNotInOther.__init__s����"��&�rc�^�URRURURS9$)N)r�)r��search_missing_revision_idsr�r�rs rr�EverythingNotInOther.executes-���|�|�7�7��N�N��(8�(8�8�
�	
r)r�r�r�N)F)rrrrrr)rrrrrr�r�s��G�'�

rr�c�4�\rSrSrSrSSjrSrSrSrg)	�NotInOtherForRevsizAFind all revisions missing in one repo for a some specific heads.Nc�L�XlX lXPlX0lX@lX`lg)a�Constructor.

:param required_ids: revision IDs of heads that must be found, or else
    the search will fail with NoSuchRevision.  All revisions in their
    ancestry not already in the other repository will be included in
    the search result.
:param if_present_ids: revision IDs of heads that may be absent in the
    source repository.  If present, then their ancestry not already
    found in other will be included in the search result.
:param limit: maximum number of revisions to fetch
N)r�r�r��required_ids�if_present_ids�limit)rr�r�r�r�r�r�s       rr)�NotInOtherForRevs.__init__ s%��(��"��&��(��,���
rc	�"�[UR5S:�a([[UR5SS5SSS-nO[UR5nUR(aA[UR5S:�a([[UR5SS5SSS-nO[UR5nSRURRURURURUUUR5$)Nr,r-r.zL<{} from:{!r} to:{!r} find_ghosts:{!r} req'd:{!r} if-present:{!r}limit:{!r}>)r1r�r2r3r�rir4rr�r�r�r�)r�reqd_revs_repr�
ifp_revs_reprs   rr8�NotInOtherForRevs.__repr__;s����t� � �!�A�%�!�$�t�'8�'8�"9�"�1�"=�>�s��C�h�N�N�!�$�"3�"3�4�N����3�t�':�':�#;�a�#?� ��d�&9�&9�!:�2�A�!>�?���D�x�O�M� ��!4�!4�5�M�
[�
�&��N�N�#�#��N�N��L�L�������J�J�
�
	
rc��URRURURURUR
URS9$)N)�revision_idsr�r�r�)r�r�r�r�r�r�r�rs rr�NotInOtherForRevs.executeQsG���|�|�7�7��N�N��*�*��.�.��(�(��*�*�8�
�	
r)r�r�r�r�r�r�)NFN)	rrrrrr)r8rrrrrr�r�s��K�����6
�,
rr�c��U(d//S4$[U5n[[RRUR	555nURU5nUR
U5 [U5n[RU;a[RU;aUS-
nURU5nUR
U5 X$U4$)z5Transform a parent_map into SearchResult information.rr@)rT�	itertools�chain�
from_iterable�values�
differencerVr1rrxrW)�
parent_map�missing_keys�	start_set�result_parentsrGr'�
included_keyss       r�search_result_from_parent_mapr�[s�����2�q�y���J��I�����6�6�z�7H�7H�7J�K�L�N��)�)�)�4�I�����-��J��I����.�0��"�"�l�2�	�Q��	��*�*�>�:�M�
���
�.���*�*rc�&�[[U55nURU5n[5n[	U5nURR5H.nURU5nU(dMURU5 M0 URU5n	U	(aURU	5 M�![
a Of=fURR5H.nURU5nU(dMURU5 M0 XE4$)a�Given a parent map, run a _BreadthFirstSearcher on it.

Start at heads, walk until you hit exclude_keys. As a further improvement,
watch for any heads that you encounter while walking, which means they were
not heads of the search.

This is mostly used to generate a succinct recipe for how to walk through
most of parent_map.

:return: (_BreadthFirstSearcher, set(heads_encountered_by_walking))
)rr�_make_breadth_first_searcherrT�next�
StopIteration�_current_parentsr�rWrU�stop_searching_any)
r�rer&�g�s�found_heads�	next_revsr|�f_headsrGs
          r�_run_searchr�ws���	�!�*�-�.�A�	�&�&�u�-�A��%�K�
�	��Q��I��)�)�0�0�2�G��(�(��1�G��w��"�"�7�+�3�!�-�-�i�8�	��
� � ��+����	��	���%�%�,�,�.���$�$�W�-���7����w�'�/�
�>�s�B4�4
C�Cc��[U5n[5nUn[U5nU(ahUS:�abUS-n[5nURnUHn	U"X95 M URU5nURU5 UnU(aUS:�aMbU(aURU5 U$![a UR	U	5 M}f=f)z�Walk backwards (towards children) through the parent_map.

This finds 'heads' that will hopefully succinctly describe our search
graph.
rr@)r	rTrU�KeyError�addr�)
r��tip_keys�depth�	child_mapre�
current_roots�walked�children�children_update�ps
          r�_find_possible_headsr��s���"�*�-�I��E�E��M�
��
�F�
�E�A�I�
��
���5��"�/�/���A�
��	��-���&�&�v�.���
�
�h�� �
�#�E�A�I�$�
���]�#��L���
��	�	�!��
�s�
B,�,C�
Cc���U(d//S4$[XU5n[X[U55upVUR5upxn	U(a[U5R	U5nXx[U	54$)aTransform a parent_map that is searching 'tip_keys' into an
approximate SearchResult.

We should be able to generate a SearchResult from a given set of starting
keys, that covers a subset of parent_map that has the last step pointing at
tip_keys. This is to handle the case that really-long-searches shouldn't be
started from scratch on each get_parent_map request, but we *do* want to
filter out some of the keys that we've already seen, so we don't get
information that we already know about on every request.

The server will validate the search (that starting at start_keys and
stopping at stop_keys yields the exact key_count), so we have to be careful
to give an exact recipe.

Basic algorithm is:
    1) Invert parent_map to get child_map (todo: have it cached and pass it
       in)
    2) Starting at tip_keys, walk towards children for 'depth' steps.
    3) At that point, we have the 'start' keys.
    4) Start walking parent_map from 'start' keys, counting how many keys
       are seen, and generating stop_keys for anything that would walk
       outside of the parent_map.

:param parent_map: A map from {child_id: (parent_ids,)}
:param missing_keys: parent_ids that we know are unavailable
:param tip_keys: the revision_ids that we are searching
:param depth: How far back to walk.
r)r�r�rT�	get_stater�r1)
r�r�r�r�rer�r�r%r&r(s
          r�%limited_search_result_from_parent_mapr��si��:��2�q�y�� ��u�=�E� ��C��M�B�N�A�%&�[�[�]�"�J�d����_�/�/��<�
��S��Y�.�.r)rr�r�rrrrzrrr	�
repositoryr
rrrbr�r�r�r�r�r�r�r�rrr�<module>r�s���"0��%�%�A�A�-�0�0�"c@�'�c@�LMC�0�MC�`�,��$8�+�$8�N
�>�
�;
��;
�|+�8�D�D'/r

Youez - 2016 - github.com/yon3zu
LinuXploit