\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZddlZddlZddlZddlmZddlmZm Z m Z m Z m Z ddl mZdZe jdZe jd ZejZejZejZejZejZejZd efd YZeZed Zd ZdZdZ ddZ"ddddZ#edZ$edZ%dZ&dZ'dZ(dZ)dZ*dZ+dS(i(tabsolute_importNi(t_(tencodingterrortpolicytpycompattutil(tdateutils\ No newline at end of file tbdifftmpatchtdiffoptscB@seZdZidd6ed6ed6ed6ed6ed6ed6d d 6ed 6ed 6ed 6ed6ed6ed6ed6ed6ZdZdZRS(scontext is the number of context lines text treats all files as text showfunc enables diff -p output git enables the git extended patch format nodates removes dates from diff headers nobinary ignores binary files noprefix disables the 'a/' and 'b/' prefixes (ignored in plain mode) ignorews ignores all whitespace changes in the diff ignorewsamount ignores changes in the amount of whitespace ignoreblanklines ignores changes whose lines are all blank upgrade generates git diffs to avoid data loss itcontextttexttshowfunctgittnodatestnobinarytnoprefixitindextignorewstignorewsamountt ignorewseoltignoreblanklinestupgradetshowsimilaritytworddifftxdiffcK@stj|}xR|jjD]A}|j|}|dkrP|j|}nt|||qWyt|j|_Wn6t k rt j t dtj |jnXdS(Ns3diff context lines count must be an integer, not %r(Rt byteskwargstdefaultstkeystgettNonetsetattrtintR t ValueErrorRtAbortRtbytestr(tselftoptstktv((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt__init__Es  c @sEtfdjD}tj|}|j|t|S(Nc3@s$|]}|t|fVqdS(N(tgetattr(t.0R'(R%(s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pys Us(tdictRRt strkwargstupdateR (R%tkwargsR&((R%s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytcopyTs (t__name__t __module__t__doc__tFalseRR)R0(((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyR $s(   cC@s|jrtj|d}n|jr<tj|d}n|rl|jrltjdd|jd}n|jrtjdd|}n|S(Niis +s s [ \t\r\f]+\ns\n( RRtfixwsRRtretsubtstripR(R&R tblank((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytwsclean\s  ! c c@sg|D]!}t||r"dp%d^q}g|D]!}t||rPdpSd^q5}dt|}}dt|}} xE||ks|| kr||d} } } | |ks|| dks| | ks|| dkrLd} x*| |kr|| dkr| d7} qWxt| | krH|| dkrH| d7} qWnGxD| |kr|| dkr|| dkr| d7} | d7} qOW|||| |||| g| fV| }| }qWdS(Niit=t~(R:tlen( tbase1tlines1tbase2tlines2R&tlts1te1ts2te2ti1ti2tbtype((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt splitblockgs&../ 'cC@s2|\}}|\}}|||ko1||kS(sReturn True if `hunk` defined as (start, length) is in `linerange` defined as (lowerbound, upperbound). >>> hunkinrange((5, 10), (2, 7)) True >>> hunkinrange((5, 10), (6, 12)) True >>> hunkinrange((5, 10), (13, 17)) True >>> hunkinrange((5, 10), (3, 17)) True >>> hunkinrange((5, 10), (1, 3)) False >>> hunkinrange((5, 10), (18, 20)) False >>> hunkinrange((5, 10), (1, 5)) False >>> hunkinrange((5, 10), (15, 27)) False ((thunkt linerangetstarttlengtht lowerboundt upperbound((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt hunkinranges  c C@s|\}}d\}}g}x|D]}|\\}} } } } || kr|| kr| dkr|| |}|| |}n| |ko| knr| dkr| | |}q|}n| |ko| knr | dkr||| }q | }nt| | | f|r%|j|q%q%W|dks[|dks[||krstjtdn|||ffS(sfilter `blocks` like (a1, a2, b1, b2) from items outside line range `rangeb` from ``(b1, b2)`` point of view. Return `filteredblocks, rangea` where: * `filteredblocks` is list of ``block = (a1, a2, b1, b2), stype`` items of `blocks` that are inside `rangeb` from ``(b1, b2)`` point of view; a block ``(b1, b2)`` being inside `rangeb` if ``rangeb[0] < b2 and b1 < rangeb[1]``; * `rangea` is the line range w.r.t. to ``(a1, a2)`` parts of `blocks`. R;sline range exceeds file sizeN(NN(RRQtappendRR#R( tblockstrangebtlbbtubbtlbatubatfilteredblockstblockta1ta2tb1tb2tstype((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt blocksinranges*   $    $cC@s;|dks)|j s)tjtd r0tjStjSdS(Nt xdiffblocks(RRRt safehasattrRRSRa(R&((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytchooseblocksfuncsc c@s|d krt}n|js0|js0|jrWt||t}t||t}nt|||}xWt|D]I\}}|dkr||d}nddddg}|d|d|d|dg}|d|dks|d|dkrd} |j r|d kr(t |}n|d krCt |}nt|dj ||d|d!} t|dj ||d|d!} | | krd} qn|| fVn|dfVqyWd S( sbReturn (block, type) tuples, where block is an mdiff.blocks line entry. type is '=' for blocks matching exactly one another (bdiff blocks), '!' for non-matching blocks and '~' for blocks matching only after having filtered blank lines. line1 and line2 are text1 and text2 split with splitnewlines() if they are already available. iiiit!tR<R;N( Rt defaultoptsRRRR:R4Rct enumerateRt splitnewlinestjoin( ttext1ttext2R&R?RAtdifftiRCtsttypetoldtnew((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt allblockss0   "(   ''  c@sFdfd}gdf} | r0| r0| SjrFd} } n d} d} tjd} tj|}tj|}|r|r|rt|t|kr||kr| Sg} dd|gff}nd|s|jd }t|}|dkrd|| }nd | ||||f}d | ||||f}||g} t|}ddd |f}d |gg|D]}d |^q}|r|dcd7<|j t n||ff}n`|s|jd }t|}d | ||||f}|dkr9d|| }nd| ||||f}||g} t|}d |ddf}d|gg|D]}d|^q}|r|dcd7<|j t n||ff}n]t ||d}t |s| Sd | ||||fd| ||||fg} | |fS(s|Return a unified diff as a (headers, hunks) tuple. If the diff is not null, `headers` is a list with unified diff header lines "--- " and "+++ " and `hunks` is a generator yielding (hunkrange, hunklines) coming from _unidiff(). Otherwise, `headers` and `hunks` are empty. Set binary=True if either a or b should be taken as a binary file. c@s6j rj rd|S|r2d|kr2dSdS(Ns %st s Re(RR(tdatetfn(R&(s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytdatetags Resa/sb/isBinary file %s has changed s s--- /dev/null%ss --- %s%s%ss+++ %s%sis@@ -0,0 +1,%d @@ t+is+++ /dev/null%ss +++ %s%s%ss@@ -1,%d +0,0 @@ t-R&N((ii( RRRtdatestrRtpconvertR=tendswithRhRRt_missing_newline_markert_unidifftnext(tatadtbtbdtfn1tfn2tbinaryR&Rvtsentineltaprefixtbprefixtepocht headerlinesthunkstwithout_newlinetl1tl2tsizet hunkrangetet hunklines((R&s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytunidiffsh    0    (    ( c#@sttfdfd}ddgfd}d}d}t}xtD]\}} |\} } } } | dkr| dkr|| | | | 7}qqng}| | !}| | !}| |8} | |8} || }|| }d}|r||djdkrs|}|d}|d }q|st}tVnx||D] }|VqWn|r| |d<| |d <|d }n|| || |g}g|| !D]}d |^q|t|)g|D]}d |^q|t|)g|D]}d |^q>|t|)qW|r|s|t}tVnx*||D] }|VqWn|stVndS(sYield hunks of a headerless unified diff from t1 and t2 texts. Each hunk consists of a (hunkrange, hunklines) tuple where `hunkrange` is a tuple (s1, l1, s2, l2) representing the range information of the hunk to form the '@@ -s1,l1 +s2,l2 @@' header and `hunklines` is a list of lines of the hunk combining said header followed by line additions and deletions. The hunks are prefixed with a bool. c@s&|j}||kr"|}n|S(N(R (RBR=tret(R&(s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt contextendOs   c@s!|j}|dkrdS|S(Ni(R (RBR(R&(s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt contextstartUs  iRec3@s|\}}}}}|t}||}||||}d} jr\} } xztj|d| ddD][} | dd!jrd| j} tj| r| d } n| d||||!V||7}qWdS(Ni(R=(R tcsizeRBRm((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytchunks  ResGIT binary patch s literal %d s N(RRRR=tzlibtcompressRi(ttottnRRRRB((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytb85diffs         cC@sd}g}xh|t|krvtjd|||d!\}}}|d7}|j||||!||7}qWdj|S(Nis>llli Re(R=tstructtunpackRRRi(tbintpostttp1tp2RB((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt patchtexts& cC@s5t|dkr"tj|dStj||gS(Nii (R=RtbufferR tpatches(RR((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytpatchscC@s@gtj||D])}|d|d|d|df^qS(Niii(RRS(RRtd((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytget_matching_blocksscC@s |rtjddd|SdS(Ns>llliRe(Rtpack(RN((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyttrivialdiffheader scC@stjdd||S(Ns>llli(RR(toldlentnewlen((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytreplacediffheaders(,t __future__RR6RRti18nRReRRRRRtutilsRR|t importmodRR RSR5Rt patchedsizettextdiffRhtobjectR RfRR:RJRQR`RRcRrRR}RRRRRR(((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyts>   (      6    ' ) Q #