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/local/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/subversion.cpython-37.pyc
B

L��g�-�@s�ddlZddlZddlZddlmZmZmZddlmZm	Z	m
Z
mZmZddl
mZmZddlmZmZmZmZmZe�e�Ze�d�Ze�d�Ze�d�Ze�d	�ZGd
d�de�Ze�e�dS)�N)�List�Optional�Tuple)�
HiddenText�display_path�is_console_interactive�is_installable_dir�split_auth_from_netloc)�CommandArgs�make_command)�AuthInfo�RemoteNotFoundError�
RevOptions�VersionControl�vcsz
url="([^"]+)"zcommitted-rev="(\d+)"z\s*revision="(\d+)"z<url>(.*)</url>c	s�eZdZdZdZdZdZeee	d�dd��Z
eeeed�d	d
��Z
eeed�dd
��Zeeeeeeeeeeffd��fdd��Zeeeeeeefd��fdd��Zeeeeeed�dd��Zeeed�dd��Zeeeeeefd�dd��Zeeeee	d�dd��Zd2ee	dd��fd d!�
Zeed"fd#�d$d%�Zeed"fd#�d&d'�Zed#�d(d)�Zeeeedd*�d+d,�Z eeedd-�d.d/�Z!eeedd-�d0d1�Z"�Z#S)3�
Subversion�svnz.svn�checkout)zsvn+sshzsvn+httpz	svn+httpszsvn+svnzsvn+file)�
remote_url�returncCsdS)NT�)�clsrrr�@/tmp/pip-unpacked-wheel-hv55ucu3/pip/_internal/vcs/subversion.py�should_add_vcs_url_prefix$sz$Subversion.should_add_vcs_url_prefix)�revrcCsd|gS)Nz-rr)rrrr�get_base_rev_args(szSubversion.get_base_rev_args)�locationrc	Cs�d}x�t�|�D]�\}}}|j|kr2g|dd�<q|�|j�tj�||jd�}tj�|�s^q|�|�\}}||kr�|dk	s�t�|d}n|r�|�	|�s�g|dd�<qt
||�}qWt|�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�AssertionError�
startswith�max�str)	rr�revision�base�dirs�_�
entries_fn�dirurl�localrevrrr�get_revision,s$

zSubversion.get_revision)�netloc�schemercs|dkrt��||�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.
        �ssh)�super�get_netloc_and_authr	)rr3r4)�	__class__rrr7IszSubversion.get_netloc_and_auth)�urlrcs.t��|�\}}}|�d�r$d|}|||fS)Nzssh://zsvn+)r6�get_url_rev_and_authr()rr9r�	user_pass)r8rrr:Xs
zSubversion.get_url_rev_and_auth)�username�passwordrcCs(g}|r|d|g7}|r$|d|g7}|S)Nz
--usernamez
--passwordr)r<r=�
extra_argsrrr�
make_rev_args`szSubversion.make_rev_argscCsX|}x4t|�s8|}tj�|�}||krt�d|�t�qW|�|�\}}|dkrTt�|S)NzMCould not find Python project for directory %s (tried all parent directories))rrr#r!�logger�warningr
r&)rr�
orig_location�
last_locationr9Z_revrrr�get_remote_urlls
zSubversion.get_remote_urlc	Cs�ddlm}tj�||jd�}tj�|�rHt|��}|��}WdQRXnd}d}|�	d�sn|�	d�sn|�	d�r�t
ttj
|�d���}|dd=|dd	}d
d�|D�dg}n�|�	d�r�t�|�}	|	s�td
|����|	�d�}dd�t�|�D�dg}nryP|jdd|gddd�}
t�|
�}	|	dk	�s,t�|	�d�}dd�t�|
�D�}Wn |k
�rldg}}YnX|�r~t|�}nd}||fS)Nr)�InstallationErrorr��8�9�10z

�cSs,g|]$}t|�dkr|drt|d��qS)�	)�len�int)�.0�drrr�
<listcomp>�sz/Subversion._get_svn_url_rev.<locals>.<listcomp>z<?xmlzBadly formatted data: �cSsg|]}t|�d���qS)rQ)rM�group)rN�mrrrrP�s�infoz--xmlFT)�show_stdout�stdout_onlycSsg|]}t|�d���qS)rQ)rMrR)rNrSrrrrP�s)�pip._internal.exceptionsrErr#r$r!r%�open�readr(�list�mapr*�
splitlines�split�_svn_xml_url_re�search�
ValueErrorrR�_svn_rev_re�finditer�run_command�_svn_info_xml_url_rer'�_svn_info_xml_rev_rer))rrrE�entries_path�f�datar9r�revs�match�xmlrrrrr&�sB







zSubversion._get_svn_url_rev)�dest�namercCsdS)z&Always assume the versions don't matchFr)rrlrmrrr�is_commit_id_equal�szSubversion.is_commit_id_equalN)�use_interactivercs(|dkrt�}||_d|_t���dS)N)rro�_vcs_versionr6�__init__)�selfro)r8rrrq�s
zSubversion.__init__.)rcCs|d}|jdgddd�}|�|�s$dS|t|�d���d}|�d	�d�d
�}yttt|��}Wntk
rvdSX|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	--versionFT)rUrVrNr�-�.)	rcr(rLr]�	partition�tupler[rMr`)rr�version_prefix�version�version_list�parsed_versionrrr�call_vcs_version�s
zSubversion.call_vcs_versioncCs"|jdk	r|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)rpr{)rr�vcs_versionrrr�get_vcs_version�s


zSubversion.get_vcs_versioncCs&|jsdgS|��}|dkr"dgSgS)aCReturn 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
            - switch
            - update

        :return: A list of command line arguments to pass to ``svn``.
        z--non-interactive)rQ�z--force-interactive)ror})rr�svn_versionrrr�get_remote_call_options�s	z"Subversion.get_remote_call_options)rlr9�rev_options�	verbosityrcCsV|��}t�d||t|��|dkr*d}nd}td||��|��||�}|�|�dS)NzChecking out %s%s to %srz--quietrFr)�
to_displayr@rTrrr��to_argsrc)rrrlr9r�r��rev_display�flag�cmd_argsrrr�	fetch_news"
zSubversion.fetch_new)rlr9r�rcCs&td|��|��||�}|�|�dS)N�switch)rr�r�rc)rrrlr9r�r�rrrr�0szSubversion.switchcCs$td|��|��|�}|�|�dS)N�update)rr�r�rc)rrrlr9r�r�rrrr�:szSubversion.update)N)$�__name__�
__module__�__qualname__rmr!�	repo_name�schemes�classmethodr*�boolr�staticmethodrrr2rrr7rr:rr
r?rDrMr&rnrqr{r}r�rr�r�r��
__classcell__rr)r8rrs@,$	1 
r) �loggingr�re�typingrrr�pip._internal.utils.miscrrrrr	�pip._internal.utils.subprocessr
r� pip._internal.vcs.versioncontrolrr
rrr�	getLoggerr�r@�compiler^rarerdr�registerrrrr�<module>s




(