관리-도구
편집 파일: graphmod.pyc
� Hq�Qc @ s� d Z d d l m Z d d l Z d Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d S( s> supports walking the history as DAGs suitable for graphical output The most basic format we use is that of:: (id, type, data, [parentids]) The node and parent ids are arbitrary integers which identify a node in the context of the graph returned. Type is a constant specifying the node type. Data depends on type. i����( t nullrevNt Cc # sr | s d S| j } t | � } i } t | � } x:| D]2} | | } t t g | j � D]$ } | j � | k r[ | j � ^ q[ � � � g | j � D]6 } | j � t k r� | j � � k r� | j � ^ q� } x| | D]t } | j | � } | d k rt | | | | � } | | <n | s2� j | � q� � j � f d � | D� � q� W| j � t | � f Vq8 Wd S( sG cset DAG generator yielding (id, CHANGESET, ctx, [parentids]) tuples This generator function walks through revisions (which should be ordered from bigger to lower). It returns a tuple for each node. The node and parent ids are arbitrary integers which identify a node in the context of the graph returned. Nc 3 s! | ] } | � k r | Vq d S( N( ( t .0t g( t parents( s8 /usr/lib64/python2.7/site-packages/mercurial/graphmod.pys <genexpr>7 s ( t changelogt mint sett sortedR t revR t gett Nonet grandparentt appendt extendt CHANGESET( t repot revst clt lowestrevt gpcachet knownrevsR t ctxt pt mparst mpart gp( ( R s8 /usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt dagwalker s( *6 !c c s� t | � } xr | D]j } | | } t g | j � D]$ } | j � | k r3 | j � ^ q3 � } | j � t | t | � f Vq Wd S( s� cset DAG generator yielding (id, CHANGESET, ctx, [parentids]) tuples This generator function walks the given nodes. It only returns parents that are in nodes, too. N( R R t nodeR R R ( R t nodest includeR R R R ( ( s8 /usr/lib64/python2.7/site-packages/mercurial/graphmod.pyR ; s =c # s� g } i } d } i � x� � j j d � D]� \ } } d | k r+ | j d d � \ } } | d k r� | j � r� t | � � j | i � | <q� | d k r� | j � r� | � j | i � | <q� q+ q+ W� r� t j � � f d � � } n d � } x�| D]�\ } } } } | | k r@| j | � | | | <| d 7} n | j | � } | j | � } | } g | D] } | | k rl| ^ ql} | | | | d +xA t | � D]3 \ } } | s�| | | <q�| | | <| d 7} q�Wg } x� t | � D]� \ } } | | k rZ| | � } | j | | j | � | | | j d d � | j d d � f � q�| | k r�xZ | D]O } | | � } | j | | j | � | | j d d � | j d d � f � qmWq�q�W| | | | | f | f V| } q� Wd S( sx annotates a DAG with colored edge information For each DAG node this function emits tuples:: (id, type, data, (col, color), [(col, nextcol, color)]) with the following new elements: - Tuple (col, color) with column and color index for the current node - A list of tuples indicating the edges between the current node and its parents. i t grapht .t widtht colorc s � j � | j � i � S( N( R t branch( R ( t configR ( s8 /usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt <lambda>d s c S s i S( N( ( R ( ( s8 /usr/lib64/python2.7/site-packages/mercurial/graphmod.pyR% f s i����t N( t uit configitemst rsplitt isdigitt intt setdefaultt isalnumt utilt lrucachefuncR t indext popt enumerateR ( t dagR t seent colorst newcolort keyt valR# t settingt getconft curt typet dataR t colR"