\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@suddlmZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z m Z mZmZdZdefdYZd efd YZeZd efd YZd eefdYZeZdeefdYZdefdYZdefdYZdefdYZdefdYZdS(i(tabsolute_importNi(t_(tencodingterrortpathutiltpycompattutilc@sBfd}|s>tjtj|ndS(sAvoid file stat ambiguity forcibly This function causes copying ``path`` file, if it is owned by another (see issue5418 and issue5584 for detail). c@s2tjj}|j p1|jS(N(Rtfilestattfrompathtisambigt avoidambig(tnewstat(toldstattpath(s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyt checkandavoidsN(Rtrenamet mktempcopy(R R R((R R s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyt _avoidambigs t abstractvfscB@seZdZdZdZddZejdZdZ ddZ e dZ d e d Z d Zd Zd ZdZd1dZdZd1dZd1dZd1dZd1dZdZdZd1dZd1dZd1dZd1edZd1d1dZ dZ!d1dZ"ddd1d Z#d1d1d1d!Z$d"Z%e d#Z&d$Z'd1d%Z(d1d&Z)d1e e d'Z*d(Z+d1d)Z,d1d*Z-d1d+Z.d1e ed,Z/d1d1d-Z0d1d1d.Z1e2j3d/d0Z4RS(2s+Abstract base class; cannot be instantiatedcO@s tdtt|dS(s7Prevent instantiation; don't call this from subclasses.sattempted instantiating N(tNotImplementedErrortstrttype(tselftargstkwargs((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyt__init__-scC@sCy|j|SWn+tk r>}|jtjkr?q?nXdS(s3gracefully return an empty string for missing filest(treadtIOErrorterrnotENOENT(RR tinst((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyttryread1s  trbcC@sIy|j|d|SWn+tk rD}|jtjkrEqEnXgS(s2gracefully return an empty array for missing filestmode(t readlinesRRR(RR R"R((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyt tryreadlines:s  cC@s|jS(sOpen ``path`` file, which is relative to vfs root. Newly created directories are marked as "not to be indexed by the content indexing service", if ``notindexed`` is specified for "write" mode access. (t__call__(R((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pytopenCscC@s&||d}|jSWdQXdS(NR!(R(RR tfp((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRMscC@s)||d|}|jSWdQXdS(NR"(R#(RR R"R'((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR#QscK@s2||dd||}|j|SWdQXdS(Ntwbtbackgroundclose(twrite(RR tdataR)RR'((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR*UsR(cC@s2||d|d|}|j|SWdQXdS(NR"t notindexed(t writelines(RR R+R"R,R'((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR-YscC@s)||d}|j|SWdQXdS(Ntab(R*(RR R+R'((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pytappend]scC@stjj|S(sreturn base element of a path (as os.path.basename would do) This exists to allow handling of strange encoding if needed.(tosR tbasename(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR1ascC@stj|j||S(N(R0tchmodtjoin(RR R"((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR2gscC@stjj|S(sreturn dirname element of a path (as os.path.dirname would do) This exists to allow handling of strange encoding if needed.(R0R tdirname(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR4jscC@stjj|j|S(N(R0R texistsR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR5pscC@s tj|S(N(Rtfstat(RR'((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR6sscC@stjj|j|S(N(R0R tisdirR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR7vscC@stjj|j|S(N(R0R tisfileR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR8yscC@stjj|j|S(N(R0R tislinkR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR9|scC@sMy|j|}Wntk r'tSX|j}tj|pLtj|S(shreturn whether path is a regular file or a symlink Unlike isfile, this doesn't follow symlinks.(tlstattOSErrortFalsetst_modetstattS_ISREGtS_ISLNK(RR tstR"((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyt isfileorlinks   cG@stjj|S(sjoin various elements of a path together (as os.path.join would do) The vfs base is not injected so that path stay relative. This exists to allow handling of strange encoding if needed.(R0R R3(Rtpaths((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pytreljoinscC@stjj|S(ssplit top-most element of a path (as os.path.split would do) This exists to allow handling of strange encoding if needed.(R0R tsplit(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyREscC@stjj|j|S(N(R0R tlexistsR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRFscC@stj|j|S(N(R0R:R3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR:scC@stj|j|S(N(R0tlistdirR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRGscC@stj|j||S(N(RtmakedirR3(RR R,((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRHscC@stj|j||S(N(RtmakedirsR3(RR R"((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRIscC@stj||j|S(N(RtmakelockR3(RtinfoR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRJscC@stj|j|S(N(R0tmkdirR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRLsRttmpcC@sotjd|d|d|j|\}}tj|\}}|ra|tjj||fS||fSdS(Ntsuffixtprefixtdir(RtmkstempR3RRER0R (RRNRORPtfdtnametdnametfname((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRQs cC@stj|j|||S(N(RRGR3(RR R>tskip((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pytreaddirscC@stj|j|S(N(RtreadlockR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRXscC@sx|j|}|j|}|o3tjj|}|rh|jrhtj||}t|||Stj||S(sRename from src to dst checkambig argument is used with util.filestat, and is useful only if destination file is guarded by any lock (e.g. repo.lock or repo.wlock). To avoid file stat ambiguity forcibly, checkambig=True involves copying ``src`` file, if it is owned by another. Therefore, use checkambig=True only in limited cases (see also issue5418 and issue5584 for detail). (R3RRRR>RR(Rtsrctdstt checkambigtsrcpathtdstpathR tret((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRs  cC@stj|j|S(N(RtreadlinkR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR_scC@stj|j|S(s@Remove a leaf directory and all empty intermediate ones (Rt removedirsR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR`scC@stj|j|S(sRemove an empty directory.(R0trmdirR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRascC@s:|rd}nd}tj|j|d|d|S(sqRemove a directory tree recursively If ``forcibly``, this tries to remove READ-ONLY files, too. cS@st|tjk rntj|}|jtj@dkr@ntj|tj|jtjBtj|dS(Ni(R0tremoveR>R=tS_IWRITER2tS_IMODE(tfunctionR texcinfots((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pytonerrors#t ignore_errorsRhN(tNonetshutiltrmtreeR3(RR RitforciblyRh((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRls  cC@stj|j|||S(N(RtsetflagsR3(RR tltx((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRnscC@stj|j|S(N(R0R>R3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR>scC@stj|j|S(N(RtunlinkR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRqscC@stj|j|dS(s7Attempt to remove a file, ignoring missing file errors.N(Rt tryunlinkR3(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRrscC@s"tj|j|d|d|S(Nt ignoremissingRa(Rt unlinkpathR3(RR RsRa((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRtscC@stj|j||S(N(R0tutimeR3(RR tt((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRuscc@sxtjj|jd}ttj|}xAtj|j|d|D]!\}}}||||fVqOWdS(s/Yield (dirpath, dirs, files) tuple for each directories under path ``dirpath`` is relative one from the root of this vfs. This uses ``os.sep`` as path separator, even you specify POSIX style ``path``. "The root of this vfs" is represented as empty ``dirpath``. RhN( R0R tnormpathR3RjtlenRt normasprefixtwalk(RR Rhtroott prefixlentdirpathtdirstfiles((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRzs .ic c@sttjtjs!dVdSt|d|}t|ddr]tjtdnt |d|&}z||_ |VWdd|_ XWdQXdS(sAllow files to be closed asynchronously. When this context manager is active, ``backgroundclose`` can be passed to ``__call__``/``open`` to result in the file possibly being closed asynchronously, on a background thread. Ntvfst_backgroundfileclosers-can only have 1 active background file closert expectedcount( t isinstancet threadingt currentThreadt _MainThreadtgetattrRjRtAbortRtbackgroundfilecloserR(RtuiRRtbfc((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pytbackgroundclosings   N(5t__name__t __module__t__doc__RR R$Rt propertycacheR&RR#R<R*R-R/R1R2R4RjR5R6R7R8R9RBRDRERFR:RGtTrueRHRIRJRLRQRWRXRR_R`RaRlRnR>RqRrRtRuRzt contextlibtcontextmanagerR(((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR*sZ                               RcB@s}eZdZeeeedZejdZejdZ dZ deeeeedZ dZ dZ RS( skOperate files relative to a base directory This class is used to hide the details of COW semantics and remote file access from higher level code. 'cacheaudited' should be enabled only if (a) vfs object is short-lived, or (b) the base directory is managed by hg and considered sort-of append-only. See pathutil.pathauditor() for details. cC@s|rtj|}n|r3tjj|}n||_||_|ritj|jd||_ ndd|_ d|_ d|_ dS(NtcachedcS@stS(N(R(R R"((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pytCs( Rt expandpathR0R trealpathtbaset_auditRt pathauditortauditRjt createmodet _trustnlink(RRRt cacheauditedRR((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR8s   cC@stj|jS(N(Rt checklinkR(R((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyt _cansymlinkGscC@stj|jS(N(Rt checkexecR(R((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyt_chmodKscC@s8|jdks|j rdStj||jd@dS(Ni(RRjRR0R2(RRS((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyt _fixfilemodeOstrcC@s|rY|jrCtj|}|rCtjd||fqCn|j|d|n|j|} d|kr|d7}nd} |dkr tj| \} } | r |rtj| |j |tj | ||j d|Sy`d|kr tj | d } n:tj | )tj | } | d kr?d } nWd QXWnMttfk r} | jtjkrvnd } tj| |j |nX| d kr |jd kr| d kptj| |_n| d ks|j rtjtj| | qq q ntj | |}| d kr;|j| n|rx|dkritjtd |nt|}n|rttjtjr|jstjtdnt||j}n|S(s+Open ``path`` file, which is relative to vfs root. Newly created directories are marked as "not to be indexed by the content indexing service", if ``notindexed`` is specified for "write" mode access. If ``backgroundclose`` is passed, the file may be closed asynchronously. It can only be used if the ``self.backgroundclosing()`` context manager is active. This should only be specified if the following criteria hold: 1. There is a potential for writing thousands of files. Unless you are writing thousands of files, the performance benefits of asynchronously closing files is not realized. 2. Files are opened exactly once for the ``backgroundclosing`` active duration and are therefore free of race conditions between closing a file on a background thread and reopening it. (If the file were opened multiple times, there could be unflushed data because the original file handle hasn't been flushed/closed yet.) ``checkambig`` argument is passed to atomictemplfile (valid only for writing), and is useful only if target file is guarded by any lock (e.g. repo.lock or repo.wlock). To avoid file stat ambiguity forcibly, checkambig=True involves copying ``path`` file opened in "append" mode (e.g. for truncation), if it is owned by another. Therefore, use combination of append mode and checkambig=True only in limited cases (see also issue5418 and issue5584 for detail). s%s: %rR"tbiRR!R[twiiiNs>implementation error: mode %s is not valid for checkambig=TruesSbackgroundclose can only be used when a backgroundclosing context manager is active(RR!(RR!( RRtcheckosfilenameRRRR3RERIRtatomictempfileRqt posixfiletnlinksR;RRRRRjt checknlinkRRRRtcheckambigatclosingRRRRRtdelayclosedfile(RR R"t atomictempR,R)R[t auditpathRtftnlinkR4R1teR'((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR%Tsb         !%    cC@s|j||j|}tj|tjtjj||j|j rytj ||Wqt k r}t |j t d|tj|jf|qXn|j||dS(Nscould not symlink to %r: %s(RR3RRrRIR0R R4RRtsymlinkR;RRRt strtolocaltstrerrorR*(RRYRZtlinknameterr((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRs   cG@s*|rtjj|j||S|jSdS(N(R0R R3R(RR tinsidef((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR3s(RRRRR<RRRRRRR%RR3(((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR.s     ] tproxyvfscB@s2eZdZedZejdZRS(cC@s ||_dS(N(R(RR((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRscC@s |jjS(N(Rtoptions(R((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRscC@s||j_dS(N(RR(Rtvalue((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRs(RRRtpropertyRtsetter(((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRs t filtervfscB@s)eZdZdZdZdZRS(s4Wrapper vfs for filtering filenames with a function.cC@stj||||_dS(N(RRt_filter(RRtfilter((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRscO@s|j|j|||S(N(RR(RR RR((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR%scG@sB|r.|jj|j|jj||S|jj|SdS(N(RR3RRD(RR R((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR3s((RRRRR%R3(((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRs  t readonlyvfscB@s,eZdZdZddZdZRS(s#Wrapper vfs preventing any writing.cC@stj||dS(N(RR(RR((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRsRcO@s:|dkr$tjtdn|j||||S(NRR!sthis vfs is read only(RR!(RRRR(RR R"Rtkw((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR%s cG@s|jj||S(N(RR3(RR R((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR3s(RRRRR%R3(((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRs  t closewrapbasecB@sMeZdZdZdZdZdZdZdZdZ RS(saBase class of wrapper, which hooks closing Do not instantiate outside of the vfs layer. cC@stj|d|dS(Nt_origfh(tobjectt __setattr__(Rtfh((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRscC@st|j|S(N(RR(Rtattr((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyt __getattr__scC@st|j||S(N(tsetattrR(RRR((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRscC@st|j|S(N(tdelattrR(RR((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyt __delattr__scC@s|jj|S(N(Rt __enter__(R((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRs cC@s tdtt|dS(Nsattempted instantiating (RRR(Rtexc_typet exc_valuetexc_tb((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyt__exit__ scC@s tdtt|dS(Nsattempted instantiating (RRR(R((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pytcloses( RRRRRRRRRR(((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRs      RcB@s)eZdZdZdZdZRS(sfProxy for a file object whose close is delayed. Do not instantiate outside of the vfs layer. cC@s-tt|j|tj|d|dS(Nt_closer(tsuperRRRR(RRtcloser((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRscC@s|jj|jdS(N(RRR(RRRR((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRscC@s|jj|jdS(N(RRR(R((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRs(RRRRRR(((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRs  RcB@s>eZdZddZdZdZdZdZRS(sCCoordinates background closing of file handles on multiple threads.ic C@s t|_t|_g|_d|_tj}|jdd|}|sLdS|j dd}|dkrz||krzdS|j dd}|j dd}|j d|tj j d||_ t|_xIt|D];}tjd |jd d } |jj| | jqWdS( NtworkerR)tbackgroundcloseminfilecountitbackgroundclosemaxqueuetbackgroundclosethreadcounts0starting %d threads for background file closing tmaxsizettargetRStbackgroundcloser(R<t_runningt_enteredt_threadsRjt_threadexceptionRt iswindowst configboolt configinttdebugtqueuetQueuet_queueRtrangeRtThreadt_workerR/tstart( RRRtdefaultenabledtenabledt minfilecounttmaxqueuet threadcounttiRv((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR#s*       cC@s t|_|S(N(RR(R((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRHs cC@s+t|_x|jD]}|jqWdS(N(R<RRR3(RRRRRv((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRLs cC@sx}tryL|jjdtdd}y|jWntk rS}||_nXWqtjjk r{|j s|Pq|qXqWdS(sMain routine for worker thread.tblockttimeoutg?N( RRtgetRt ExceptionRRRtEmptyR(RRR((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRTs  cC@s||js!tjtdn|jrE|j}d|_|n|js\|jdS|jj |dt dddS(sSchedule a file for closing.s1can only call close() when context manager activeNRR( RRRRRRjRRRtputR(RRR((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRds       (RRRRRRRR(((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyR!s  %   RcB@s2eZdZdZdZdZdZRS(s"Proxy for a file object, to avoid ambiguity of file stat See also util.filestat for detail about "ambiguity of file stat". This proxy is useful only if the target file is guarded by any lock (e.g. repo.lock or repo.wlock) Do not instantiate outside of the vfs layer. cC@s<tt|j|tj|dtjj|jdS(Nt_oldstat( RRRRRRRRRS(RR((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRscC@s,|j}|jr(t|jj|ndS(N(RR>RRRS(RR ((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyt _checkambigs  cC@s$|jj||||jdS(N(RRR(RRRR((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRscC@s|jj|jdS(N(RRR(R((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRs (RRRRRRR(((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyRys     (t __future__RRRR0RkR>Rti18nRRRRRRRRRRRtopenerRRt filteropenerRRRRR(((s3/usr/lib64/python2.7/site-packages/mercurial/vfs.pyts*      (  X