\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@s7ddlmZddlZddlmZddlmZmZmZ m Z m Z ddl m Z dZdZdefd YZded Zd Zdd Zdd ZdZdZdZdZd7Zd8Zd9Zd:Zd;Z d<Z!d=Z"ej#dej#dej#dej#dgZ$dZ%dZ&dZ'dZ(dZ)dZ*d e+fd!YZ,edd"Z-d#Z.d$Z/d%Z0d&Z1d'Z2d(Z3d)Z4ied*d+6ed,d-6ed.d/6ed0d16ed2d36Z5d4Z6d5Z7d6Z8dS(>i(tabsolute_importNi(t_(tdiffutiltencodingtnodetphasestutil(tdateutilitmarkercB@s_eZdZdZdZdZdZdZdZdZ dZ d Z RS( sWrap obsolete marker raw datacC@s||_||_d|_dS(N(t_repot_datatNonet _decodedmeta(tselftrepotdata((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt__init__<s  cC@s t|jS(N(thashR (R ((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt__hash__BscC@s,t|t|krtS|j|jkS(N(ttypetFalseR (R tother((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt__eq__EscC@s |jdS(s%Predecessor changeset node identifieri(R (R ((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytprednodeJscC@s |jdS(s-List of successor changesets node identifiersi(R (R ((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt succnodesNscC@s |jdS(s2Parents of the predecessors (None if not recorded)i(R (R ((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt parentnodesRscC@st|jdS(sDecoded metadata dictionaryi(tdictR (R ((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytmetadataVscC@s |jdS(s#Creation date as (unixtime, offset)i(R (R ((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytdateZscC@s |jdS(sThe flags field of the markeri(R (R ((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytflags^s( t__name__t __module__t__doc__RRRRRRRRR(((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyR9s        cc@se|dkr|j}n*|r0t||}n|jj|}x|D]}t||VqIWdS(sreturns markers known in a repository If is specified, only markers "relevant" to those nodes are are returnedN(R tobsstoretexclusivemarkerstrelevantmarkersR(Rtnodest exclusivet rawmarkerst markerdata((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt getmarkersbs   c c@s|jj}|g}t|}x|r|j}|j|d}xX|D]P}|d}||krqqOn|j|||kr|VqO|j|qOWq$WdS(syield the list of next predecessors pointing on visible changectx nodes This function respect the repoview filtering, filtered revision will be considered missing. iN((R!t predecessorstsettpoptgettaddtappend( Rtnodeidt precursorststacktseentcurrentt currentpreccstprect precnodeid((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytclosestpredecessorsqs          cc@st|}t|}x|r|j}|Vxd|jj|dD]M}|d|@rbqHn|d}||krH|j||j|qHqHWqWdS(sYield node for every precursors of . Some precursors may be unknown locally. This is a linear yield unsuited to detecting folded changesets. It includes initial nodes too.iiN((R*R+R)R,R-(R!R$t ignoreflagst remainingR2R3tmarktsuc((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytallpredecessorss       cc@st|}t|}x|r|j}|Vxo|jj|dD]X}|d|@rbqHnx;|dD]/}||krm|j||j|qmqmWqHWqWdS(sYield node for every successor of . Some successors may be unknown locally. This is a linear yield unsuited to detecting split changesets. It includes initial nodes too.iiN((R*R+t successorsR,R-(R!R$R8R9R2R3R:R;((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt allsuccessorss      cC@std|DS(s"return a set with no prune markerscs@s|]}|dr|VqdS(iN((t.0tm((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys s(R*(tmarkers((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt _filterprunesscC@s |j}|jj}|jj}|jj}|jj}t}t|}g|D]$}t|j |dsX|^qX} | j t| } xj| r| j } t |j | d} x4|j | dD] } | ds| j | qqWx4|j | dD] } | ds| j | qqWx| D]} | |krRq:n| dsl| d| kr||j| n| d}|| krq:n||k}|r||krq:nt|j |}|j|r:| j|| j |q:q:WqW|S(sset of markers relevant to "nodes" but no other locally-known nodes This function compute the set of markers "exclusive" to a locally-known node. This means we walk the markers starting from until we reach a locally-known precursors outside of . Element of with locally-known successors outside of are ignored (since their precursors markers are also relevant to these successors). For example: # (A0 rewritten as A1) # # A0 <-1- A1 # Marker "1" is exclusive to A1 or # (A0 rewritten as AX; AX rewritten as A1; AX is unkown locally) # # <-1- A0 <-2- AX <-3- A1 # Marker "2,3" are exclusive to A1 or # (A0 has unknown precursors, A0 rewritten as A1 and A2 (divergence)) # # <-2- A1 # Marker "2" is exclusive to A0,A1 # / # <-1- A0 # # <-3- A2 # Marker "3" is exclusive to A0,A2 # # in addition: # # Markers "2,3" are exclusive to A1,A2 # Markers "1,2,3" are exclusive to A0,A1,A2 See test/test-obsolete-bundle-strip.t for more examples. An example usage is strip. When stripping a changeset, we also want to strip the markers exclusive to this changeset. Otherwise we would have "dangling"" obsolescence markers from its precursors: Obsolescence markers marking a node as obsolete without any successors available locally. As for relevant markers, the prune markers for children will be followed. Of course, they will only be followed if the pruned children is locally-known. Since the prune markers are relevant to the pruned node. However, while prune markers are considered relevant to the parent of the pruned changesets, prune markers for locally-known changeset (with no successors) are considered exclusive to the pruned nodes. This allows to strip the prune markers (with the rest of the exclusive chain) alongside the pruned changesets. ii(((((t unfilteredt changelogtnodemapR!R)R=tchildrenR*RBR,tsortR+tlistR.R-tissubset(RR$tunfitnmtprecursorsmarkerstsuccessormarkerstchildrenmarkerst exclmarkerstnR1t seennodesR3RAR:R5tknownt precmarkers((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyR"sF6       1            c@s|j}t|jd|}|jr|jjd}xt||krt|}td|D}g|D]}|jr}|j^q}}|jt |j|fd|D}t|jd|}qBWntd|DS(sRreturn all nodes in the "foreground" of other node The foreground of a revision is anything reachable using parent -> children or precursor -> successor relation. It is very similar to "descendant" but augmented with obsolescence information. Beware that possible obsolescence cycle may result if complex situation. s%ln::ics@s|]}|jVqdS(N(R(R?tc((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys Hsc3@s!|]}|kr|VqdS(N((R?RP(RK(s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys Kscs@s|]}|jVqdS(N(R(R?RT((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys Ms( RCR*R!RDREtlentmutableRtupdateR>(RR$t foregroundtplentsuccsRTRVRR((RKs7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyRX5s    +tef1iiiis^branch$s ^.*-source$s ^.*_source$s^source$c@s%|dtfdtD S(sw Check that the key of a meta item (extrakey, extravalue) does not match at least one of the blacklist pattern ic3@s|]}|jVqdS(N(tmatch(R?tpattern(tmetakey(s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys us(tanyt METABLACKLIST(tmetaitem((R^s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytmetanotblacklistedos cC@shg}x[|jD]M}|jds8|jd r|jdrPd}n|j|qqW|S(s/Drop all information but the username and patchs# Usert#s@@s@@ (t splitlinest startswithR.(thunkt cleanhunktline((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt _prepare_hunkws cC@s)t|d}|dkr|St|S(sreturn a cleaned up linesN(tnextR Ri(titerdifftlines((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt _getdiffliness c C@stj|jjitd6}|jj|j}|jd|}|jj|j}|jd|}d\}}x>d||fkrt |}t |}||krt SqWtS(s|return True if both ctx introduce the "same diff" This is a first and basic implementation, with many shortcoming. tgittoptsi(iiN( Rt diffalloptsRtuitTrueR RCtrevtdiffR RmR( tleftctxtrightctxtdiffoptstleftunfitleftdifft rightunfit rightdifftlefttright((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt_cmpdiffs"    cC@sWd}xJ|D]B}|j|jkr8|tO}n|j|jkr]|tO}n|j|jkr|tO}n|j|jkr|tO}n|j|jkr|t O}n|j j }t t t|}|j j }t t t|}||kr3|tO}nt||s |tO}q q W|S(sf From an obs-marker relation, compute what changed between the predecessor and the successor. i(t descriptiont DESCCHANGEDtusert USERCHANGEDRt DATECHANGEDtbrancht BRANCHCHANGEDtparentst PARENTCHANGEDtextratitemsRHtfilterRbt METACHANGEDR~t DIFFCHANGED(tsourceR=teffectst changectxt changeextratctxmetat sourceextratsrcmeta((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt geteffectflags*        c C@s|jjjj}|jj}|jjj}tj }|j d}|j d}t }t } x|D]} | d} || } | dksl| |ksl| |krqln|j | ||| |krqlnt || pgj|rl| j | qlqlW| S(sCreturn the set of pre-existing revisions obsoleted by a transactiont obsmarkerst origrepoleniN(RCRDRER,t _phasecachetphaseR!R=RtpublictchangesR*R R-RI( RttrttorevRt succsmarkersRt addedmarkersRtseenrevst obsoletedR:RRs((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt getobsoleteds&         $ !t_succscB@s;eZdZdZdZejdZdZRS(sAsmall class to represent a successors with some metadata about itcO@s)tt|j||t|_dS(N(tsuperRRR*RA(R targstkwargs((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyRscC@s"t|}|jj|_|S(N(RRAtcopy(R tnew((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyRs cC@s t|S(N(R*(R ((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt_setscC@s|jj|jS(N(RRI(R R((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytcanmerges( RRR RRRt propertycacheRR(((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyRs   cC@s|jj}|g}t|}|dkr6i}nx|r|d}||kpp|op||kop||k}||kr|j|jq9|r||krt|fg||stkeytreverseN(R!R=R*R tremoveR+RtsortedR.R-RARRWtextendRURrRR(Rt initialnodetclosesttcachet succmarkerst toproceedt stackedsetR3tcase2conditionR:R;t succssetstbasetmarksst productresulttprefixtsuffixtnewsstpartR2tfinalt candidatestcandt seensuccs((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytsuccessorssetssr1            !                c C@s0|jsdSt||jdt}|gkrCgg}n|jj}g}x|D]}|rx|j|q\t}xY|j |jdD]?}|dst}t }|j j ||j|qqW|s\|jt q\q\Wg}x,|D]$}|ji|d6|j d6qW|S(sncompute the raw data needed for computing obsfate Returns a list of dict, one dict per successors set RiR=RAN(( tobsoleteR RRRrR!R=R.RR,RRAR-( RtctxtssetstsuccsmaptfullsuccessorsetstssettfoundanyR:tvalues((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytsuccessorsandmarkerss.         "cC@sTt|dkrdSt|dkr,dS|d}t|dkrLdSdSdS(s~ Compute a changeset obsolescence fate based on its successorssets. Successors can be the tipmost ones or the immediate ones. This function return values are not meant to be shown directly to users, it is meant to be used by internal functions only. Returns one fate from the following values: - pruned - diverged - superseded - superseded_split itpruneditdivergedt supersededtsuperseded_splitN(RU(RR=((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt _getobsfate s  cC@s4|sd}n!t|dkr*d}nd}|S(si Return the verb summarizing the successorset and potentially using information from the markers Rit rewrittentsplit(RU(t successorsetRAtverb((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt obsfateverb#s   cC@sg|D]}|d^qS(s4returns the list of dates for a list of markers i((RAR@((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt markersdates/scC@sCg|D]}t|d^q}td|D}t|S(s? Returns a sorted list of markers users without duplicates ics@s1|]'}|jdrtj|dVqdS(RN(R,Rttolocal(R?tmeta((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys 8s(RR*R(RAR@t markersmetatusers((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt markersusers4s#cC@sCg|D]}t|d^q}td|D}t|S(sD Returns a sorted list of markers operations without duplicates ics@s-|]#}|jdr|jdVqdS(t operationN(R,(R?R((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys As(RR*R(RAR@Rt operations((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytmarkersoperations=s#cC@s|j}|j}| o| }g}|jt||t|} | rk|jddj| n|rg|D]} ||| ^qx} |jddj| nt|} |s|jdt} t | dkr| | krd } qn|s |r.| r.|jddj| nt |}|r|rt |}t |}||krtj|d}|jd|qtj|d}tj|d}|jd ||fnd j|S( sp Build a obsfate string for a single successorset using all obsfate related function defined in obsutil s using %ss, s as %st acceptemptyis by %ss%Y-%m-%d %H:%M %1%2s (at %s)s (between %s and %s)tN(tquiettverboseR.RRtjoinRtusernameRrRUR RtmintmaxRtdatestr(RqRR=RAt formatctxRRtnormalRhRtsucct fmtsuccessorsRt currentusertdatestmin_datetmax_datet fmtmin_datet fmtmax_date((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytobsfateprinterFs:   #       shidden revision '%s' is prunedRs!hidden revision '%s' has divergedRs)hidden revision '%s' was rewritten as: %sRs%hidden revision '%s' was split as: %sRs1hidden revision '%s' was split as: %s and %d moretsuperseded_split_severalc C@s;t||j}t|}|dkr9td|S|dkrQtd|S|dkrtj|dd}td||fS|dkr7g}x(|dD]}|jtj|qWt|dkrdj|}td||fSdj|d } t|d} || | f} td| Snd S( sIreturn a human-friendly string on why a obsolete changeset is hidden RRRiRis, RN( RRRtfilteredmsgtabletnodemodtshortR.RUR( RtchangeidRR=tfatetsingle_successorRZtnode_idtfmtsuccstfirstsuccessorstremainingnumberR((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt_getfilteredreasons(       c C@si}i}xt|j|jgD]}||jkrFq(nt|||}xN|D]F}|j|kr}q_nt||krq_n||t|RBR"RXtEFFECTFLAGFIELDRRRRRRRtcompileR`RbRiRmR~RRRHRRRRRRRRRRRR R(((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytsd (")     y )      +  /   5