File: //proc/self/root/lib64/python2.7/site-packages/hgext/schemes.pyo
�
1�3\c @@ s d Z d d l m Z d d l Z d d l Z d d l m Z d d l m Z m Z m
Z
m Z m Z m
Z
m Z i Z e j e � Z d Z e j d � Z d e f d � � YZ d
� Z i d d 6d
d 6d d 6d d 6d d 6Z d � Z e d d e �d � � Z d S( 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 ( t absolute_importN( t _( t errort
extensionst hgt pycompatt registrart templatert utils ships-with-hg-cores \{(\d+)\}t ShortRepositoryc B@ s2 e Z d � Z d � Z d d d � Z d � Z RS( c C@ sd | | _ | | _ | | _ y( t t t t j | j � � � | _ Wn t k
r_ d | _ n Xd S( Ni (
t schemeR t urlt maxt mapt intt _partret findallt partst
ValueError( t selfR R
R ( ( s3 /usr/lib64/python2.7/site-packages/hgext/schemes.pyt __init__E s (
c C@ s d | j S( Ns <ShortRepository: %s>( R
( R ( ( s3 /usr/lib64/python2.7/site-packages/hgext/schemes.pyt __repr__N s c C@ s7 | j | � } t j | � j | | | d | d | �S( Nt intentst
createopts( t resolveR t _peerlookupt instance( R t uiR t createR R ( ( s3 /usr/lib64/python2.7/site-packages/hgext/schemes.pyR Q s !c C@ s� y | j d d � d } Wn* t k
rF t j t d � | � � n X| j d | j � } t | � | j k r� | d } | d } n d } t d � t | � D� � } d j | j
j | j | � � | S( Ns ://i s no '://' in scheme url '%s't /i����t c s@ s) | ] \ } } d | d | f Vq d S( s %di N( ( t .0t it v( ( s3 /usr/lib64/python2.7/site-packages/hgext/schemes.pys <genexpr>b s (
t splitt
IndexErrorR t AbortR R t lent dictt enumeratet joinR t processR ( R R R t tailt context( ( s3 /usr/lib64/python2.7/site-packages/hgext/schemes.pyR V s
N( t __name__t
__module__R R t NoneR R ( ( ( s3 /usr/lib64/python2.7/site-packages/hgext/schemes.pyR D s c C@ s; | r1 x( t D] } | j | d � r
t Sq
Wn | | � S( Nt :( t schemest
startswitht False( t origt pathR
( ( s3 /usr/lib64/python2.7/site-packages/hgext/schemes.pyt hasdrivelettere s
s http://hg.python.org/t pys https://bitbucket.org/t bbs ssh://hg@bitbucket.org/s bb+sshs https://{1}.googlecode.com/hg/t gcodes https://{1}.kilnhg.com/Repo/t kilnc C@ s� t j t | j d � � � t j t j � } x� t j � D]� \ } } t j r� t
| � d k r� | j � r� t j
j d | � r� t j t d � | | j � f � � n t | | | � t j | <q; Wt j t d t � d S( NR0 i s %s:\s5 custom scheme %s:// conflicts with drive letter %s:\
R5 ( R0 t updateR&