Uname:Linux developmentwebsite.ca 4.18.0-553.168.1.el8_10.x86_64 #1 SMP Thu Sep 24 18:05:46 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 173.249.148.11  /  Your IP : 216.73.216.20
Web Server : Apache/2.4.68 (AlmaLinux)
System : Linux developmentwebsite.ca 4.18.0-553.168.1.el8_10.x86_64 #1 SMP Thu Sep 24 18:05:46 UTC 2026 x86_64
User : devinter ( 1006)
PHP Version : 8.3.35
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /snap/certbot/5893/lib64/python3.12/site-packages/pip/_internal/vcs/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /snap/certbot/5893/lib64/python3.12/site-packages/pip/_internal/vcs/__pycache__/git.cpython-312.pyc
�

��jIK����ddlmZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZmZddlmZmZmZmZddlmZddlmZmZmZmZmZmZmZej>j@Z ej>jBZ!ejDe#�Z$ejJd	�Z&ejJd
�Z'ejJdejP�Z)dd�Z*Gd
�de�Z+ejXe+�y)�)�annotationsN)�replace)�Any)�
BadCommand�InstallationError)�
HiddenText�display_path�hide_url�	strtobool)�make_command)�AuthInfo�RemoteNotFoundError�RemoteNotValidError�
RevOptions�VersionControl�(find_path_to_project_root_from_repo_root�vcsz(^git version (\d+)\.(\d+)(?:\.(\d+))?.*$z^[a-fA-F0-9]{40}$a/^
    # Optional user, e.g. 'git@'
    (\w+@)?
    # Server, e.g. 'github.com'.
    ([^/:]+):
    # The server-side path. e.g. 'user/project.git'. Must start with an
    # alphanumeric character so as not to be confusable with a Windows paths
    # like 'C:/foo/bar' or 'C:\foo\bar'.
    (\w[^:]*)
    $c�>�ttj|��S�N)�bool�
HASH_REGEX�match)�shas �Q/root/parts/certbot/install/lib/python3.12/site-packages/pip/_internal/vcs/git.py�looks_like_hashr9s���
� � ��%�&�&�c����eZdZdZdZdZdZdZdZe	dd��Z
ed�fd��Zdd	�Z
dd
�Zed d��Zed!d��Zed"d
��Ze								d#d��Zed$d��Z										d%d�Z	d&									d%d�Z	d&									d%d�Zed'd��Ze	d(d��Zed)d��Zed*d+d��Zed d��Zed,�fd��Zed&d-d��Zed �fd��Ze	d.d��Z�xZ S)/�Git�gitz.git�clone)zgit+httpz	git+httpszgit+sshzgit+gitzgit+file)�GIT_DIR�
GIT_WORK_TREE�HEADc��|gSr���revs r�get_base_rev_argszGit.get_base_rev_argsMs	���u�rc���tjjd�r!|jdi�}d|d<d|d<||d<t�|�|i|��S)N�PIP_NO_INPUT�
extra_environ�0�GIT_TERMINAL_PROMPTzssh -oBatchMode=yes�GIT_SSH_COMMAND)�os�environ�get�super�run_command)�cls�args�kwargsr+�	__class__s    �rr3zGit.run_commandQsX���
�:�:�>�>�.�)�"�J�J���;�M�36�M�/�0�/D�M�+�,�&3�F�?�#��w�"�D�3�F�3�3rc���|jt|��\}}|jsy|j||j�syt	|j||j�d�}|S)NFr)�get_url_rev_optionsr
r'�is_commit_id_equalr�get_revision_sha)�self�url�dest�_�rev_options�is_tag_or_branchs      r�is_immutable_rev_checkoutzGit.is_immutable_rev_checkoutZsi���1�1�(�3�-�@���;������&�&�t�[�_�_�=�� �� 5� 5�d�K�O�O� L�Q� O�P��#�#�#rc���|jdgddd��}tj|�}|stj	d|�yt|j
d��t|j
d	��fS)
N�versionzgit versionFT)�command_desc�show_stdout�stdout_onlyzCan't parse git version: %sr%��)r3�GIT_VERSION_REGEXr�logger�warning�int�group)r<rDrs   r�get_git_versionzGit.get_git_versionhsq���"�"�
�K�&���	#�
��"�'�'��0����N�N�8�'�B���E�K�K��N�#�S����Q��%8�9�9rc��gd�}|j|ddd|��}|j�}|jd�r|td�dSy)zl
        Return the current branch, or None if HEAD isn't at a branch
        (e.g. detached HEAD).
        )zsymbolic-ref�-qr#�rHFT��extra_ok_returncodesrFrG�cwdzrefs/heads/N)r3�strip�
