HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python3.9/site-packages/pip/_internal/vcs/__pycache__/subversion.cpython-39.pyc
a

?�fo0�@s�ddlmZddlZddlZddlZddlmZddlmZm	Z	m
Z
mZddlm
Z
ddlmZddlmZmZe�d�Ze�d	�Ze�d
�Ze�d�Zer�ddlmZmZdd
lmZddlmZddlmZmZe�e �Z!Gdd�de�Z"e�#e"�dS)�)�absolute_importN)�
indent_log)�display_path�is_console_interactive�rmtree�split_auth_from_netloc)�make_command)�MYPY_CHECK_RUNNING)�VersionControl�vcsz
url="([^"]+)"zcommitted-rev="(\d+)"z\s*revision="(\d+)"z<url>(.*)</url>)�Optional�Tuple)�CommandArgs)�
HiddenText)�AuthInfo�
RevOptionscs�eZdZdZdZdZdZedd��Ze	dd��Z
ed	d
��Ze�fdd��Ze�fd
d��Z
e	dd��Zedd��Zedd��Zedd��Zd(�fdd�	Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Z�ZS))�
Subversion�svnz.svn�checkout)rzsvn+sshzsvn+httpz	svn+httpszsvn+svncCsdS)NT�)�clsZ
remote_urlrr�@/usr/lib/python3.9/site-packages/pip/_internal/vcs/subversion.py�should_add_vcs_url_prefix+sz$Subversion.should_add_vcs_url_prefixcCsd|gS)Nz-rr)�revrrr�get_base_rev_args/szSubversion.get_base_rev_argsc	Cs�d}t�|�D]�\}}}|j|vr0g|dd�<q|�|j�tj�||jd�}tj�|�s\q|�|�\}}||kr||d}n|r�|�|�s�g|dd�<qt	||�}q|S)zR
        Return the maximum revision for all files under a given location
        rN�entries�/)
�os�walk�dirname�remove�path�join�exists�_get_svn_url_rev�
startswith�max)	r�locationZrevision�base�dirs�_Z
entries_fnZdirurlZlocalrevrrr�get_revision3s"

zSubversion.get_revisioncs"|dkrtt|��||�St|�S)z�
        This override allows the auth information to be passed to svn via the
        --username and --password options instead of via the URL.
        Zssh)�superr�get_netloc_and_authr)r�netloc�scheme��	__class__rrr-OszSubversion.get_netloc_and_authcs2tt|��|�\}}}|�d�r(d|}|||fS)Nzssh://zsvn+)r,r�get_url_rev_and_authr%)r�urlrZ	user_passr0rrr2\s
