6hSrSSKJr SSKrSSKrSSKJr SSKJrJ r J r J r J r J r SSKJr 0r\ R""\5rSr\R&"S5r"S S 5rS rS S SSSS.rSSjrSr\"SSS9S5rg)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. ) annotationsN)_)error extensionshgpycompat registrar templater)urlutilsships-with-hg-cores{(\d+)\}c6\rSrSrSrSrSrS SjrSrSr g) ShortRepositoryHcX lX0lXl[[ [ [ RUR555Ulg![a SUlgf=f)Nr) schemer urlmaxmapint_partrefindallparts ValueError)selfrrr s //usr/lib/python3/dist-packages/hgext/schemes.py__init__ShortRepository.__init__IsL " Sgoodhh&?@ADJ DJ s;AA$#A$c SUR-$)Ns)r)rs r__repr__ShortRepository.__repr__Rs'$++55cURUR5nURUS9n[RR UR R5nUbUR"X/UQ70UD6$g)N)new_raw_location) resolverawloccopyr peer_schemesgetrr make_peer)ruipathargskwargsnew_urlclss rr(ShortRepository.make_peerUsa,,t{{+yy'y2oo!!$((//2 ?==;D;F; ;r Nc\URU5n[R"U5nUR=(d SnU[R ;a[R UnO8U[R ;a[R UnO[RnURXX4US9$)Nsfile)intents createopts) r#r rrrr& repo_schemes LocalFactoryinstance) rr)rcreater1r2urr.s rr5ShortRepository.instance]sll3 KK $W R__ $//&)C r &//&)C//C|| V  r cURSS5SnURSUR 5n[ U5UR :a USnUSSnOSn[U5VVs0sHupESUS--U_M nnnSRURRURU55U-$![a# [R"[ S5U-5ef=fs snnf)Ns://sno '://' in scheme url '%s'/r s%d) split IndexErrorrAbortrrlen enumeratejoinr processr)rrrtailivcontexts rr#ShortRepository.resolveks G))FA&q)C $ + u: "9D#2JED2;E2BC2B$!5AE?A%2BCxx..txxABTII G++a >?#EF F GDsB7'C'7-C$)rrr r)NN) __name__ __module__ __qualname____firstlineno__rrr(r5r#__static_attributes__r rr r Hs6   Jr r cpU(a([HnURUS-5(dM g U"U5$)N:F)schemes startswith)origr*rs rhasdriveletterrT{s1 Fv}-- :r shttp://hg.python.org/shttps://bitbucket.org/sssh://hg@bitbucket.org/shttps://{1}.googlecode.com/hg/shttps://{1}.kilnhg.com/Repo/)spysbbsbb+sshsgcodeskilnc4[R(a[U5S:XasUR5(a][R R SU-5(a5[S5nXUR54-n[R"U5egggg)z6check if a scheme conflict with a Windows drive letterr:s%s:\s5custom scheme %s:// conflicts with drive letter %s:\ N) r iswindowsr@isalphaosr*existsrupperrr?)rmsgs r_check_drive_letterr\s  K1  NN   GGNN8f, - -JK  ''kk# .   r c[R[URS555 [R "[R 5n[R5Hup#[U5 [R"U5RnU[R;a[X2U5[RU'Mc[X2U5[RU'M [ R""[S[$5 g)NsschemesrT)rQupdatedict configitemsr engineparseitemsr\r rrrr&r r3r wrapfunctionrT)r)trr url_schemes rextsetuprgs NN4z234)A}} F#[[%,,  (&5c1&EBOOF #&5c1&EBOOF # 'G%5~Fr sdebugexpandschemeT)norepoc L[R"U5RnU[R;a[RUnO[R R U5nUb&[U[5(aURU5nURUS-5 g)z3given a repo path, provide the scheme-expanded pathN ) r rrrr&r3r' isinstancer r#write)r)roptsrr.s r expandschemernsu[[  $ $F  oof%oo!!&) :c?;;kk#HHS5[r )rbytesreturnNone)__doc__ __future__rrXremercurial.i18nr mercurialrrrrr r mercurial.utilsr cmdtablecommand testedwithcompilerr rTrQr\rgrnrNr rr|s #J#     H % # **\ "0J0Jf $ $)/ ,    G d+ , r