\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZmZmZejdZeZejjZejjZy ejZWnek r(dZnXejZej Z ej!Z!ej"Z"e#Z$ej%dZ%ej%e%dZ&d Z'd Z(d Z)d Z*d Z+dZ,ddZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8dZ9ej:j;Z<e9Z=ej>rYdZ9ej:j;Z<dZ=nej?dkre@ddd gd!eAZBd"Z9ej:jCZ<e9Z=d#Z/d$Z0ndaDd%ZEd&ZFd'ZGd(ZHd)ZId*ZJd+ZKe jLe jMhZNd,ZOd-ZPdd.ZQdd/ZRd0ZSd1ZTd2ZUd3ZVddd4ZWd5ZXd6eYfd7YZZd8Z[d9Z\d:Z]d;Z^d<Z_dS(=i(tabsolute_importNi(t_(tencodingterrortpolicytpycompattosutilcC@s ttjd||fdS(Ns!hardlinks not supported: %s to %s(tOSErrorterrnotEINVAL(tsrctdst((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytoslink+s cC@sk|jdd}t|dkr.d|fS|djd}|rU||dfS|dd|dfS(sSame as posixpath.split, but faster >>> import posixpath >>> for f in [b'/absolute/path/to/file', ... b'relative/path/to/file', ... b'file_alone', ... b'path/to/directory/', ... b'/multiple/path//separators', ... b'/file_at_root', ... b'///multiple_leading_separators_at_root', ... b'']: ... assert split(f) == posixpath.split(f), f t/iti(trsplittlentrstrip(tpthttnh((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytsplit7s cC@stS(s@return true if it is safe to hold open file handles to hardlinks(tTrue(((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt openhardlinksMscC@stj|jS(s-return number of hardlinks for the given file(tostlstattst_nlink(tname((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytnlinksQscC@sz|d}tjdkr<|ddkrv|dd!}qvn:|jdrv|jdrvd|krv|dd!}n|S( s<parses the output produced by patch and returns the filenameitOpenVMSit`iit't (Rt sysplatformt startswithtendswith(t output_linetpf((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytparsepatchoutputUs *cC@sw|rd||fp|}d|d krHtjtd|nt|}|rsdt||f}n|S(sBuild argument list for sshs%s@%st-is4illegal ssh hostname or username starting with -: %ss-p %s %s(RtAbortRt shellquote(tsshcmdthosttusertporttargs((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytsshargs`s cC@stj|jd@dkS(s"check whether a file is executablei@i(RRtst_mode(tf((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytisexeckscC@stj|}|j}|rtj|st|d}|j}|jt|ytj ||Wqt k rt|d}|j ||jqXndStj|r tj |}t|t|d}|j ||jdt @}n|d@}|jdkrt|t|krt|d}|j}WdQXt|t|d}|j |WdQXn|r| rtj|||d@d?t @Bn$| r|rtj||d@ndS(Ntrbtwbii@ii$i(RRR0tstattS_ISLNKtopentreadtclosetunlinktsymlinkRtwritetreadlinktumaskRtbooltchmod(R1tltxtsttstfptdatatsx((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytsetflagsosB          '  $ cC@sytj|jd@}WnQtk rm}|jtjkrDn|}|dkr`t}n|dM}nXtj||dS(sCopy the file mode from the file at path src to dst. If src doesn't exist, we're using mode instead. If mode is None, we're using umask.iiN( RRR0RRtENOENTtNoneR>R@(R R tmodeR0tinst((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytcopymodes  c C@sytjtjBtjB}tjj|d}tjj|d}tjj|d}tjj|sy@tj|tjj|rt ||n t ||Wqt t fk rqXntjj |rtjj|d}tjj|d}ytj|j }Wn+t k rG}|jtjkrqnX||@dkrytj|j }WnPt k r}|jtjkrnt|djtj|j }nX||@dkrtSt|nt||} n |} d }tjd| d d \} } ztj| tj| j }||@dkrtj| |d @|Btj| j |@dkr|d k rtj| |d } ntSnWd | d k rt| nXWnt t fk rtSXd S( s} Check whether the given path is on a filesystem with UNIX-like exec flags Requires a directory (like /foo/.hg) s.hgtcachetstoret checkisexect checknoexecitwtdirtprefixs hg-checkexec-iN(R5tS_IXUSRtS_IXGRPtS_IXOTHRtpathtjointexiststmkdirRMtIOErrorRtisdirR0RRIR7R9RR:RJRtmkstempR@trenametFalse( RXt EXECFLAGStbasedirtcachedirtstoredirRPRQtmtetcheckdirtfhtfn((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt checkexecsf           c C@saxZtr\tjj|dd}tjj|d}tjj|rLtStjj|rg|}n |}d }tjdt j |dd}t j |}y]d }|d krt j d|dd}tjj |j}nbd}y,tjj||}t|d jWn-tk rI}|d tjkrCtSnXzyctj|||d kryt|n2ytj||Wntk rt|nXtSWn.tk r}|jtjkrwnnXWd |d k r|jnXWqtk rtStk rX}|jtjkrTtjj|rTt|ntSXqWd S( s?check whether the given path is on a symlink-capable filesystems.hgRNt checklinkRSRTs checklink-s hg-checklink-schecklink-targetRRiN(RRRXRYtislinkR]RJttempfiletmktempRtfsdecodetfsencodet namedtempfiletbasenameRR7R9R\RtEACCESR`R;R:R_RtEEXISTtAttributeErrortEIORZ( RXRcRkRgRtfdttargettfullpathRL((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyRks`           $ cC@sdS(sCheck that the base-relative path is a valid filename on this platform. Returns None if the path is ok, or a UI string describing the problem.N(RJ(RX((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytcheckosfilename?scC@sttdd|S(sGet the filesystem mount point from a directory (best-effort) Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc. tgetfsmountpointcS@sdS(N(RJ(RB((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytIs(tgetattrR(tdirpath((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyR{DscC@sttdd|S(sGet the filesystem type name from a directory (best-effort) Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc. t getfstypecS@sdS(N(RJ(RB((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyR|Ps(R}R(R~((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyRKscC@sdS(N((Rw((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt setbinaryRscC@s|S(N((RX((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytpconvertUscC@s|S(N((RX((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt localpathXscC@stjj||S(swReturns whether path1 and path2 refer to the same file. This is only guaranteed to work for files, not directories.(RRXtsamefile(tfpath1tfpath2((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyR[scC@s.tj|}tj|}|j|jkS(syReturns whether fpath1 and fpath2 are on the same device. This is only guaranteed to work for files, not directories.(RRtst_dev(RRtst1tst2((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt samedevice`scC@s |jS(N(tlower(RX((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytnormcasehscC@s0ytj|SWntk r+t|SXdS(s Normalize a filename for OS X-compatible comparison: - escape-encode invalid characters - decompose to NFD - lowercase - omit ignored characters [200c-200f, 202a-202e, 206a-206f,feff] >>> normcase(b'UPPER') 'upper' >>> normcase(b'Caf\xc3\xa9') 'cafe\xcc\x81' >>> normcase(b'\xc3\x89') 'e\xcc\x81' >>> normcase(b'\xb8\xca\xc3\xca\xbe\xc8.JPG') # issue3918 '%b8%ca%c3\xca\xbe%c8.jpg' N(Rt asciilowertUnicodeDecodeErrortnormcasefallback(RX((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyRrs cC@sy|jd}Wntk rd}d}t|}xy||kry&tj||}|t|7}Wn6tk rdt|||d!}|d7}nX||7}q>W|jd}nXtjd|j j d}tj |S(Nsutf-8Ris%%%02XitNFD( tdecodeRRRt getutf8chart ValueErrortordt unicodedatat normalizeRtencodethfsignoreclean(RXtuRDtposRAtctenc((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyRs"   !tcygwins/usr/bins/usr/libs /cygdrivetreversecC@st|}|dks+|dtjkr8tj|SxgtD]_}|j|sZq?nt|}||krv|S||tjkr?|tj||Sq?Wtj|S(Ni(RRtossepRtuppertcygwinmountpointsR"(RXtpathlentmptmplen((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyRs     cC@stS(N(R`(RX((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyRjscC@stS(N(R`(RX((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyRkscC@sgtjdkrd|Stdkr8tjdjan|rOt| rO|Sd|jddSdS(NRs"%s"s[^a-zA-Z0-9._/+-]s'%s'Rs'\''(RR!t_needsshellquoteRJtretcompiletsearchtreplace(RD((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyR)s cC@stj|dtS(s7Parse a command string in POSIX shell way (best-effort)tposix(Rt shlexsplitR(RD((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt shellsplitscC@s|S(N((tcmd((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt quotecommandscC@sRtjdkrtSytj|dtSWn tk rM}|jtjkSXdS(s5return False if pid dead, True if running or not sureRiN(RR!RRtkillRRtESRCH(tpidRL((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyttestpidscC@s|jtjkS(s;Return True if the stat object st is from the current user.(tst_uidRtgetuid(RC((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytisownerscC@stjdkr|Sd}tj|kr5||Stjdkr]|tjjd|SxTtjjddj tj D]1}|tjj||}|dk r|SqWdS(sFind executable for command searching like which does. If command is a basename then PATH is searched for command. PATH isn't searched if command is an absolute or relative path. If command isn't found None is returned.RcS@s/tjj|r+tj|tjr+|SdS(s'Will return executable if existing fileN(RRXtisfiletaccesstX_OKRJ(t executable((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt findexistings'tplan9s/bintPATHRN( RR!RRRXRYRtenvirontgetRt ospathsepRJ(tcommandRRXR((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytfindexes  ( cC@sdS(N((((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytsetsignalhandlerscc@stj}tj}x~|D]v}y.||}||jtkrLd}nWn:tk r}|jtj tj fkrnd}nX|VqWdS(sqStat each file in files. Yield each stat, or None if a file does not exist or has a type we don't care about.N( RRR5tS_IFMTR0t _wantedkindsRJRRRItENOTDIR(tfilesRtgetkindtnfRCterr((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt statfiless      cC@stjtjS(sreturn name of current user(RRptgetpasstgetuser(((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyR$scC@sV|dkrtj}nytjtj|dSWntk rQd|SXdS(siReturn the name of the user with the given uid. If uid is None, return the name of the current user.is%dN(RJRRRRptpwdtgetpwuidtKeyError(tuid((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytusername(s   cC@sO|dkrtj}nytj|dSWntk rJt|SXdS(skReturn the name of the group with the given gid. If gid is None, return the name of the current group.iN(RJRtgetgidtgrptgetgrgidRtstr(tgid((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt groupname4s   cC@sttj|jS(skReturn the list of members of the group with the given name, KeyError if the group does not exist. (tlistRtgetgrnamtgr_mem(R((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt groupmembers@scC@s*tjtjttddB|d|S(NtP_DETACHi(RtspawnvptP_NOWAITR}(R.((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt spawndetachedFscC@s tjd S(Ni(tsystargv(((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytgethgcmdJscC@stj|dS(N(RR[(RXt notindexed((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytmakedirMscC@sdS(N(RJ(tkeyRtscope((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt lookupregPscC@sdS(sHide current shell window. Used to hide the window opened when starting asynchronous child process under Windows, unneeded on other systems. N((((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt hidewindowSst cachestatcB@s5eZdZdZejZdZdZRS(cC@stj||_dS(N(RR5(tselfRX((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt__init__\scC@st|jjS(N(R?R5tst_ino(R((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt cacheable_scC@sy|jj|jjko|jj|jjko|jj|jjko|jj|jjko|jj|jjko|jj|jjko|jj|jjko|jtj|jtjko|jtj |jtj kSWnt k rt SXdS(N( R5R0RRRRtst_gidtst_sizetST_MTIMEtST_CTIMERuR`(Rtother((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt__eq__ds " cC@s ||k S(N((RR((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt__ne__ws(t__name__t __module__RRtobjectt__hash__RR(((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyR[s     cC@s|otj|jS(s(check whether a stat result is a symlink(R5R6R0(RC((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt statislinkzscC@s|o|jd@dkS(s1check whether a stat result is an executable filei@i(R0(RC((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyt statisexec~scC@sycx\traytj|||}PWqtjk r]}|jdtjkrWqnqXqWWntk rtnXtt t t |gS(sblock until something happens on any file descriptor This is a generic helper that will check for any activity (read, write. exception) and return the list of touched files. In unsupported cases, it will raise a NotImplementedErrori( RtselectRR.RtEINTRRtNotImplementedErrortsortedRtsettsum(tfdstresRL((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytpolls   cC@stj|tj}|tjO}tj|tj|}z`g}xFtry'|j}|sePn|j|WqFtk rPqFXqFWdj |SWdtj|tj|XdS(s$Read all available data from a pipe.RN( tfcntltF_GETFLRt O_NONBLOCKtF_SETFLRR8tappendR\RY(tpipetflagstoldflagstchunksRD((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytreadpipes     cC@s}tjj|\}}d}|rItjdtj}tj|n|j||rytj|tj |ndS(s1Bind the UNIX domain socket to the specified patht.N( RRXRRJR7t O_DIRECTORYtchdirtbindtfchdirR9(tsockRXtdirnameRrtbakwdfd((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pytbindunixsockets  (`t __future__RRRRRRRRRR5RRmRti18nRRRRRRt importmodRR7t posixfileRXtnormpathtsamestattlinkR RuR=R:R_t removedirsR`t expandglobsR>RRRR&R/R2RHRJRMRjRkRzR{RRRRRRRt normcasespecsRt normcasespecRtisdarwinR!RRRRRR)RRRRRRtS_IFREGtS_IFLNKRRRRRRRRRRRRRRRRR R(((s5/usr/lib64/python2.7/site-packages/mercurial/posix.pyts            "               -  R B