startswith�len)r4�locationr5�output�refs     r�get_current_branchzGit.get_current_branchusZ��.������!%����!�
���l�l�n���>�>�-�(��s�=�)�+�,�,�rc��|jd|g|ddd��}i}|j�jd�D]2}|jd�}|s�	|jdd	�
�\}}|||<�4d|��}d
|��}	|j|�}
|
�|
dfS|j|	�}
|
dfS#t$rt	d|����wxYw)z�
        Return (sha_or_none, is_branch), where sha_or_none is a commit hash
        if the revision names a remote branch or tag, otherwise None.

        Args:
          dest: the repository directory.
          rev: the revision name.
        zshow-refFT�ignore)rUrFrG�
on_returncode�
�
� rI)�maxsplitzunexpected show-ref line: zrefs/remotes/origin/z
refs/tags/)r3rV�split�rstrip�
ValueErrorr1)r4r>r'rZ�refs�line�ref_sha�ref_name�
branch_ref�tag_refrs           rr;zGit.get_revision_sha�s�����
������"�!�
�����L�L�N�(�(��.�	%�D��;�;�t�$�D���
H�$(�J�J�s�Q�J�$?�!���%�D��N�	%�,�C�5�1�
��s�e�$���h�h�z�"���?���;���h�h�w����U�|���!�
H�!�#=�d�X�!F�G�G�
H�s�B%�%B=c�f�|jd�ryt|�sy|j||�ryy)a$
        Return true if rev is a ref or is a commit that we don't have locally.

        Branches and tags are not considered in this method because they are
        assumed to be always available locally (which is a normal outcome of
        ``git clone`` and ``git fetch --tags``).
        zrefs/TF)rWr�
has_commit)r4r>r's   r�
_should_fetchzGit._should_fetch�s2���>�>�'�"���s�#���>�>�$��$��rc	��|j}|�J�|j||�\}}|�$|j|�}t||r|nd��}|St	|�st
j
d|�|j||�s|S|jtdd||j��|��|j|d��}|j|�}|S)	z�
        Resolve a revision to a new RevOptions object with the SHA1 of the
        branch, tag, or ref if found.

        Args:
          rev_options: a RevOptions object.
        N)�branch_namez:Did not find branch or tag '%s', assuming revision or ref.�fetchrQ�rU�
FETCH_HEADr&)�arg_revr;�make_newrrrK�inforor3r�to_args�get_revision)r4r>r=r@r'r�	is_branchs       r�resolve_revisionzGit.resolve_revision�s����!�!�������-�-�d�C�8���Y��?�%�.�.�s�3�K�!�+�9�C�RV�X�K����s�#��K�K�L��
�
� � ��s�+���	�����$��[�-@�-@�-B�C��	�	
�
���t���6��!�*�*�3�/���rc�0�|sy|j|�|k(S)z�
        Return whether the current commit hash equals the given name.

        Args:
          dest: the repository directory.
          name: a string name.
        F)ry)r4r>�names   rr:zGit.is_commit_id_equals ��������%��-�-rc��|j�}tjd||t|��|dkrd}n
