관리-도구
편집 파일: versioncontrol.cpython-38.pyc
U ʗReY � @ s� d Z ddlZddlZddlZddlZddlZddlmZm Z m Z mZmZm Z mZmZmZmZmZ ddlmZ ddlmZmZ ddlmZmZmZmZmZmZmZm Z ddl!m"Z"m#Z#m$Z$m%Z% ddl&m'Z' er�dd lm(Z( d gZ)e�*e+�Z,eee- ee- f Z.e-e/d�dd �Z0de-e-e-ee- e-d�dd�Z1e-e-ee- d�dd�Z2G dd� de3�Z4G dd� de3�Z5G dd� d�Z6G dd� d�Z7e7� Z8G dd� d�Z9dS )z)Handles all VCS (version control) support� N)� TYPE_CHECKING�Any�Dict�Iterable�Iterator�List�Mapping�Optional�Tuple�Type�Union)�SpinnerInterface)� BadCommand�InstallationError)� HiddenText�ask_path_exists� backup_dir�display_path�hide_url� hide_value�is_installable_dir�rmtree)�CommandArgs�call_subprocess�format_command_args�make_command)�get_url_scheme)�Literal�vcs��name�returnc C s* t | �}|dkrdS |ddddgtj kS )z3 Return true if the name looks like a URL. NF�http�https�file�ftp)r r �all_schemes)r �scheme� r( ��/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/vcs/versioncontrol.py�is_url9 s r* )�repo_url�rev�project_name�subdirr! c C s6 |� dd�}| � d|� d|� �}|r2|d|� �7 }|S )z� Return the URL for a VCS requirement. Args: repo_url: the remote VCS url, with any needed VCS prefix (e.g. "git+"). project_name: the (unescaped) project name. �-�_�@z#egg=z&subdirectory=)�replace)r+ r, r- r. �egg_project_name�reqr( r( r) �make_vcs_requirement_urlC s r5 )�location� repo_rootr! c C sV | }t | �s6| }tj�| �} | |krt�d|� dS qtj�|| �rHdS tj�| |�S )z� Find the the Python project's root by searching up the filesystem from `location`. Return the path to project root relative to `repo_root`. Return None if the project root is `repo_root`, or cannot be found. zOCould not find a Python project for directory %s (tried all parent directories)N)r �os�path�dirname�logger�warning�samefile�relpath)r6 r7 � orig_location� last_locationr( r( r) �(find_path_to_project_root_from_repo_rootU s �rA c @ s e Zd ZdS )�RemoteNotFoundErrorN)�__name__� __module__�__qualname__r( r( r( r) rB r s rB c s"