-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/mercurial/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/mercurial/graphmod.pyc


\,Tc@sdZddlmZddlZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdS(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(tnullrevNtCc#sr|s
dS|j}|j}i}|j}x:|D]2}||}ttg|jD]$}|j|kr[|j^q[g|jD]6}|jtkr|jkr|j^q}	x||	D]t}
|j|
}|dkrt	||||
}||
<n|s2j
|
qjfd|DqW|jt|fVq8WdS(sGcset 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.
    Nc3s!|]}|kr|VqdS(N((t.0tg(tparents(s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pys	<genexpr>7s(
t	changelogtmintsettsortedRtrevRtgettNonetgrandparenttappendtextendt	CHANGESET(trepotrevstclt	lowestrevtgpcachet	knownrevsR	tctxtptmparstmpartgp((Rs6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pyt	dagwalkers(	

*6
 !ccst|}xr|D]j}||}tg|jD]$}|j|kr3|j^q3}|jt|t|fVqWdS(scset 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(RRtnodeR	RR(RtnodestincludeRRRR((s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pyR;s


=c#sg}i}d}ixjjdD]\}}d|kr+|jdd\}}|dkr|jrt|j|i|<q|dkr|jr|j|i|<qq+q+Wrtjfd}	n	d}	x|D]\}
}}}
|
|kr@|j	|
|||
<|d7}n|j
|
}|j|
}|}g|
D]}||krl|^ql}||||d+xAt|D]3\}}|s|||<q|||<|d7}qWg}xt|D]\}}||krZ|	|}|j	||j
||||j
dd|j
dd	fq||
krxZ|
D]O}|	|}|j	||j
|||j
dd|j
dd	fqmWqqW|
||||f|fV|}qWd
S(sxannotates 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.
    itgrapht.twidthtcolorcsj|jiS(N(R
tbranch(R	(tconfigR(s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pyt<lambda>dscSsiS(N((R	((s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pyR%fsitN(tuitconfigitemstrsplittisdigittintt
setdefaulttisalnumtutiltlrucachefuncR
tindextpopt	enumerateR
(tdagRtseentcolorstnewcolortkeytvalR#tsettingtgetconftcurttypetdataRtcolR"tnextRt
addparentstitedgestecolteidtbconf((R$Rs6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pytcoloredGs^
 	


%


!c
Cst|g}t}t}tt|}x|r|j}||kr3||kr3||kry|j|n)|jg|j|D]}	|	^q|j|q3q3Wt|S(s_Return all ancestors of head in roots which revision is
    greater or equal to lowestrev.
    (RtmaxRR1taddtupdatet
parentrevsR(
RRtrootstheadtpendingR4tkeptt
llowestrevtrR((s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pyRs			)ccs||kr|j|n|j|}g}g}x7|D]/}	|	|kr`|j|	q>|j|	q>Wt|}
|}||||d+g|D]'}|tkr||j|f^q}
xt|dkr[|
j||f|
j||dfd}|||||
|
|ffVd}g}|d7}|
d7}
g}
|d=qWt|dkr|
j||fnt|dkr|
j||dfnt||
}||(|||||
|
|ffVdS(s9adds edge info to changelog DAG walk suitable for ascii()iis\iN(R
R0tlenR(R<tchartlinesR4R	Rtnodeidxtknownparentst
newparentstparenttncolstnextseenRRBt	nmorecols((s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pyt
asciiedgess>
4

cCsJxCt|D]5\}\}}||kr
||df||<q
q
WdS(Ni(R2(RBRAtstarttend((s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pyt_fixlongrightedgesscCs|r||kr|dkr|dkrtt|d|}ddg||d}|jddg|||Sddg||dSnddg||dSdS(Niiit|t t/s\(RGR(t
node_indextp_node_indext	n_columnstn_columns_difftp_difftfix_tailR\ttail((s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pyt_getnodelineedgestailscCsx|D]\}}||dkr8d|d|d<q||dkr]d|d|d<q||krzd|d|<qd|t|krqnd|d|<||kr||}}nx@td|dd|D]#}||dkrd||<qqWqWdS(NiRais\R_t+t-(RQtrange(RBtnodelinet	interlineR\R]RA((s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pyt
_drawedgess"cCsg}|jddg|||df|ksE||f|krNd}nd}|j|dg|jddg||d|S(NR_R`i(R(tniRdRBtlinetc((s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pyt_getpaddinglines(	cCs
ddgS(s=returns the initial value for the "state" argument to ascii()i((((s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pyt
asciistatescCs|\}}}}	d|	ko)dkns4t|	dkrMt|nt|dko|	dkog|D]"\}
}|
d|krr|
^qr}t|dko|}
ddg|}|j|dg|jt||d||	|d|
ddg|}|	dkr+d}d}n'|	dkrFd}d}nd	}d
}|j|dg|j|dg||dt||||g}|r|jt|||n|j|x)t|t|kr|jdqWt|t|krTddg||	}x,t|t|krP|j|q(Wnt|||	}xTt	||D]C\}}dd|dj
||f}|j|jd
qwW|	|d<||d<dS(sprints an ASCII graph of the DAG

    takes the following arguments (one call per node in the graph):

      - ui to write to
      - Somewhere to keep the needed state in (init to asciistate())
      - Column of the current node in the set of ongoing edges.
      - Type indicator of node data, usually 'C' for changesets.
      - Payload: (char, lines):
        - Character to use as node's symbol.
        - List of lines to display as the node's text.
      - Edges; a list of (col, next_col) indicating the edges between
        the current node and its parents.
      - Number of columns (ongoing edges) in the current revision.
      - The difference between the number of columns (ongoing edges)
        in the next revision and the number of columns (ongoing edges)
        in the current revision. That is: -1 means one column removed;
        0 means no columns added or removed; 1 means one column added.
    iiiiR_R`iRais\R&s%-*s %ss
N(
tAssertionErrorR^RQRRiRoR
RsRGtziptjointwritetrstrip(R'tstateR<RRttexttcoldatatidxRBRXtcoldifftxtytadd_padding_linetfix_nodeline_tailRmtshift_interlinetn_spacestedge_chRStextra_interlinetindentation_levelRqtlogstrtln((s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pytasciisP"
	/				
 
(t__doc__tmercurial.nodeRR.RRRRFRR[R^RiRoRsRtR(((s6/usr/lib/python2.7/dist-packages/mercurial/graphmod.pyt<module>s	"		N		+					

Copyright © 2017 || Recoded By Mr.Bumblebee