|dk(rd}nd}|j	�dk\rJttjjdd	��s!|jtd
dg|�|�|����n|jtd
g|�|�|����|jr�|j|||�}t|dd�}tjd
||�|�K|j||j�s�tdd|j!��}|j||��nV|j#|�|k7rBd|��}	dd|d|	g}|j||��n"|j%|�}
|j'|
�}tjd||j�|j)||��y)NzCloning %s%s to %sr)z--quietrHr%)z	--verbosez
--progress)rI��*PIP_NO_PARTIAL_CLONE_FOR_BROKEN_GIT_SERVER�nor z--filter=blob:nonerqzRev options %s, branch_name %s�checkoutrQrszorigin/z-bz--trackzResolved %s to commit %s��	verbosity)�
to_displayrKrwr	rOrr/r0r1r3rr'r{�getattr�debugr:rxr\ryrv�update_submodules)r<r>r=r@r��rev_display�flagsrq�cmd_args�track_branchrs           r�	fetch_newz
Git.fetch_news���"�,�,�.�����(�#�{�L��<N�O���>�%1�E�
�!�^��E�/�E����!�W�,�Y��J�J�N�N�G��N�6
�
�����(�����	�
��
�
���\�'�E�E�E�3�E��E�F��?�?��/�/��c�;�G�K�!�+�}�d�C�K��L�L�9�;��T��"��.�.�t�[�_�_�E�+�"��#�+�+�-� �H�
�$�$�X�4�$�8��(�(��.�+�=�")��
�6������ ���� � ��t� �4��#�#�D�)�C�%�.�.�s�3�K����.��[�_�_�E�	
���t�y��9rc���|jtdd|�|��g}|dkr|jd�tdg|�|j����}|j||��|j	||��y)N�configzremote.origin.urlrsrrQr�r�)r3r�appendrxr��r<r>r=r@r��extra_flagsr�s       r�switchz
Git.switchQs���	
�����#6��<��	�	
�
����>����t�$��
�P�[�P�+�:M�:M�:O�P������t��,����t�y��9rc�b�g}|dkr|jd�|j�dk\r|jddg|�|��n|jdg|�|��|j|||�}t	ddg|�|j����}|j||��|j
||�	�y)
NrrQ)rH�	rrz--tagsrs�resetz--hardr�)r�rOr3r{rrxr�r�s       r�updatez
Git.updategs�������>����t�$����!�V�+����g�x�>�+�>�D��I����g�4��4�$��?��+�+�D�#�{�C�����
��
�
���!�	
��	
����t��,����t�y��9rc�"�|jgd�ddd|��}|j�}	|d}|D]}|j	d�s�|}n|jd�d	}|j
|j��S#t$rt�wxYw)
z�
        Return URL of the first remote encountered.

        Raises RemoteNotFoundError if the repository does not have a remote
        url configured.
        )r�z--get-regexpzremote\..*\.urlrRFTrSrzremote.origin.url rbrH)r3�
splitlines�
IndexErrorrrWrd�_git_remote_to_pip_urlrV)r4rY�stdout�remotes�found_remote�remoter=s       r�get_remote_urlzGit.get_remote_url�s������:�!%����!�
���#�#�%��	&�"�1�:�L��	�F�� � �!5�6�%���	�� � ��%�a�(���)�)�#�)�)�+�6�6���	&�%�%�	&�s�A>�>Bc��tjd|�r|Stjj	|�r#tj|�j�Stj|�}|r|jd�St|��)a8
        Convert a remote url from what git uses to what pip accepts.

        There are 3 legal forms **url** may take:

            1. A fully qualified url: ssh://git@example.com/foo/bar.git
            2. A local project.git folder: /path/to/bare/repository.git
            3. SCP shorthand for form 1: git@example.com:foo/bar.git

        Form 1 is output as-is. Form 2 must be converted to URI and form 3 must
        be converted to form 1.

        See the corresponding test test_git_remote_url_to_pip() for examples of
        sample inputs/outputs.
        z\w+://z
ssh://\1\2/\3)�rerr/�path�exists�pathlib�Path�as_uri�	SCP_REGEX�expandr)r=�	scp_matchs  rr�zGit._git_remote_to_pip_url�so��"�8�8�I�s�#��J�
�7�7�>�>�#���<�<��$�+�+�-�-��O�O�C�(�	���#�#�$4�5�5�!�#�&�&rc�Z�	|jddd|dzg|d��y#t$rYywxYw)zU
        Check if rev is a commit that is available in the local repository.
        �	rev-parserQz--verifyz	^{commit}F)rU�log_failed_cmdT)r3r)r4rYr's   rrnzGit.has_commit�sH��
		��O�O��d�J��k�0A�B��$�
�
���!�	��	�s��	*�*c�X�|�d}|jd|gdd|��}|j�S)Nr#r�FT�rFrGrU)r3rV)r4rYr'�current_revs    rryzGit.get_revision�sA���;��C��o�o�
�#�����	&�
��� � �"�"rc�\�|jddgdd|��j�}tjj	|�s tjj||�}tjj
tjj|d��}t||�S)z�
        Return the path to Python project root, relative to the repo root.
        Return None if the project root is in the repo root.
        r�z	--git-dirFTr�z..)r3rVr/r��isabs�join�abspathr)r4rY�git_dir�	repo_roots    r�get_subdirectoryzGit.get_subdirectory�s����/�/�
