mercurial/graphmod.py
changeset 44452 9d2b2df2c2ba
parent 43776 faa8a59f4a06
child 48875 6000f5b25c9b
equal deleted inserted replaced
44449:ff72bd52d56a 44452:9d2b2df2c2ba
    56     for rev in revs:
    56     for rev in revs:
    57         ctx = repo[rev]
    57         ctx = repo[rev]
    58         # partition into parents in the rev set and missing parents, then
    58         # partition into parents in the rev set and missing parents, then
    59         # augment the lists with markers, to inform graph drawing code about
    59         # augment the lists with markers, to inform graph drawing code about
    60         # what kind of edge to draw between nodes.
    60         # what kind of edge to draw between nodes.
    61         pset = set(p.rev() for p in ctx.parents() if p.rev() in revs)
    61         pset = {p.rev() for p in ctx.parents() if p.rev() in revs}
    62         mpars = [
    62         mpars = [
    63             p.rev()
    63             p.rev()
    64             for p in ctx.parents()
    64             for p in ctx.parents()
    65             if p.rev() != nullrev and p.rev() not in pset
    65             if p.rev() != nullrev and p.rev() not in pset
    66         ]
    66         ]
    93     that are in nodes, too.
    93     that are in nodes, too.
    94     """
    94     """
    95     include = set(nodes)
    95     include = set(nodes)
    96     for node in nodes:
    96     for node in nodes:
    97         ctx = repo[node]
    97         ctx = repo[node]
    98         parents = set(
    98         parents = {
    99             (PARENT, p.rev()) for p in ctx.parents() if p.node() in include
    99             (PARENT, p.rev()) for p in ctx.parents() if p.node() in include
   100         )
   100         }
   101         yield (ctx.rev(), CHANGESET, ctx, sorted(parents))
   101         yield (ctx.rev(), CHANGESET, ctx, sorted(parents))
   102 
   102 
   103 
   103 
   104 def colored(dag, repo):
   104 def colored(dag, repo):
   105     """annotates a DAG with colored edge information
   105     """annotates a DAG with colored edge information