File: //usr/local/lib/python3.7/site-packages/pip/_internal/vcs/__pycache__/git.cpython-37.pyc
B
L��g�F � @ s d dl Z d dlZd dlZd dlZd dlZd dlZd dlm Z m
Z
mZ d dlm
Z
mZ d dlmZmZmZ d dlmZ d dlmZmZmZmZmZmZmZ ejjZejjZe � e!�Z"e�#d�Z$e�#d�Z%e�#d ej&�Z'e(e)d
�dd�Z*G d
d� de�Z+e�,e+� dS )� N)�List�Optional�Tuple)�
BadCommand�InstallationError)�
HiddenText�display_path�hide_url)�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[^:]*)
$)�sha�returnc C s t t�| ��S )N)�bool�
HASH_REGEX�match)r � r �9/tmp/pip-unpacked-wheel-hv55ucu3/pip/_internal/vcs/git.py�looks_like_hash7 s r c s e Zd ZdZdZdZdZdZdZe e
ee
d�dd ��Ze
e
e
d
�dd�Zeed
f d�dd�Zee
ee
d�dd��Zee
e
eee
e
f d�dd��Zee
e
e
d�dd��Zee
eeed�dd��Zee
ee
e
d�dd��Ze
eeedd �d!d"�Ze
eedd�d#d$�Ze
eedd�d%d&�Zee
e
d�d'd(��Ze e
e
d)�d*d+��Zee
e
e
d,�d-d.��Z ed<e
ee
e
d,�d/d0��Z!ee
ee
d�d1d2��Z"ee
ee
ee
e#f d)�� fd3d4��Z$ee
dd�d5d6��Z%ee
ee
d�� fd7d8��Z&e e
e
d9�d:d;��Z'� Z(S )=�Git�gitz.git�clone)zgit+httpz git+httpszgit+sshzgit+gitzgit+file)�GIT_DIR�
GIT_WORK_TREE�HEAD)�revr c C s | gS )Nr )r r r r �get_base_rev_argsK s zGit.get_base_rev_args)�url�destr c C sJ | � t|��\}}|jsdS | �||j�s.dS t| �||j�d �}| S )NFr )�get_url_rev_optionsr r �is_commit_id_equalr �get_revision_sha)�selfr"