2232 def displaygraph(ui, repo, dag, displayer, edgefn, getrenamed=None, |
2232 def displaygraph(ui, repo, dag, displayer, edgefn, getrenamed=None, |
2233 filematcher=None): |
2233 filematcher=None): |
2234 formatnode = _graphnodeformatter(ui, displayer) |
2234 formatnode = _graphnodeformatter(ui, displayer) |
2235 state = graphmod.asciistate() |
2235 state = graphmod.asciistate() |
2236 styles = state['styles'] |
2236 styles = state['styles'] |
2237 edgetypes = { |
2237 |
2238 'parent': graphmod.PARENT, |
2238 # only set graph styling if HGPLAIN is not set. |
2239 'grandparent': graphmod.GRANDPARENT, |
2239 if ui.plain('graph'): |
2240 'missing': graphmod.MISSINGPARENT |
2240 # set all edge styles to |, the default pre-3.8 behaviour |
2241 } |
2241 styles.update(dict.fromkeys(styles, '|')) |
2242 for name, key in edgetypes.items(): |
2242 else: |
2243 # experimental config: experimental.graphstyle.* |
2243 edgetypes = { |
2244 styles[key] = ui.config('experimental', 'graphstyle.%s' % name, |
2244 'parent': graphmod.PARENT, |
2245 styles[key]) |
2245 'grandparent': graphmod.GRANDPARENT, |
2246 if not styles[key]: |
2246 'missing': graphmod.MISSINGPARENT |
2247 styles[key] = None |
2247 } |
2248 |
2248 for name, key in edgetypes.items(): |
2249 # experimental config: experimental.graphshorten |
2249 # experimental config: experimental.graphstyle.* |
2250 state['graphshorten'] = ui.configbool('experimental', 'graphshorten') |
2250 styles[key] = ui.config('experimental', 'graphstyle.%s' % name, |
|
2251 styles[key]) |
|
2252 if not styles[key]: |
|
2253 styles[key] = None |
|
2254 |
|
2255 # experimental config: experimental.graphshorten |
|
2256 state['graphshorten'] = ui.configbool('experimental', 'graphshorten') |
2251 |
2257 |
2252 for rev, type, ctx, parents in dag: |
2258 for rev, type, ctx, parents in dag: |
2253 char = formatnode(repo, ctx) |
2259 char = formatnode(repo, ctx) |
2254 copies = None |
2260 copies = None |
2255 if getrenamed and ctx.rev(): |
2261 if getrenamed and ctx.rev(): |