\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@s/ddlmZddlmZddlmZmZmZddlm Z ddl m Z m Z m Z mZddlmZmZidd 6Zd Zd Zd Zd ZdefdYZdZdZe jdefdYZdefdYZdejfdYZdS(i(tabsolute_importi(t_(tbinthextnullid(tattr(tencodingterrortpycompattrevlog(tdateutilt stringutiltdefaulttbranchcC@s:|jddjddjdd}|jddS( sC >>> from .pycompat import bytechr as chr >>> d = {b'nl': chr(10), b'bs': chr(92), b'cr': chr(13), b'nul': chr(0)} >>> s = b"ab%(nl)scd%(bs)s%(bs)sn%(nul)sab%(cr)scd%(bs)s%(nl)s" % d >>> s 'ab\ncd\\\\n\x00ab\rcd\\\n' >>> res = _string_escape(s) >>> s == stringutil.unescapestr(res) True s\s\\s s\ns s\rss\0(treplace(ttext((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt_string_escape!s *cC@stj}x|jdD]}|rd|krm|jdd}|jdd}|jdd}ntj|jdd\}}|||>> from .pycompat import bytechr as chr >>> sorted(decodeextra(encodeextra({b'foo': b'bar', b'baz': chr(0) + b'2'}) ... ).items()) [('baz', '\x002'), ('branch', 'default'), ('foo', 'bar')] >>> sorted(decodeextra(encodeextra({b'foo': b'bar', ... b'baz': chr(92) + chr(0) + b'2'}) ... ).items()) [('baz', '\\\x002'), ('branch', 'default'), ('foo', 'bar')] ss\0s\\s\\ s tt:i(t _defaultextratcopytsplitRR t unescapestr(Rtextratltktv((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt decodeextra0s  !cC@s@gt|D] }td|||f^q }dj|S(Ns%s:%ss(tsortedRtjoin(tdRtitems((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt encodeextraGs3cC@s5djg|jD]}|j^qjdS(s>strip trailing whitespace and leading and trailing empty liness (Rt splitlinestrstriptstrip(tdescR((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt stripdescLstappendercB@s}eZdZdZdZdZdZedZdZ ddZ d d Z d Z d Z d ZRS(s`the changelog index must be updated last on disk, so we use this class to delay writes to itcC@sU||_|||}||_|j|_|j|j|_|j|_dS(N(tdatatfpttelltoffsettfstattst_sizetsizet_end(tselftvfstnametmodetbufR(((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt__init__Ss   cC@s|jS(N(R.(R/((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pytend[scC@s|jS(N(R*(R/((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR)]scC@sdS(N((R/((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pytflush_scC@s |jjS(N(R(tclosed(R/((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR7bscC@s|jjdS(N(R(tclose(R/((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR8fsicC@s|dkr||_n@|dkr6|j|7_n"|dkrX|j||_n|j|jkr|jj|jndS(s,virtual file offset spans real file and dataiiiN(R*R5R-R(tseek(R/R*twhence((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR9is    icC@sd}|j|jkrg|jj|}|}|jt|7_|dkrg|t|8}qgn|dkr|j|j}|jjddj|j|jd3|jd|||!}|jt|7_||7}n|S(s5only trick here is reads that span real file and dataRii(R*R-R(treadtlenR'tinsertR(R/tcounttrettstdoff((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR;ts    cC@sD|jjt||jt|7_|jt|7_dS(N(R'tappendtbytesR*R<R.(R/R@((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pytwritescC@s|jj|S(N(R(t __enter__(R/((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyREs cG@s|jj|S(N(R(t__exit__(R/targs((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRFs(t__name__t __module__t__doc__R4R5R)R6tpropertyR7R8R9R;RDRERF(((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR&Ps        c@sdtfd}|S(s=build an opener that writes in 'target.a' instead of 'target'trc@s*|kr||S|d|S(Ns.a((R1R2t checkambig(topenerttarget(s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt_diverts  (tFalse(RNRORP((RNROs9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt _divertopenersc@sdtfd}|S(s?build an opener that stores chunks in 'buf' instead of 'target'RLc@s,|kr||St||S(N(R&(R1R2RM(R3RNRO(s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt_delays  (RQ(RNROR3RS((R3RNROs9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt _delayopenerst_changelogrevisioncB@sweZejZejdeZejddZejddZejdej e Z ejddZ RS(R Ri(ii( RHRIRtibRRtmanifesttusertdatetFactorytlisttfilest description(((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRUs  tchangelogrevisioncB@seZdZd ZdZedZedZedZedZ edZ ed Z ed Z ed Z RS( sHolds results of a parsed changelog revision. Changelog revisions consist of multiple pieces of data, including the manifest node, user, and date. This object exposes a view into the parsed object. u_offsetsu_textcC@s|stdtStt|j|}|jd}|jd|d}|jd|d}||d|d!dkr|}n|jd|d}||||f|_||_|S(NRs iis (RURtsuperR^t__new__tindext_offsetst_text(tclsRR/tnl1tnl2tnl3tdoublenl((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR`s   cC@st|jd|jd!S(Ni(RRcRb(R/((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRWscC@s,|j}tj|j|dd|d!S(Nii(RbRttolocalRc(R/toff((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRXs cC@s<|j}|j|dd|d!}|jdddd!S(Niit i(RbRcR(R/Rjt dateextra((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt_rawdates cC@sU|j}|j|dd|d!}|jdd}t|dkrMdS|dS(NiiRki(RbRcRR<tNone(R/RjRltfields((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt _rawextras  cC@sQ|j}t|d}yt|d}Wntk rFd}nX||fS(Nii(Rmtfloattintt ValueError(R/trawttimettimezone((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRYs   cC@s#|j}|dkrtSt|S(N(RpRnRR(R/Rt((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRs  cC@sD|j}|d|dkr!gS|j|dd|d!jdS(Niiis (RbRcR(R/Rj((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR\ s cC@stj|j|jddS(Nii(RRiRcRb(R/((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR]s(u_offsetsu_text(RHRIRJt __slots__R`RKRWRXRmRpRYRR\R](((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR^s #  t changelogcB@seZedZdZdZdZdZdddZ edZ dZ d Z d Z d Zd Zd ZdZdZdZdZddZdZdZdZdddZdZdZRS(c C@s|r|jdrd}nd}d}tjj|||d|dtdt|jrz|jtjM_t|_nt|_ ||_ t|_ d|_ t|_t|_dS(sLoad a changelog revlog using an opener. If ``trypending`` is true, we attempt to load the index from a ``00changelog.i.a`` file instead of the default ``00changelog.i``. The ``00changelog.i.a`` file contains index (and possibly inline revision) data for a transaction that hasn't been finalized yet. It exists in a separate file to facilitate readers (such as hooks processes) accessing data before a transaction is finalized. s00changelog.i.as 00changelog.is 00changelog.dtdatafileRMtmmaplargeindexN(texistsR R4tTruet _initemptytversiontFLAG_GENERALDELTARQt _generaldeltat_storedeltachainst _realopenert_delayedRnt _delaybufRPt frozensett filteredrevs(R/RNt trypendingt indexfileRy((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR4s          cC@sAx:tjt|dddD]}||jkr |Sq WdS(Niii(RtxrangeR<R(R/ti((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyttiprev:s&cC@s|j|jS(sfiltered version of revlog.tip(tnodeR(R/((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyttip?scC@s/d|kot|kno.||jkS(s'filtered version of revlog.__contains__i(R<R(R/trev((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt __contains__Cs"c@s;tjdkr%tjjSfd}|S(s#filtered version of revlog.__iter__ic3@s;x4tjtD]}|jkr|VqqWdS(N(RRR<R(R(R/(s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt filterediterMs(R<RR t__iter__(R/R((R/s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRHsicc@sAx:tt|j||D]}||jkr|VqqWdS(sfiltered version of revlog.revsN(R_RxtrevsR(R/tstarttstopR((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRTs"cC@s|jj||||S(N(Ratreachableroots2(R/tminroottheadstrootst includepath((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pytreachablerootsZscC@sQ|jr>y|jj|jSWq>tk r:|jSXntt|jS(N(RRatheadrevsfilteredtAttributeErrort _headrevsR_Rxtheadrevs(R/((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR]s   cO@stt|j||dS(N(R_RxR#(R/RGtkwargs((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR#hscC@sRtt|j|}||jkrNtjt||jtdn|S(sfiltered version of revlog.revs filtered node( R_RxRRRtFilteredLookupErrorRRR(R/RRL((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRns cC@s7||jkr!tj|ntt|j|S(sfiltered version of revlog.node(RRtFilteredIndexErrorR_RxR(R/R((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRvscC@s7||jkr!tj|ntt|j|S(s"filtered version of revlog.linkrev(RRRR_Rxtlinkrev(R/R((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR|scC@s7||jkr!tj|ntt|j|S(s%filtered version of revlog.parentrevs(RRRR_Rxt parentrevs(R/R((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRscC@s7||jkr!tj|ntt|j|S(s filtered version of revlog.flags(RRRR_Rxtflags(R/R((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRscC@s|jst|dkrrt|_|jj|jdrW|jj|jdnt|j|j|_ qg|_ t |j|j|j |_ nt|_|j dt ||j|jdt ||jdS(s2delay visibility of index updates to other readersis.ascl-%iN(RR<R|RPRR{RtunlinkRRRNRRTt addpendingtidt _writependingt addfinalizet _finalize(R/ttr((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt delayupdates    cC@st|_|j|_|jrf|jd}|jj|}|j|jj||jdt nS|j r|j|jddt }|j dj |j |jd|_ nt|_|j|dS(sfinalize index updatess.aRMtaRN(RQRRRNRPRtopenR8trenameR|RRDRRnt_enforceinlinesize(R/RttmpnametnfileR(((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRs         cC@s|jr|j|j}|jd}|j||j|d}|j|j|jdj|j|jd|_t |_ t |j|j|_ n|j rt St S(sDcreate a file containing the unfinalized state for pretxnchangegroups.atwRN(RRRt registertmpRDR;RR8RnR|RPRRRNRQ(R/Rtfp1tpendingfilenametfp2((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRs       cC@s&|js"tjj|||ndS(N(RR R(R/RR(((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRs cC@s=t|j|}|j|j|j|j|j|jfS(sObtain data from a parsed changelog revision. Returns a 6-tuple of: - manifest node in binary - author/user as a localstr - date as a 2-tuple of (time, timezone) - list of files - commit message as a localstr - dict of extra metadata Unless you need to access all fields, consider calling ``changelogrevision`` instead, as it is faster for partial object access. (R^trevisionRWRXRYR\R]R(R/Rtc((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR;scC@st|j|S(s6Obtain a ``changelogrevision`` for a node or revision.(R^R(R/t nodeorrev((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyR^scC@sC|j|}|sgS|jd}|| jd}|dS(sX short version of read that only returns the files modified by the cset s s i(RRaR(R/RRtlastR((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt readfiless c C@stj|tj|}}|j}|sItjtdnd|krztjtdtj|nt|}|rdt j |} ndt j } | r| j d} | d kr| d=q| dkrtjtd | qn| r-t | } d | | f} nt||| gt|d|g} dj| } |j| |t|||S(Nsempty usernames susername %r contains a newlines%d %dR R Rt.tnullRsthe name '%s' is reserveds%s %s(R R(RRR(Rt fromlocalR#Rt StorageErrorRRtbytestrR%R t parsedatetmakedatetgetR RRRt addrevisionR<(R/RWR\R$t transactiontp1tp2RXRYRt parseddateR RR((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pytadds0       )cC@s5|j|d}tj|jdd|kfS(sreturn the branch name and open/close state of a revision This function exists because creating a changectx object just to access this is costly.iR R8(R;RRiR(R/RR((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt branchinfoscC@s/|jjdg}|j|j|dS(Nt revduplicates(tchangest setdefaultRBR(R/RRt duplicates((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyt_nodeduplicatecallback%sN(RHRIRQR4RRRRRnRRRR#RRRRRRRRRR;R^RRRR(((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyRxs0 #                  $ N(t __future__Rti18nRRRRRt thirdpartyRRRRRR tutilsR R RRRR R%tobjectR&RRRTR@RUR^Rx(((s9/usr/lib64/python2.7/site-packages/mercurial/changelog.pyts""     B    i