�+�&����	"�
�
�%�'�	��w�w�}�}�W�%��g�g�l�l�8�W�5�G��G�G�O�O�B�G�G�L�L��$�$?�@�	�7��)�L�Lrc���ddl}t|�\}}}}}|jd�r�|dt|j	d��}||j
j
|�jdd�j	d�z}	|jd�dz}
|d|
t||
d||	||f�z}d|vr>d	|vsJ�|jd
d�}t�
|�-|�\}}}|jdd
�}nt�
|�-|�\}}}|||fS)a9
        Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'.
        That's required because although they use SSH they sometimes don't
        work with a ssh:// scheme (e.g. GitHub). But we need a scheme for
        parsing. Hence we remove it again afterwards and return it as a stub.
        rN�file�/�\�+rHz://zfile:zgit+z
git+ssh://zssh://�)�urllib.request�urlsplit�endswithrX�lstrip�request�url2pathnamer�find�
urlunsplitr2�get_url_rev_and_auth)r4r=�urllib�scheme�netlocr��query�fragment�initial_slashes�newpath�
after_plusr'�	user_passr7s             �rr�zGit.get_url_rev_and_auth�s/���	�19��
�-����e�X��?�?�6�"�"�#;�c�$�+�+�c�*:�&;�%;�<�O�%����(C�(C�D�(I�(Q�(Q��c�)��f�S�k��G� ���S�)�A�-�J���*�%�
��
��$�f�g�u�h�G�)��C�����#�%�%�%��+�+�f�l�3�C�"'�'�">�s�"C��C��i��+�+�h��+�C�"'�'�">�s�"C��C��i��C��"�"rc���gd�}|dkr|jd�tjjtjj	|d��sy|j||��y)N)�	submoduler�z--initz--recursiverrQz.gitmodulesrs)r�r/r�r�r�r3)r4rYr��argvs    rr�zGit.update_submodulessS��?����>��K�K����w�w�~�~�b�g�g�l�l�8�]�C�D�������	�	
rc���t�|�|�}|r|S	|jddg|dddd��}tjj|jd��S#t$rtjd|�Yyt$rYywxYw)	Nr�z--show-toplevelFT�raise)rUrFrGr_r�zKcould not determine if %s is under git control because git is not availablez
)r2�get_repository_rootr3rrKr�rr/r��normpathre)r4rY�loc�rr7s    �rr�zGit.get_repository_roots�����g�)�(�3����J�	�����/�0��!� �%�$�
 ��A�"�w�w������� 0�1�1���	��L�L�/��
�
� �	��	�s�A�B	�>B	�B	c��y)zEIn either https or ssh form, requirements must be prefixed with git+.Tr%)�repo_urls r�should_add_vcs_url_prefixzGit.should_add_vcs_url_prefix8s��r)r'�str�returnz	list[str])r5rr6rr�r�)r=r�r>r�r�r)r�ztuple[int, ...])rYr�r��
str | None)r>r�r'r�r�ztuple[str | None, bool])r>r�r'r�r�r)r>r�r=rr@rr�r)r>r�r}r�r�r)
r>r�r=rr@rr�rMr��None)r)rYr�r�r�)r=r�r�r�)rYr�r'r�r�rr)rYr�r'r�r�r�)r=r�r�z tuple[str, str | None, AuthInfo])rYr�r�rMr�r�)r�r�r�r)!�__name__�
__module__�__qualname__r}�dirname�	repo_name�schemes�
unset_environ�default_arg_rev�staticmethodr(�classmethodr3rBrOr\r;ror{r:r�r�r�r�r�rnryr�r�r�r�r��
__classcell__)r7s@rrr=s4����D��G��I��G�1�M��O������4��4�$�:�����0�+��+�Z����,�+��+�'�+�6@�+�	�+��+�Z�.��.�?:��?:�(�?:�7A�?:�NQ�?:�	
�?:�L�:��:��:� �	:�
�:�
�
:�6�:��:��:� �	:�
�:�
�
:�<�7��7�:�'��'�<�
��
��	#��	#��M��M�"�#��#�@�
��
��2��2�0���rr)rr�r�r)-�
__future__r�logging�os.pathr/r�r��urllib.parser��dataclassesr�typingr�pip._internal.exceptionsrr�pip._internal.utils.miscrr	r
r�pip._internal.utils.subprocessr� pip._internal.vcs.versioncontrolr
rrrrrr�parser�r��	getLoggerr�rK�compilerJr�VERBOSEr�rr�registerr%rr�<module>r�s���"����	����B�R�R�7�����<�<� � ��
�\�\�
$�
$�
�
��	�	�8�	$���B�J�J�����R�Z�Z�+�
,�
�
�B�J�J�		��J�J�
�	�'�~�.�~�B
����S�r

Youez - 2016 - github.com/yon3zu
LinuXploit