\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@s^dZddlmZmZddlZddlZddlmZddlm Z ej dZ de fd YZ ejd efd YZejd efd YZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdZdefdYZdS(slinelog is an efficient cache for annotate data inspired by SCCS Weaves. SCCS Weaves are an implementation of https://en.wikipedia.org/wiki/Interleaved_deltas. See mercurial/help/internals/linelog.txt for an exploration of SCCS weaves and how linelog works in detail. Here's a hacker's summary: a linelog is a program which is executed in the context of a revision. Executing the program emits information about lines, including the revision that introduced them and the line number in the file at the introducing revision. When an insertion or deletion is performed on the file, a jump instruction is used to patch in a new body of annotate information. i(tabsolute_importtprint_functionNi(tattr(tpycompats>IIt LineLogErrorcB@seZdZRS(s>Error raised when something bad happens internally in linelog.(t__name__t __module__t__doc__(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR#stlineinfocB@s,eZejZejZejZRS((RRRtibtrevtlinenumt_offset(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR&s  tannotateresultcB@s5eZejZejZejZdZRS(cC@s t|jS(N(titertlines(tself((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt__iter__5s(RRRR R Rt_eofR(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR /s   t_llinstructioncB@steZejZejdZejdZdZejdZ ejdZ ejdZ RS(cC@sdS(N((Rtop1top2((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt__init__<scC@sdS(N((R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt__str__@scC@s t|S(N(tstr(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt__repr__DscC@sdS(N((Rtother((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt__eq__GscC@sdS(s5Encode this instruction to the binary linelog format.N((R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytencodeKscC@sdS(sgExecute this instruction. Args: rev: The revision we're annotating. pc: The current offset in the linelog program. emit: A function that accepts a single lineinfo object. Returns: The new value of pc. Returns None if exeuction should stop (that is, we've found the end of the file.) N((RR tpctemit((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytexecuteOs( RRtabctABCMetat __metaclass__tabstractmethodRRRRRR(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR8s  t_jgecB@s;eZdZdZdZdZdZdZRS(s@If the current rev is greater than or equal to op1, jump to op2.cC@s||_||_dS(N(t_cmprevt_target(RRR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR`s cC@sd|j|jfS(Ns JGE %d %d(R%R&(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRdscC@s:t|t|ko9|j|jko9|j|jkS(N(ttypeR%R&(RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRgscC@stj|jd>|jS(Ni(t_llentrytpackR%R&(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRlscC@s||jkr|jS|dS(Ni(R%R&(RR RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRos(RRRRRRRR(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR$]s     t_jumpcB@s;eZdZdZdZdZdZdZRS(s=Unconditional jumps are expressed as a JGE with op1 set to 0.cC@s,|dkrtd|n||_dS(Nis%malformed JUMP, op1 must be 0, got %d(RR&(RRR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRws cC@s d|jS(NsJUMP %d(R&(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR|scC@s(t|t|ko'|j|jkS(N(R'R&(RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@stjd|jS(Ni(R(R)R&(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@s|jS(N(R&(RR RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRs(RRRRRRRR(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR*ts     RcB@s;eZdZdZdZdZdZdZRS(s1EOF is expressed as a JGE that always jumps to 0.cC@sB|dkrtd|n|dkr>td|ndS(Nis$malformed EOF, op1 must be 0, got %ds$malformed EOF, op2 must be 0, got %d(R(RRR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRs  cC@sdS(NtEOF((R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@st|t|kS(N(R'(RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@stjddS(Ni(R(R)(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@sdS(N(tNone(RR RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRs(RRRRRRRR(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRs     t_jlcB@s;eZdZdZdZdZdZdZRS(s1If the current rev is less than op1, jump to op2.cC@s||_||_dS(N(R%R&(RRR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRs cC@sd|j|jfS(NsJL %d %d(R%R&(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@s:t|t|ko9|j|jko9|j|jkS(N(R'R%R&(RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@stjd|jd>B|jS(Nii(R(R)R%R&(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@s||jkr|jS|dS(Ni(R%R&(RR RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRs(RRRRRRRR(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR-s     t_linecB@s;eZdZdZdZdZdZdZRS(s Emit a line.cC@s||_||_dS(N(t_revt _origlineno(RRR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRs cC@sd|j|jfS(Ns LINE %d %d(R/R0(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@s:t|t|ko9|j|jko9|j|jkS(N(R'R/R0(RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@stjd|jd>B|jS(Ni(R(R)R/R0(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@s$|t|j|j||dS(Ni(RR/R0(RR RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRs(RRRRRRRR(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR.s     cC@sytj||\}}Wn&tjk rD}td|nX|d@}|d?}|dkr|dkr|dkrt||St||St||S|dkrt||S|dkrt ||St d|dS(s?Decode a single linelog instruction from an offset in a buffer.s!reading an instruction failed: %riiiisUnimplemented opcode %rN( R(t unpack_fromtstructterrorRRR*R$R-R.tNotImplementedError(tdatatoffsetRRtetopcode((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt _decodeones"            tlinelogcB@seZdZdddZdZdZdZedZ dZ dZ d Z dd Z d Zed Zed ZdZdddZRS(s1Efficient cache for per-line history information.icC@sL|dkr-tddtddg}n||_d|_||_dS(Ni(R,Rt_programt _lastannotatet_maxrev(Rtprogramtmaxrev((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRs  !  cC@s:t|t|ko9|j|jko9|j|jkS(N(R'R;R=(RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@s)dtt||jt|jfS(Ns"(thextidR=tlenR;(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRsc@sUdttt|jtjdjfdt|jddDS(Ns %%%dd %%ss c3@s%|]\}}||fVqdS(N((t.0tidxti(tfmt(s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pys si(RBRR;Rtsysstrtjoint enumerate(R((RFs7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytdebugstrscC@st|tjdkr;tdt|tjfnt|tj}t|d}t|trud}n |j}|j}||krtd||fnt ddg}x7t j d|D]#}|j t||tjqW||d|S(Nis9invalid linelog buffer size %d (must be a multiple of %d)sFcorrupt linelog data: claimed %d entries but given data for %d entriesiR?( RBR(tsizeRR9t isinstanceR*R%R&RRtxrangetappend(tclstbuftexpectedtfakejgeR?t numentriest instructionsR6((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytfromdatas"    !cC@sCt|jt|jj}|djd|jdDS(Ntcs@s|]}|jVqdS(N(R(RCRE((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pys si(R$R=RBR;RRH(Rthdr((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRs!cC@sg|_d|_d|_dS(Ni(R;R=R,R<(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytclears  cC@s%|j|||dt|d|S(Nit_internal_blines(t replacelinesRB(RR ta1ta2tblines((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytreplacelines_vecscC@sl|jr|j}n|j|}|t|jkr^td|t|j|fnY|t|jkrtdd}tdd|j} n|j|} |j| j}|jj } | } |jj } g} | j }||kr| ||d}| t ||xt j ||D]}}|dkrl|t||| | t||q+||\}}|t||| | t||q+Wn||krr|t|jkrtd|t|j|fn1|t|jkr|j}n|j|j}|dkr\||jkr\|j|djd}n| t||n| }| |t|ttfs| td| jdntd| |j| js&    %