HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/thread-self/root/proc/self/root/lib64/python2.7/site-packages/hgext/schemes.pyc
�
1�3\c@@sdZddlmZddlZddlZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZiZeje�ZdZejd�Zdefd	��YZd
�Zidd6d
d6dd6dd6dd6Zd�Zedde�d��ZdS(s'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.
i(tabsolute_importN(t_(terrort
extensionsthgtpycompatt	registrart	templatertutilsships-with-hg-cores	\{(\d+)\}tShortRepositorycB@s2eZd�Zd�Zddd�Zd�ZRS(cC@sd||_||_||_y(ttttj|j���|_Wnt	k
r_d|_nXdS(Ni(
tschemeRturltmaxtmaptintt_partretfindalltpartst
ValueError(tselfRR
R((s3/usr/lib64/python2.7/site-packages/hgext/schemes.pyt__init__Es			(
cC@sd|jS(Ns<ShortRepository: %s>(R
(R((s3/usr/lib64/python2.7/site-packages/hgext/schemes.pyt__repr__NscC@s7|j|�}tj|�j|||d|d|�S(Ntintentst
createopts(tresolveRt_peerlookuptinstance(RtuiRtcreateRR((s3/usr/lib64/python2.7/site-packages/hgext/schemes.pyRQs!cC@s�y|jdd�d}Wn*tk
rFtjtd�|��nX|jd|j�}t|�|jkr�|d}|d }nd}td�t|�D��}dj	|j
j|j|��|S(Ns://isno '://' in scheme url '%s't/i����tcs@s)|]\}}d|d|fVqdS(s%diN((t.0titv((s3/usr/lib64/python2.7/site-packages/hgext/schemes.pys	<genexpr>bs(
tsplitt
IndexErrorRtAbortRRtlentdictt	enumeratetjoinRtprocessR(RRRttailtcontext((s3/usr/lib64/python2.7/site-packages/hgext/schemes.pyRVs


N(t__name__t
__module__RRtNoneRR(((s3/usr/lib64/python2.7/site-packages/hgext/schemes.pyR	Ds			cC@s;|r1x(tD]}|j|d�r
tSq
Wn||�S(Nt:(tschemest
startswithtFalse(torigtpathR
((s3/usr/lib64/python2.7/site-packages/hgext/schemes.pythasdriveletteres

shttp://hg.python.org/tpyshttps://bitbucket.org/tbbsssh://hg@bitbucket.org/sbb+sshshttps://{1}.googlecode.com/hg/tgcodeshttps://{1}.kilnhg.com/Repo/tkilncC@s�tjt|jd���tjtj�}x�tj�D]�\}}tj	r�t
|�dkr�|j�r�tj
jd|�r�tjtd�||j�f��nt|||�tj|<q;Wtjtdt�dS(NR0is%s:\s5custom scheme %s:// conflicts with drive letter %s:\
R5(R0tupdateR&tconfigitemsRtenginetparsetitemsRt	iswindowsR%tisalphatosR4texistsRR$RtupperR	RRtwrapfunctionRR5(RttR
R((s3/usr/lib64/python2.7/site-packages/hgext/schemes.pytextsetupts'tdebugexpandschemetnorepocK@sEtj|�}t|t�r0|j|�}n|j|d�dS(s8given a repo path, provide the scheme-expanded path
    s
N(RRt
isinstanceR	Rtwrite(RRtoptstrepo((s3/usr/lib64/python2.7/site-packages/hgext/schemes.pytexpandscheme�s(t__doc__t
__future__RRAtretmercurial.i18nRt	mercurialRRRRRRRtcmdtabletcommandt
testedwithtcompileRtobjectR	R5R0RFtTrueRM(((s3/usr/lib64/python2.7/site-packages/hgext/schemes.pyt<module>)s&4
!