\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A ó 1è3\c@@s dZddlmZddlZddlZddlmZddlmZm Z m Z m Z m Z m Z mZiZe jeƒZdZejdƒZdefd „ƒYZd „Zid d 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(tselfR R R((s3/usr/lib64/python2.7/site-packages/hgext/schemes.pyt__init__Es   ( cC@s d|jS(Ns(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(RtuiR tcreateRR((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 bs( tsplitt IndexErrorRtAbortRRtlentdictt enumeratetjoinRtprocessR (RR Rttailtcontext((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|)s&  4 !