Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib64/python3.9/site-packages/hgext/__pycache__/ |
Upload File : |
a �+�b\ � @ s� d Z ddlmZ ddlZddlZddlmZ ddlmZm Z m Z mZmZm Z ddlmZ i Ze�e�ZdZe�d�ZG d d � d e�Zdd� Zd ddddd�Zdd� Zeddd�dd� �ZdS )a' extend schemes with shortcuts to repository swarms This extension allows you to specify shortcuts for parent URLs with a lot of repositories to act like a scheme, for example:: [schemes] py = http://code.python.org/hg/ After that you can use it like:: hg clone py://trunk/ Additionally there is support for some more complex schemas, for example used by Google Code:: [schemes] gcode = http://{1}.googlecode.com/hg/ The syntax is taken from Mercurial templates, and you have unlimited number of variables, starting with ``{1}`` and continuing with ``{2}``, ``{3}`` and so on. This variables will receive parts of URL supplied, split by ``/``. Anything not specified as ``{part}`` will be just appended to an URL. For convenience, the extension adds these schemes by default:: [schemes] py = http://hg.python.org/ bb = https://bitbucket.org/ bb+ssh = ssh://hg@bitbucket.org/ gcode = https://{1}.googlecode.com/hg/ kiln = https://{1}.kilnhg.com/Repo/ You can override a predefined scheme by defining a new scheme with the same name. � )�absolute_importN)�_)�error� extensions�hg�pycompat� registrar� templater)�urlutils ships-with-hg-cores {(\d+)\}c @ s. e Zd Zdd� Zdd� Zd dd�Zdd � ZdS )�ShortRepositoryc C sL || _ || _|| _ztttt�| j���| _W n t yF d| _Y n0 d S )Nr ) �schemer �url�max�map�int�_partre�findall�parts� ValueError)�selfr r r � r �3/usr/lib64/python3.9/site-packages/hgext/schemes.py�__init__H s zShortRepository.__init__c C s d| j S )Ns <ShortRepository: %s>)r )r r r r �__repr__Q s zShortRepository.__repr__Nc C s$ | � |�}t�|�j|||||d�S )N)�intents� createopts)�resolver �_peerlookup�instance)r �uir Zcreater r r r r r T s �zShortRepository.instancec C s� z|� dd�d }W n$ ty8 t�td�| ��Y n0 |� d| j�}t|�| jkrl|d }|d d� }nd}dd� t|�D �}d�| j � | j|��| S ) Ns ://� s no '://' in scheme url '%s'� /���� c S s i | ]\}}d |d |�qS )s %dr r )�.0�i�vr r r � <dictcomp>f r# z+ShortRepository.resolve.<locals>.<dictcomp>)�split� IndexErrorr �Abortr r �len� enumerate�joinr Zprocessr )r r r �tail�contextr r r r Z s zShortRepository.resolve)NN)�__name__� __module__�__qualname__r r r r r r r r r G s r c C s* |r"t D ]}|�|d �r dS q| |�S )N� :F)�schemes� startswith)Zorig�pathr r r r �hasdriveletterj s r7 s http://hg.python.org/s https://bitbucket.org/s ssh://hg@bitbucket.org/s https://{1}.googlecode.com/hg/s https://{1}.kilnhg.com/Repo/)s pys bbs bb+sshs gcodes kilnc C s� t �t| �d��� t�tj�}t �� D ]^\}}tj rtt |�dkrt|�� rttj �d| �rtt�td�||�� f ��t|||�tj |<