^c=DddlmZddlmZmZmZmZddlmZdZGddZ Gdde Z Gd d e Z d Z Gd d e Z Gdde ZGddeZGddeZddZGdde ZGddeZdS))getattr)encodingerrorpycompatutil) stringutilcttjt|jdS)N_)rsysbytestype__name__lstrip)os 4/usr/lib/python3/dist-packages/mercurial/smartset.py _typenamers*  T!WW- . . 5 5d ; ;;ceZdZdZeZdZdZdZdZdZ dZ dZ dZ d Z d Zd Zd Zd ZddZdZdZdZddZdZdZdS)abstractsmartsetct)z!True if the smartset is not emptyNotImplementedErrorselfs r __nonzero__zabstractsmartset.__nonzero__!###rct)zprovide fast membership testingr)rrevs r __contains__zabstractsmartset.__contains__rrct)z:iterate the set in the order it is supposed to be iteratedrrs r__iter__zabstractsmartset.__iter__"rrNct)z/True if the set will iterate in ascending orderrrs r isascendingzabstractsmartset.isascending.rrct)z0True if the set will iterate in descending orderrrs r isdescendingzabstractsmartset.isdescending2rrct)z3True if the set will iterate in topographical orderrrs ristopozabstractsmartset.istopo6rrc|jt|n'|D]ntdfd|_S)z%return the minimum element in the setNarg is an empty sequencecSNvsrz&abstractsmartset.min..C1r)fastascmin ValueErrorrr-s @rr1zabstractsmartset.min:sU < D AA\\^^ > > !<===999rc|jt|S|D]ntdfd|_S)z%return the maximum element in the setNr(cSr*r+r,srr.z&abstractsmartset.max..Or/r)fastdescmaxr2r3s @rr7zabstractsmartset.maxFsT = t99 ]]__ > > !<===999rct)zireturn the first element in the set (user iteration perspective) Return None if the set is emptyrrs rfirstzabstractsmartset.firstR"###rct)zhreturn the last element in the set (user iteration perspective) Return None if the set is emptyrrs rlastzabstractsmartset.lastXr:rct)zkreturn the length of the smartsets This can be expensive on smartset that could be lazy otherwise.rrs r__len__zabstractsmartset.__len__^r:rct)z$reverse the expected iteration orderrrs rreversezabstractsmartset.reversedrrFct)z:get the set to iterate in an ascending or descending orderrrr@s rsortzabstractsmartset.sorthrrcjt|tr|S||j|dS)z{Returns a new object with the intersection of the two collections. This is part of the mandatory API for smartset.Fcondreprcache) isinstance fullreposetfilterrrothers r__and__zabstractsmartset.__and__ls6 e[ ) ) K{{5-U{KKKrc"t||S)ztReturns a new object with the union of the two collections. This is part of the mandatory API for smartset.)addsetrKs r__add__zabstractsmartset.__add__tsdE"""rcL|j|fdd|fdS)z{Returns a new object with the substraction of the two collections. This is part of the mandatory API for smartset.c| Sr*r+)rcs rr.z*abstractsmartset.__sub__..s!!A$$hrsFrE)rrJ)rrLrTs @r__sub__zabstractsmartset.__sub__zs=  {{    +u)=U   rTcz|r)tj|drtj|}t|||S)a1Returns this smartset filtered by condition as a new smartset. `condition` is a callable which takes a revision number and returns a boolean. Optional `condrepr` provides a printable representation of the given `condition`. This is part of the mandatory API for smartset.s__code__)r safehasattr cachefunc filteredset)r conditionrFrGs rrJzabstractsmartset.filtersA  2T%i== 2y11I4H555rcn|dks|dkrtjd|||S)zAReturn new smartset that contains selected elements from this setsnegative index not allowed)rProgrammingError_slice)rstartstops rslicezabstractsmartset.slices9 199q()FGG G{{5$'''rcg}t|}t|D]}t|d}|nt||z D]+}t|d}|n||,t |d|||fS)Nsslice=%d:%d %r)datarepr)iterrangenextappendbaseset)rr_r`ysitxys rr^zabstractsmartset._slices $ZZu  ARAyte|$$  ARAy IIaLLLLr%6tT$JKKKKrFNT)r __module__ __qualname__r__bool__rr r0r6r"r$r&r1r7r9r<r>r@rCrMrPrUrJrar^r+rrrrsV$$$H$$$$$$GH$$$$$$$$$      $$$ $$$ $$$ $$$$$$$LLL###     6 6 6 6((( LLLLLrrc*eZdZdZddZejdZejdZejdZ d Z d Z d Z ejd Z d ZeZddZdZdZdZdZdZdZdZfdZdZdZdZejdZxZS)rhaBasic data structure that represents a revset and contains the basic operation that it should be able to perform. Every method in this class should be implemented by any smartset class. This class could be constructed by an (unordered) set, or an (ordered) list-like object. If a set is provided, it'll be sorted lazily. >>> x = [4, 0, 7, 6] >>> y = [5, 6, 7, 3] Construct by a set: >>> xs = baseset(set(x)) >>> ys = baseset(set(y)) >>> [list(i) for i in [xs + ys, xs & ys, xs - ys]] [[0, 4, 6, 7, 3, 5], [6, 7], [0, 4]] >>> [type(i).__name__ for i in [xs + ys, xs & ys, xs - ys]] ['addset', 'baseset', 'baseset'] Construct by a list-like: >>> xs = baseset(x) >>> ys = baseset(i for i in y) >>> [list(i) for i in [xs + ys, xs & ys, xs - ys]] [[4, 0, 7, 6, 5, 3], [7, 6], [4, 0]] >>> [type(i).__name__ for i in [xs + ys, xs & ys, xs - ys]] ['addset', 'filteredset', 'filteredset'] Populate "_set" fields in the lists so set optimization may be used: >>> [1 in xs, 3 in ys] [False, True] Without sort(), results won't be changed: >>> [list(i) for i in [xs + ys, xs & ys, xs - ys]] [[4, 0, 7, 6, 5, 3], [7, 6], [4, 0]] >>> [type(i).__name__ for i in [xs + ys, xs & ys, xs - ys]] ['addset', 'filteredset', 'filteredset'] With sort(), set optimization could be used: >>> xs.sort(reverse=True) >>> [list(i) for i in [xs + ys, xs & ys, xs - ys]] [[7, 6, 4, 0, 5, 3], [7, 6], [4, 0]] >>> [type(i).__name__ for i in [xs + ys, xs & ys, xs - ys]] ['addset', 'baseset', 'baseset'] >>> ys.sort() >>> [list(i) for i in [xs + ys, xs & ys, xs - ys]] [[7, 6, 4, 0, 3, 5], [7, 6], [4, 0]] >>> [type(i).__name__ for i in [xs + ys, xs & ys, xs - ys]] ['addset', 'baseset', 'baseset'] istopo is preserved across set operations >>> xs = baseset(set(x), istopo=True) >>> rs = xs & ys >>> type(rs).__name__ 'baseset' >>> rs._istopo True r+NFcd|_||_t|tr||_d|_n+t|t st |}||_||_dS)z datarepr: a tuple of (format, obj, ...), a function or an object that provides a printable representation of the given data. NT) _ascending_istoporHset_setlist_list _datarepr)rdatarcr&s r__init__zbaseset.__init__sc  dC  DI"DOOdD)) "DzzDJ!rc*t|jSr*)rvryrs rrwz baseset._sets4:rcL|jdd}||Sr*)ryrC)rasclists r_asclistzbaseset._asclists#*QQQ- rc@d|jvsJt|jS)Nrw)__dict__rxrwrs rryz baseset._lists%&&&&DIrc|jt|jS|jrt|jSt |jSr*)rtrdryrreversedrs rr zbaseset.__iter__sD ? " ## # _ + && &DM** *rc*t|jSr*)rdrrs rr0zbaseset.fastasc sDM"""rc*t|jSr*)rrrs rr6zbaseset.fastdescs &&&rc|jjSr*)rwrrs rrzbaseset.__contains__s y%%rc:tt|Sr*)boollenrs rrzbaseset.__nonzero__sCIIrc>t| |_d|_dSNF)rrtrurBs rrCz baseset.sorts"7mm+ rcp|j|jn |j |_d|_dSr)rtryr@rurs rr@zbaseset.reverse s8 ? " J   "&/1DO rcdd|jvrt|jSt|jS)Nry)rrryrwrs rr>zbaseset.__len__'s+ dm # #tz?? "ty>> !rcLt|dkrdS|jduo|jS)zyReturns True if the collection is ascending order, False if not. This is part of the mandatory API for smartset.rTNrrtrs rr"zbaseset.isascending-s, t99>>4d*>t>rcNt|dkrdS|jduo|j S)zzReturns True if the collection is descending order, False if not. This is part of the mandatory API for smartset.rTNrrs rr$zbaseset.isdescending5s/ t99>>4d*B4?/BBrc:t|dkrdS|jS)zlIs the collection is in topographical order or not. This is part of the mandatory API for smartset.rT)rrurs rr&zbaseset.istopo=s  t99>>4|rct|r5|j |jdS|jr |jdS|jdSdS)Nr\rtryrrs rr9z baseset.firstEsG  )&z!}$ )}Q''}R((trct|r5|j |jdS|jr |jdS|jdSdS)Nrr\rrs rr<z baseset.lastOsG  (&z"~% (}R((}Q''trcFt|tur]d|jvrTd|jvrK|jDtt |j||j|j}|j|_n,t tt|||}|S)Nrw)r{r&)r rhrrtrrwrusuper)rrLops __class__s r _fastsetopzbaseset._fastsetopYs KK7 " "%.(($-''++WTY++EJ77 A ?ALL1gt,,b11%88Arc.||dS)Ns__and__rrKs rrMzbaseset.__and__iuj111rc.||dS)Ns__sub__rrKs rrUzbaseset.__sub__lrrcJ|j#t|j|||jS|j}|js@t t ||z dt t ||z d}}t||||j}|j|_|S)N)r&r\)rtrhryrurr7r)rr_r`r{rs rr^zbaseset._sliceos ? "4:eDj1$,GGG G} Nc$ii$.22CD E8I14M4M4E Dt$T\ : : : rcdddd|j}tj|j}|s)|j}|j|j}t j|}dt|||fzS)Nr-+NFTs <%s%s %s>) rtr buildreprrzryrrbytereprr)rdrls r__repr__zbaseset.__repr__{srt4 0 0 A   0 0 % A*M!!$$Ay1555r)r+NFrm) r rorp__doc__r|r propertycacherwrryr r0r6rrrqrCr@r>r"r$r&r9r<rrMrUr^r strmethodr __classcell__rs@rrhrhs99v""""$     +++###''' &&&H""" ???CCC 222222    6 6 6 6 6 6 6rrhceZdZdZddfdZdZdZdZedZ ed Z d Z e Z d Z dd ZdZdZdZdZdZdZejdZdS)rYzDuck type for baseset class which iterates lazily over the revisions in the subset and contains a function which tests for membership in the revset cdSrnr+)rks rr.zfilteredset.s4rNc0||_||_||_dS)a! condition: a function that decide whether a revision in the subset belongs to the revset or not. condrepr: a tuple of (format, obj, ...), a function or an object that provides a printable representation of the given condition. N)_subset _condition _condrepr)rsubsetrZrFs rr|zfilteredset.__init__s #!rc>||jvo||Sr*)rrrrks rrzfilteredset.__contains__s DL 7T__Q%7%77rc6||jSr*) _iterfilterrrs rr zfilteredset.__iter__s ---rc#@K|j}|D]}||r|VdSr*)r)rrjcondrks rrzfilteredset._iterfilters@  AtAww   rc2jjdSfdS)Nc>Sr*rrjrsrr.z%filteredset.fastasc..t''--r)rr0rrjs`@rr0zfilteredset.fastascs* \ ! :4------rc2jjdSfdS)Nc>Sr*rrsrr.z&filteredset.fastdesc..rr)rr6rs`@rr6zfilteredset.fastdescs* \ " :4------rcd}|r|jnd|r|jnd|j|jg}|D]}||}n | |}n|}|D]}dSdSNTF)r"r0r$r6)rfast candidates candidaterjrSs rrzfilteredset.__nonzero__s ,,.. 8DLLD!..00 :DMMd L M  $  I$ %  BBB  A44urcRtd|D}t|S)Nc3K|]}|VdSr*r+).0rSs r z&filteredset.__len__..s"$$!A$$$$$$r)rhr)rrs rr>zfilteredset.__len__s+ $$t$$$ $ $1vv rFc<|j|dS)Nr@)rrCrBs rrCzfilteredset.sorts! '*****rc8|jdSr*)rr@rs rr@zfilteredset.reverses rc4|jSr*)rr"rs rr"zfilteredset.isascendings|'')))rc4|jSr*)rr$rs rr$zfilteredset.isdescendings|((***rc4|jSr*)rr&rs rr&zfilteredset.istopos|""$$$rc|D]}|cSdSr*r+rs rr9zfilteredset.first  AHHHtrcd}|r|j}n|r|j}||D]}|cSdSd}|D]}|Sr*)r"r6r$r0rrjrks rr<zfilteredset.lasts       BB     B >RTT  4A  Hrctj|jg}tj|j}|r||dt|d|fzS)Ns<%s %s>s, ) rrrrrrrgrjoin)rxsrs rrzfilteredset.__repr__s` -- .   0 0   IIaLLLYt__ejjnn===rrm)r rorprr|rr rpropertyr0r6rrqr>rCr@r"r$r&r9r<rrrr+rrrYrYsP *8$ " " " "888... ..X. ..X. ,H++++***+++%%%  >>>>>rrYc#Kt}|rt}d}d} |t|}|t|}|||}|V||krd}||krd}C#t$r|}||V|}n||V|D]}|VYdSwxYw)zproduce an ordered iteration from two iterators with the same order The ascending is used to indicated the iteration direction. N)r7r1rf StopIteration) ascendingiter1iter2choiceval1val2nrjvals r _iterorderedrs F D D |E{{|E{{tT""AGGGqyyqyy        JJJBB  JJJ  CIIII    sAA$BBceZdZdZddZdZdZeZej dZ dZ dZ e d Ze d Zd Zdd ZdZdZdZdZdZdZejdZdS)rOa Represent the addition of two sets Wrapper structure for lazily adding two structures without losing much performance on the __contains__ method If the ascending attribute is set, that means the two structures are ordered in either an ascending or descending way. Therefore, we can add them maintaining the order by iterating over both at the same time >>> xs = baseset([0, 3, 2]) >>> ys = baseset([5, 2, 4]) >>> rs = addset(xs, ys) >>> bool(rs), 0 in rs, 1 in rs, 5 in rs, rs.first(), rs.last() (True, True, False, True, 0, 4) >>> rs = addset(xs, baseset([])) >>> bool(rs), 0 in rs, 1 in rs, rs.first(), rs.last() (True, True, False, 0, 2) >>> rs = addset(baseset([]), baseset([])) >>> bool(rs), 0 in rs, rs.first(), rs.last() (False, False, None, None) iterate unsorted: >>> rs = addset(xs, ys) >>> # (use generator because pypy could call len()) >>> list(x for x in rs) # without _genlist [0, 3, 2, 5, 4] >>> assert not rs._genlist >>> len(rs) 5 >>> [x for x in rs] # with _genlist [0, 3, 2, 5, 4] >>> assert rs._genlist iterate ascending: >>> rs = addset(xs, ys, ascending=True) >>> # (use generator because pypy could call len()) >>> list(x for x in rs), list(x for x in rs.fastasc()) # without _asclist ([0, 2, 3, 4, 5], [0, 2, 3, 4, 5]) >>> assert not rs._asclist >>> len(rs) 5 >>> [x for x in rs], [x for x in rs.fastasc()] ([0, 2, 3, 4, 5], [0, 2, 3, 4, 5]) >>> assert rs._asclist iterate descending: >>> rs = addset(xs, ys, ascending=False) >>> # (use generator because pypy could call len()) >>> list(x for x in rs), list(x for x in rs.fastdesc()) # without _asclist ([5, 4, 3, 2, 0], [5, 4, 3, 2, 0]) >>> assert not rs._asclist >>> len(rs) 5 >>> [x for x in rs], [x for x in rs.fastdesc()] ([5, 4, 3, 2, 0], [5, 4, 3, 2, 0]) >>> assert rs._asclist iterate ascending without fastasc: >>> rs = addset(xs, generatorset(ys), ascending=True) >>> assert rs.fastasc is None >>> [x for x in rs] [0, 2, 3, 4, 5] iterate descending without fastdesc: >>> rs = addset(generatorset(xs), ys, ascending=False) >>> assert rs.fastdesc is None >>> [x for x in rs] [5, 4, 3, 2, 0] NcZ||_||_d|_||_d|_d|_dSr*)_r1_r2_iterrt_genlistr)rrevs1revs2rs rr|zaddset.__init__os0 #  rc*t|jSr*)rryrs rr>zaddset.__len__ws4:rcRt|jpt|jSr*)rrrrs rrzaddset.__nonzero__zsDH~~/dh/rc`|js!tt||_|jSr*)rrhrdrs rryz addset._lists)} 0#DJJ//DM}rc6j*jrtjSfd}|Sjrd}nd}t |}| |St j|}|*tt jj }n |}t j|}|*tt jj }n |}tj||S)aIterate over both collections without repeating elements If the ascending attribute is not set, iterate over the first one and then over the second one checking for membership on the first one so we dont yield any duplicates. If the ascending attribute is set, iterate over both collections at the same time, yielding only one value at a time in the given order. Nc3rKjD]}|Vjj}jD]}||s|VdSr*)rrr)rSinr1rs rarbitraryordergenz*addset.__iter__..arbitraryordergensbAGGGGx,  A477   rsfastascsfastdescr) rtrrd_trysetasclistrrsortedrr)rrattrrjrrs` rr zaddset.__iter__s6 ? "} +DM***     %$&& &  ? DDD T4  >244K$'' =do2EFFFGGEEEGGE$'' =do2EFFFGGEEEGGEDOUE:::rc\|j"|jt|j|_dSdSdS)z9populate the _asclist attribute if possible and necessaryN)rrrrs rrzaddset._trysetasclists4 = $)>"4=11DMMM % $)>)>rc||j |jjS|jj|jjdfvrdSfdS)NcFtdSrnrrrsrr.z addset.fastasc..s|D%%''5577;;r)rrr rr0rrrrs @@rr0zaddset.fastascsc  = $=) )   E5> ! !4;;;;;;rc||j |jjS|jj|jjdfvrdSfdS)NcFtdSrrrsrr.z!addset.fastdesc..s|E5577EEGG<<r)rr __reversed__rr6rrs @@rr6zaddset.fastdescsc  = $=- -!! E5> ! !4<<<<<t>rc$|jduo|j Sr*rrs rr$zaddset.isdescendingsd*B4?/BBrcdSrr+rs rr&z addset.istopo urcd|j|jdS|j |_dSr*)rtryr@rs rr@zaddset.reverses4 ? " J   "&/1DOOOrc|D]}|cSdSr*r+rs rr9z addset.firstrrc~||}||Sr*)r@r9)rrs rr<z addset.lasts. jjll  rcddddd|j}dt|||j|jfzS)Nrrrrs <%s%s %r, %r>)rtrrrrrs rrzaddset.__repr__s6t4 0 0 A9T??Atx"JJJrr*rm)r rorprr|r>rrqrrryr rrr0r6rrCr"r$r&r@r9r<rrrr+rrrOrO'spEEN000H  /;/;/;b222 <<X<==X=...&&&&???CCC 222   KKKKKrrOceZdZdZdfd ZddZdZeZdZdZ dZ d Z d Z dd Z d ZdZdZdZdZdZejdZxZS) generatorsetaWrap a generator for lazy iteration Wrapper structure for generators that provides lazy membership and can be iterated more than once. When asked for membership it generates values until either it finds the requested one or has gone through all the elements in the generator >>> xs = generatorset([0, 1, 4], iterasc=True) >>> assert xs.last() == xs.last() >>> xs.last() # cached 4 Nc||}n|rt}nt}tt||Sr*)_generatorsetasc_generatorsetdescrr__new__)clsgeniterasctyprs rrzgeneratorset.__new__ sA ?CC  $"CC#C\3''//444rcZ||_d|_i|_g|_d|_d|_dS)zM gen: a generator producing the values for the generatorset. NFT)_genr_cacher _finishedrt)rrrs rr|zgeneratorset.__init__s2    rcJ|jrdS|D]}dSdSr)r _consumegenrrSs rrzgeneratorset.__nonzero__"s: = 4!!##  A44urc||jvr |j|S|D] }||krdS d|j|<dSrrrrrkrs rrzgeneratorset.__contains__.s_   ;q> !!!##  AAvvtt Aurc|jr|j}n|j}| |S|D]}t |Sr*)rtr0r6rrdrs rr zgeneratorset.__iter__:sV ? BBB >244K!!##  A Dzzrc|jrt|jS|j|tt cfd}|S)Nc3Kd} |kr |Vn Vn#t$rYdSwxYw|dz }@)Nr\Tr)r)i_len_nextgenlistnextgens rrz#generatorset._iterator..genUsA ttG}}$$!!*$$$$#eGnn,,,,(Q s 0 >>)rrdrrrrf)rrr&r'r(r)s @@@@r _iteratorzgeneratorset._iteratorGsz > ' && &-""$$4 e        suu rc#K|j}|jj}|jD]}d||<|||V|jsKd|_|jdd}|||_|j|_|j |_ dSdSrn) rrrgrrrCrr r0rr6)rrGr(itemascs rrzgeneratorset._consumegencs -&I  DE$K GDMMMJJJJ~ -!DN-"C HHJJJDMzgeneratorset.__len__rs0!!##  A 4=!!!rFc| |_dSr*rrBs rrCzgeneratorset.sortw%+rc |j |_dSr*rrs rr@zgeneratorset.reversez"o-rc|jSr*rrs rr"zgeneratorset.isascending} rc|j Sr*rrs rr$zgeneratorset.isdescending ?""rcdSrr+rs rr&zgeneratorset.istoporrc|jr|j}n|j}|+|D]}|St |dSr*)rtr0r6rr9rfrs rr9zgeneratorset.firstsc ? BBB :%%''  ::<< BBDD$rc|jr|j}n|j}|+|D]}|St |dSr*)rtr6r0rr<rfrs rr<zgeneratorset.lastsc ? BBB :%%''  99;; BBDD$rcJddd|j}dt||fzS)NrrFTs<%s%s>)rtrr s rrzgeneratorset.__repr__s, % %do 6IdOOQ///rr*rm)r rorprrr|rrqrr r*rr>rCr@r"r$r&r9r<rrrrrs@rrrsI  555555    H      8 - - -""" &&&&...###        0000000rrc&eZdZdZejZdZdS)rz@Special case of generatorset optimized for ascending generators.c||jvr |j|S|D]}||krdS||krnd|j|<dSrr r!s rrz_generatorsetasc.__contains__m   ;q> !!!##  AAvvtt1uu AurN)r rorprrr*r0rr+rrrrs1JJ$G     rrc&eZdZdZejZdZdS)rzASpecial case of generatorset optimized for descending generators.c||jvr |j|S|D]}||krdS||krnd|j|<dSrr r!s rrz_generatorsetdesc.__contains__r>rN)r rorprrr*r6rr+rrrrs1KK%H     rrr\Nc|t|}||k}|s |dz|dz}}t||||jjS)zCreate a spanset that represents a range of repository revisions start: first revision included the set (default to 0) end: first revision excluded (last+1) (default to len(repo)) Spanset will be descending if `end` < `start`. Nr)r_spanset changelog filteredrevs)repor_endrs rspansetrGsO {$ii I (1Weais E3 4>+F G GGrceZdZdZdZddZdZdZdZdZ d Z d Z d Z d Z e Zd ZdZdZdZdZfdZejdZxZS)rBa[Duck type for baseset class which represents a range of revisions and can work lazily and without having all the range in memory Note that spanset(x, y) behave almost like range(x, y) except for two notable points: - when x < y it will be automatically descending, - revision filtered with this repoview will be skipped. c>||_||_||_||_dSr*)_start_endrt _hiddenrevs)rr_rFr hiddenrevss rr|z_spanset.__init__s%  #%rFc| |_dSr*rrBs rrCz _spanset.sortr0rc |j |_dSr*rrs rr@z_spanset.reverser2rcdSrr+rs rr&z_spanset.istoporrc#2K|j}|D] }||vr|V dSr*)rL)r iterrangerrSs rrz_spanset._iterfilters:    Azz  rc`|jr|S|Sr*rtr0r6rs rr z_spanset.__iter__s( ? #<<>> !==?? "rct|j|j}|jr||St |Sr*)rerJrKrLrrdrrRs rr0z_spanset.fastascs@$+ty11   /##I.. .Irct|jdz |jdz d}|jr||St |S)Nrr)rerKrJrLrrdrVs rr6z_spanset.fastdescsJ$)a-q"==   /##I.. .IrcR|j}|j|cxko |jknco|o||v Sr*)rLrJrK)rrhiddens rrz_spanset.__contains__sH! s....TY....  $sf}5  rc|D]}dSdSrr+rs rrz_spanset.__nonzero__s  A44urc|jst|j|jz Sd}|j}|j}|jD]&}||cxkr|ksn||cxkr|krn!|dz }'t|j|jz |z S)Nr\r)rLabsrKrJ)rcountr_rFrs rr>z_spanset.__len__!s 8ty4;.// /EKE)C'  #&&&&&&&&ES,>,>,>,>3,>,>,>,>,>QJEty4;.//%7 7rc|jSr*rrs rr"z_spanset.isascending-r4rc|j Sr*rrs rr$z_spanset.isdescending0r6rcR|jr|j}n|j}|D]}|cSdSr*rTrs rr9z_spanset.first3s? ? BBB  AHHHtrcR|jr|j}n|j}|D]}|cSdSr*)rtr6r0rs rr<z _spanset.last<s? ? BBB  AHHHtrc|jr)tt|||S|jr;t |j|z|j}t |j|z|j}n:t|j|z |j}t|j|z |j}t|||j|jSr*) rLrrBr^rtr1rJrKr7)rr_r`rkrlrs rr^z_spanset._sliceEs   =4((//t<< < ? 4DK%'33ADK$& 22AADI$dk22ADI%t{33A1dot/?@@@rcbddd|j}dt|||j|jfzS)Nrrr;s <%s%s %d:%d>)rtrrJrKr s rrz_spanset.__repr__Qs4 % %do 6)D//1dk49!MMMrrm)r rorprr|rCr@r&rr r0r6rrrqr>r"r$r9r<r^rrrrrs@rrBrBsZ&&& &&&&...  ###       H 8 8 8### A A A A ANNNNNNNrrBc(eZdZdZfdZdZxZS)rIza set containing all revisions in the repo This class exists to host special optimization and magic to handle virtual revisions such as "null". ctt|dt|d|jjdS)Nr\T)rrIr|rrCrD)rrErs rr|zfullreposet.__init__^sC k4  )) s4yy$ ;     rctj|dst||jz }|||S)zAs self contains the whole repo, all of the other set should also be in self. Therefore `self & other = other`. This boldly assumes the other contains valid revs only. s isascendingr)rrWrhrLrCr$rKs rrMzfullreposet.__and__csU~66 6 ED$4455E 4,,.. /// r)r rorprr|rMrrs@rrIrIWsQ      rrI)r\N)rrrrrutilsrrrrhrYrrOrrrrGrBrIr+rrrisu <<<MLMLMLMLMLMLMLML``6`6`6`6`6`6`6`6Fu>u>u>u>u>"u>u>u>p"""JUKUKUKUKUK UKUKUKpe0e0e0e0e0#e0e0e0P|( ( H H H H uNuNuNuNuNuNuNuNp(r