zSubversion.get_url_rev_and_authcCs(g}|r|d|g7}|r$|d|g7}|S)Nz
--usernamez
--passwordr)�username�passwordZ
extra_argsrrr�
make_rev_argseszSubversion.make_rev_argscCsR|}tj�tj�|d��sD|}tj�|�}||krt�d|�dSq|�|�dS)Nzsetup.pyzGCould not find setup.py for directory %s (tried all parent directories)r)rr!r#r"r�loggerZwarningr$)rr'Z
orig_locationZ
last_locationrrr�get_remote_urlps�zSubversion.get_remote_urlcCs�ddlm}tj�||jd�}tj�|�r\t|��}|��}Wd�q`1sP0Ynd}|�	d�s~|�	d�s~|�	d�r�t
ttj
|�d���}|dd=|dd	}d
d�|D�dg}n�|�	d��rt�|�}|s�td
jfit�����|�d�}dd�t�|�D�dg}nXz8|�dd|g�}	t�|	��d�}dd�t�|	�D�}Wn|�yldg}}Yn0|�r~t|�}
nd}
||
fS)Nr)�SubProcessErrorr��8�9Z10z

�cSs,g|]$}t|�dkr|drt|d��qS)�	)�len�int)�.0�drrr�
<listcomp>��z/Subversion._get_svn_url_rev.<locals>.<listcomp>z<?xmlzBadly formatted data: {data!r}�cSsg|]}t|�d���qS�rE�r@�group�rA�mrrrrC�rD�infoz--xmlcSsg|]}t|�d���qSrFrGrIrrrrC�s)Zpip._internal.exceptionsr9rr!r"rr#�open�readr%�list�map�str�
splitlines�split�_svn_xml_url_re�search�
ValueError�format�localsrH�_svn_rev_re�finditer�run_command�_svn_info_xml_url_re�_svn_info_xml_rev_rer&)rr'r9Zentries_path�f�datar3Zrevs�matchZxmlrrrrr$�sJ
(
��

�
��

zSubversion._get_svn_url_revcCsdS)z&Always assume the versions don't matchFr)r�dest�namerrr�is_commit_id_equal�szSubversion.is_commit_id_equalNcs,|durt�}||_d|_tt|���dS)N)r�use_interactive�_vcs_versionr,r�__init__)�selfrcr0rrre�s
zSubversion.__init__cCsvd}|�dg�}|�|�sdS|t|�d���d}|�d�d�d�}zttt|��}WntypYdS0|S)aQuery the version of the currently installed Subversion client.

        :return: A tuple containing the parts of the version information or
            ``()`` if the version returned from ``svn`` could not be parsed.
        :raises: BadCommand: If ``svn`` is not installed.
        z
svn, version z	--versionrNr�-�.)	rZr%r?rR�	partition�tuplerOr@rU)rfZversion_prefix�versionZversion_listZparsed_versionrrr�call_vcs_version�s
zSubversion.call_vcs_versioncCs"|jdur|jS|��}||_|S)a�Return the version of the currently installed Subversion client.

        If the version of the Subversion client has already been queried,
        a cached value will be used.

        :return: A tuple containing the parts of the version information or
            ``()`` if the version returned from ``svn`` could not be parsed.
        :raises: BadCommand: If ``svn`` is not installed.
        N)rdrl)rfZvcs_versionrrr�get_vcs_version�s

zSubversion.get_vcs_versioncCs&|jsdgS|��}|dkr"dgSgS)aXReturn options to be used on calls to Subversion that contact the server.

        These options are applicable for the following ``svn`` subcommands used
        in this class.

            - checkout
            - export
            - switch
            - update

        :return: A list of command line arguments to pass to ``svn``.
        z--non-interactive)rE�z--force-interactive)rcrm)rfZsvn_versionrrr�get_remote_call_options�s	z"Subversion.get_remote_call_optionscCs||�|�\}}t�d||�t��Ftj�|�r8t|�td|�	�|�
�||�}|�|�Wd�n1sn0YdS)z@Export the svn repository at the url to the destination locationz!Exporting svn repository %s to %s�exportN)Zget_url_rev_optionsr7rKrrr!r#rrro�to_argsrZ)rfr'r3�rev_options�cmd_argsrrrrps
�zSubversion.exportcCsD|��}t�d||t|��tdd|��|��||�}|�|�dS)NzChecking out %s%s to %srz-q)Z
to_displayr7rKrrrorqrZ)rfr`r3rrZrev_displayrsrrr�	fetch_new0s�

�zSubversion.fetch_newcCs&td|��|��||�}|�|�dS)N�switch�rrorqrZ�rfr`r3rrrsrrrru?s
�zSubversion.switchcCs$td|��|��|�}|�|�dS)N�updatervrwrrrrxGs
�zSubversion.update)N)�__name__�
__module__�__qualname__rarZ	repo_nameZschemes�classmethodr�staticmethodrr+r-r2r6r8r$rbrerlrmrorprtrurx�
__classcell__rrr0rr%s<






1
!r)$Z
__future__rZloggingr�reZpip._internal.utils.loggingrZpip._internal.utils.miscrrrrZpip._internal.utils.subprocessrZpip._internal.utils.typingr	Z pip._internal.vcs.versioncontrolr
r�compilerSrXr\r[�typingrr
rrrrZ	getLoggerryr7r�registerrrrr�<module>s,




-