https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/hgext/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/hgext/__pycache__/schemes.cpython-310.pyc
o

�]Lb\�@s�dZddlmZddlZddlZddlmZddlmZm	Z	m
Z
mZmZm
Z
ddlmZiZe�e�ZdZe�d�ZGd	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)�urlutilsships-with-hg-cores{(\d+)\}c@s.eZdZdd�Zdd�Zd
dd�Zdd	�ZdS)�ShortRepositorycCsL||_||_||_ztttt�|j���|_WdSt	y%d|_YdSw)Nr)
�schemer	�url�max�map�int�_partre�findall�parts�
ValueError)�selfr
rr	�r�//usr/lib/python3/dist-packages/hgext/schemes.py�__init__Hs�zShortRepository.__init__cCs
d|jS)Ns<ShortRepository: %s>)r)rrrr�__repr__Qs
zShortRepository.__repr__NcCs$|�|�}t�|�j|||||d�S)N)�intents�
createopts)�resolver�_peerlookup�instance)r�uir
�createrrrrrrTs


�zShortRepository.instancecCs�z
|�dd�d}Wntyt�td�|��w|�d|j�}t|�|jkr4|d}|dd�}nd}dd�t|�D�}d�|j	�
|j|��|S)	Ns://�sno '://' in scheme url '%s'�/����cSsi|]\}}d|d|�qS)s%dr!r)�.0�i�vrrr�
<dictcomp>fsz+ShortRepository.resolve.<locals>.<dictcomp>)�split�
IndexErrorr�Abortrr�len�	enumerate�joinr	�processr
)rr
r�tail�contextrrrrZs�zShortRepository.resolve)NN)�__name__�
__module__�__qualname__rrrrrrrrrGs
	
rcCs*|rtD]}|�|d�rdSq||�S)N�:F)�schemes�
startswith)�orig�pathrrrr�hasdriveletterjs�r:shttp://hg.python.org/shttps://bitbucket.org/sssh://hg@bitbucket.org/shttps://{1}.googlecode.com/hg/shttps://{1}.kilnhg.com/Repo/)spysbbsbb+sshsgcodeskilncCs�t�t|�d���t�tj�}t��D]/\}}tj	r:t
|�dkr:|��r:tj
�d|�r:t�td�||��f��t|||�tj|<qt�tdt�dS)Nsschemesr!s%s:\s5custom scheme %s:// conflicts with drive letter %s:\
shasdriveletter)r6�update�dict�configitemsr	�engine�parse�itemsr�	iswindowsr,�isalpha�osr9�existsrr+r�upperrrr�wrapfunctionr
r:)r�trr
rrr�extsetup{s&����
��rHsdebugexpandschemeT)�norepocKs0t�|�}t|t�r|�|�}|�|d�dS)z3given a repo path, provide the scheme-expanded path�
N)rr�
isinstancerr�write)rr
�opts�reporrr�expandscheme�s


rO)�__doc__�
__future__rrC�re�mercurial.i18nr�	mercurialrrrrrr	�mercurial.utilsr
�cmdtable�command�
testedwith�compiler�objectrr:r6rHrOrrrr�<module>s,$ 

#	�	


https://t.me/RX1948 - 2025