File: //usr/lib/python2.7/dist-packages/mercurial/dagutil.pyc
σ
ΫXc @@ s₯ d d l m Z d d l m Z d d l m Z d e f d YZ d e f d YZ d e f d
YZ d e f d YZ
d
e e f d YZ d S( i ( t absolute_importi ( t _( t nullrevt basedagc B@ s e Z d Z d Z d Z d Z d Z d Z d
d Z d
d Z
d Z d Z d
Z
d Z e d Z RS( sπ generic interface for DAGs
terms:
"ix" (short for index) identifies a nodes internally,
"id" identifies one externally.
All params are ixs unless explicitly suffixed otherwise.
Pluralized params are lists or sets.
c C@ s
d | _ d S( N( t Nonet _inverse( t self( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyt __init__ s c C@ s
t d S( s set of all node ixsN( t NotImplementedError( R ( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyt nodeset s c C@ s
t d S( s list of head ixsN( R ( R ( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyt heads s c C@ s
t d S( s list of parents ixs of ixN( R ( R t ix( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyt parents$ s c C@ s
t d S( s1 inverse DAG, where parents becomes children, etc.N( R ( R ( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyt inverse( s c C@ s
t d S( sV
set of all ancestors of starts (incl), but stop walk at stops (excl)
N( R ( R t startst stops( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyt ancestorset, s c C@ s | j j | | S( sX
set of all descendants of starts (incl), but stop walk at stops (excl)
( R
R ( R R R ( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyt
descendantset2 s c C@ s
t d S( sι
subset of connected list of ixs so that no node has a descendant in it
By "connected list" we mean that if an ancestor and a descendant are in
the list, then so is at least one path connecting them.
N( R ( R t ixs( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyt headsetofconnecteds8 s c C@ s
| j | S( s return a node id( t _externalize( R R ( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyt externalizeA s c C@ s2 | j | } t | t r( t | St | S( s4 return a list of (or set if given a set) of node ids( t _externalizeallt
isinstancet sett list( R R t ids( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyt externalizeallE s
c C@ s
| j | S( s return a node ix( t _internalize( R t id( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyt internalizeL s c C@ s5 | j | | } t | t r+ t | St | S( s4 return a list of (or set if given a set) of node ixs( t _internalizeallR R R ( R R t
filterunknownR ( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyt internalizeallP s
N( t __name__t
__module__t __doc__R R R
R R
R R R R R R R t FalseR! ( ( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyR s t
genericdagc B@ s# e Z d Z d d Z d Z RS( s generic implementations for DAGsc C@ s | r t | } n t } t } t | } xT | r | j } | | k r6 | | k r6 | j | | j | j | q6 q6 W| S( N( R R t popt addt extendR ( R R R t seent pendingt n( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyR [ s
c C@ s^ t | } | s | Sx5 | D]- } x$ | j | D] } | j | q3 Wq W| sZ t | S( N( R R t discardt AssertionError( R R t hdsR, t p( ( s5 /usr/lib/python2.7/dist-packages/mercurial/dagutil.pyR i s
N( R"