\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZddlZddlmZddlmZmZddlm Z m Z m Z m Z mZmZmZmZmZmZmZddlmZmZejZejZedZed Zd eefZd Zd Zd Z dZ!dZ"ej#Z$dddZ&e&dddddZ'e&dddddZ(e&ddddZ)e&dddddZ*e&dd ddd!Z+d"dd#d$d%d&gZ,d'Z-e&d(ddd)Z.e&d*d+ddd,Z e&d-d.ddd/Z/e&d0d1ddd2Z0d3Z1e&d%d4ddd5Z2e&d6ddd7Z3e&d8ddd9Z4e&d:d;ddd<Z5e&d"d=ddd>Z6e&d$d?ddd@Z7e&dAdBdddCZ8e&d#dDdddEZe&dFdddGZ9e&dHd6dddIZ:dS(Ji(tabsolute_importNi(t_(thextnullid( tbundle2t changegroupt discoverytencodingterrortexchangetpushkeytpycompatt streamclonetutiltwireprototypes(tprocutilt stringutils/incompatible Mercurial client; bundle2 requireds9see https://www.mercurial-scm.org/wiki/IncompatibleClients%s (%s) cC@sAx4|jD]&}|jdr |djdSq WddgS(sReturns a list of compression methods supported by the client. Returns a list of the compression methods supported by the client according to the protocol capabilities. If no such capability has been announced, fallback to the default of zlib and uncompressed. scomp=it,tzlibtnone(t getprotocapst startswithtsplit(tprototcap((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pytclientcompressionsupport-scC@s |jdS(sObtain the repo used for processing wire protocol commands. The intent of this function is to serve as a monkeypatch point for extensions that need commands to operate on different repo views under specialized circumstances. tserved(tfiltered(trepoRtcommand((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pytgetdispatchrepo;scC@sAt|||}t|\}}|j|}||||S(N(Rtcommandstgetargs(RRRtfunctspectargs((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pytdispatchDscC@ski}x2|D]*}||kr ||||<||=q q W|rgtjjd|dj|fn|S(Ns,warning: %s ignored unexpected arguments %s R(Rtstderrtwritetjoin(tcmdtkeystotherstoptstk((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pytoptionsLs   cC@s|j}d|jk}|rG|jdd|}|dk rG|Sn|jdd|}|dk rm|S|r|jdd}|dk r|Sn|jddS(sWhether a bundle1 operation is allowed from the server. Priority is: 1. server.bundle1gd. (if generaldelta active) 2. server.bundle1. 3. server.bundle1gd (if generaldelta active) 4. server.bundle1 t generaldeltatservers bundle1gd.%ss bundle1.%st bundle1gdtbundle1N(tuit requirementst configbooltNone(RtactionR2tgdtv((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pytbundle1allowedWs    tpushc@sdtjjDdkr8jtjnd krZtjdnd krodntt stjdnfd}|S( sDecorator to declare a wire protocol command. ``name`` is the name of the wire protocol command being provided. ``args`` defines the named arguments accepted by the command. It is a space-delimited list of argument names. ``*`` denotes a special value that says to accept all named arguments. ``permission`` defines the permission type needed to run this command. Can be ``push`` or ``pull``. These roughly map to read-write and read-only, respectively. Default is to assume command requires ``push`` permissions because otherwise commands not declaring their permissions could modify a repository that is supposed to be read-only. cS@s,h|]"\}}|ddkr|qS(tversioni((t.0R,R8((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pys s tbatchR:tpullsCinvalid wire protocol permission; got %s; expected "push" or "pull"ts:arguments for version 1 commands must be declared as bytesc@sKtkr"tjdntj|dddt<|S(Ns+%s command already registered for version 1R#t transportst permission(RRtProgrammingErrorRt commandentry(R!(R#tnameRAR@(sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pytregisters    (R:R>N( Rt TRANSPORTStitemstaddtSSHV2RRBR5t isinstancetbytes(RDR#RARE((R#RDRAR@sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pytwireprotocommandvs      R=scmds *RAR>cC@stj}|jd}g}x|jdD]}|jdd\}}i} xK|jdD]:} | rb| jd\} } || | || 5sR?tgen( RRgRtoutgoingRqtchangegroupmodtmakechangegrouptitert streamres(RRRRsRR((RsA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyR/s R~s bases headsc@sytj|}tj|}tj|d|d|}tj||ddtfdd}tjd|S(NRRRRc@s jdS(Ni(R((R(sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyR@sR?R(RRgRRRRRR(RRtbasesRqRR((RsA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyR~8s t debugwireargss one two *cC@s=tdddg|}tj|j||tj|S(NRtthreetfour(R-RRTRR t strkwargs(RRtonettwoR*R+((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyRCs c@sd}|jjd}|s%d Stj||}tj||}|sSd S|jjg|D]} j| ^qidt jg|D]} j| ^qdt t |} x|D]} | j d} t j jj | } | r| | kr| | krqnd| kry|| d}Wntk rUqnX|j|rkqntfd|Drqntfd|Drqqnd| kry|| d}Wntk rqnXtfd |Dsqqn| d }|jjd |y|jj|SWqtk rv|jjd |qqXqWd S(sReturn a file object for the first matching pullbundle. Pullbundles are specified in .hg/pullbundles.manifest similar to clonebundles. For each entry, the bundle specification is checked for compatibility: - Client features vs the BUNDLESPEC. - Revisions shared with the clients vs base revisions of the bundle. A bundle can be applied only if all its base revisions are known by the client. - At least one leaf of the bundle's DAG is missing on the client. - Every leaf of the bundle's DAG is part of node set the client wants. E.g. do not send a bundle of all changes if the client wants only one specific branch of many. cS@s/tg|jdD]}|jd^qS(NRMR(tsetRtdecode(tsth((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pytdecodehexstringZsspullbundles.manifestt inclusivet COMPRESSIONRqc3@s$|]}j|kVqdS(N(trev(R<R(tclt common_anc(sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pys wsc3@s9|]/}j|ko0j|kVqdS(N(R(R<R(RRt heads_anc(sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pys ysRc3@s$|]}j|kVqdS(N(R(R<R(RR(sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pys stURLssending pullbundle "%s" spullbundle "%s" not accessible N(RxRyR5R tparseclonebundlesmanifesttfilterclonebundleentriest changelogt ancestorsRtTrueRtgetR t compenginest _bundlenamest TypeErrortissubsettalltanyR2tdebugtopentIOError(RRR+tclheadsRqtcommonRtmanifestRZRt compformatstentrytcomptaltcompt bundle_headst bundle_basestpath((RRRsA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pytfind_pullbundleKsX  11            RPcC@stdtjj|}x|jD]\}}tj|}|dkrctj|||t bundlecapsshttp-v1thintRqRR/t pullbundles partial-pullRtprefer_uncompressedtdisablefullbundleRs%server has pull-based clones disableds/remove --pull if specified or upgrade MercurialRtprefercompresseds tmessages error:abort(0R-RtGETBUNDLE_ARGUMENTSR)RmRgRRRtFalsetbooltKeyErrorR9R tbundle2requestedRRDRStbundle2requiredRtAborttbundle2requiredmaintbundle2requiredhintRRRqtdiscardRR2R4RRRR t filechunkiterRtgetbundlechunksR RtbytestrRtbundle20RR5RVtaddpartt bundlepartt getchunks(RRR*R+R,R8tkeytypeRRRqRtbundleRtinfotchunkstexctbundlertmanargstadvargs((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyR|sx                   RqcC@s&|j}tjtj|dS(Ns (RqRRTRh(RRR((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyRqs thellocC@s#t||j}tjd|S(sfCalled as part of SSH handshake to obtain server info. Returns a list of lines describing interesting things about the server, in an RFC822-like format. Currently, the only one defined is ``capabilities``, which consists of a line of space separated tokens describing server abilities: capabilities: scapabilities: %s (RRURRT(RRR((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyRs tlistkeyst namespacecC@s:t|jtj|j}tjtj|S(N( RRRttolocalRGRRTt pushkeymodt encodekeys(RRRtd((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyRs$RbcC@svy4tj|}|j|}t|}d}Wn(tk r^}tj|}d}nXtjd||fS(Niis%d %s ( RRRzRt ExceptionRt forcebytestrRRT(RRRbR,R_Rjtsuccesstinst((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyRzs   snodes *cC@s8djd|jtj|D}tj|S(NR?cs@s!|]}|rdpdVqdS(t1RN((R<Rk((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pys s(R'R{RRgRT(RRRsR*R8((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyR{s t protocapsRcC@s:|jtjkr-t|jd|_ntjdS(NRNtOK(RDRtSSHV1RRt _protocapsRT(RRR((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyRssnamespace key old newc C@st|dkr^tj||kr^y |jdtj|}Wqmtk rZqmXntj|}|j@}|jtj|tj|tj||pt }WdQX|r|j nd}t j dt ||fS(Nisutf-8R?s%d %s(tlenRt escapestrRRRtUnicodeDecodeErrortmayberedirectstdioR RtgetvalueRRTtint(RRRRbtoldtnewtoutputRj((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyR s'  !t stream_outcC@stjtj|S(sIf the server supports streaming clone, it advertises the "stream" capability with a value representing the version and flags of the repo it is serving. Client checks to see if it understands the format. (RtstreamreslegacyR tgeneratev1wireproto(RR((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyRstunbundlec @stj|}|j}ytj||dd}z|j|jjddrfd}tj nd)\fd}t j dd\}|jj d tj|t jd d }xD]}j|qWjd tj|jd} t| tjrt|d  r|jd krntjtStjtdtntj|| |d|j }tj!|drtj"d|j#Stj$||r|j%ndSWd|XWntj&tjtj'fk r} t(| dt)syWqtjk rt*j+jd| | j,dk rt*j+jd| j,nt*j+j-tj$d |r|j%ndStj'k rtj.t j/| |r|j%ndSXnt0j1|j} x't(| dd*D]} | j2| qWyYyWnKtj3k r} t(| dd} | dk rd| j4dd+krn| j5d}|j6d| j7| j8dk r|j6d| j8dt)n| j9dk r|j6d| j9dt)n| j:dk r3|j6d| j:dt)n| j;dk r^|j6d | j;dt)n| j<dk r|j6d!| j<dt)qnXWn tj&k r} | j5d"}| j=dk r|j6d#| j=n| j>r|j6d$d%j?| j>qntjk ry} d&t@jA| fg}g}| j,dk rZ|jBd| j,fn| j2t0jCd'||n8tj'k r} | j5d(d&t@jA| fgnXtj"d| j#SXWdQXdS(,Nspreparing changescS@sdS(N(R5(((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyR/sR/tstreamunbundlec@sxD]}qWdS(N((Ri(tpayload(sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pytcleanup3s c@s-rjnr)tjndS(N(tclosetostunlink((tfpttempname(sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyR<s tprefixs hg-unbundle-s"redirecting incoming bundle to %s swb+iR:shttp-v1RRRRR?tduringunbundle2s abort: %s s(%s) t_bundle2salvagedoutputt _replycapsR Rs error:pushkeys in-reply-toRt mandatoryRbRR tretserror:unsupportedcontenttparttypetparamssRs error:abortserror:pushraced(NN(((DRRgR R t check_headst getpayloadR2R4R t chunkbufferR5R tmkstempRRtfdopentsysstrR&tseekt readbundleRJRt cg1unpackerR9RDRSRRRRRRtclientt safehasattrRRtpushresR tBundleValueErrort PushRacedtgetattrRRR%RtflushtpusherrRRRRt PushkeyFailedRtnewparttaddparamtpartidRRbRR R!R"R#R'RRRVR(RRRqt their_headsRRtfdRjRiRRRtoutt remotecapstpartterrpartRR((RRRsA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pyR(s           !    $ " (;t __future__RRti18nRtnodeRRR?RRRRRRR R RR R R RtutilsRRturlerrRnRRRRRR$R-R9t commanddictRR5RLR=RdRlRvRwRRRR~RRR|RqRRRzR{RRR(((sA/usr/lib64/python2.7/site-packages/mercurial/wireprotov1server.pytsT L        /.     *   BL