graph: add outputgraph() function, called by ascii() to print

Authored by johnstiles.

Description

graph: add outputgraph() function, called by ascii() to print
the graph to the ui.

This allows a cleaner entrypoint for extensions to tweak the
graph output without needing to rewrite all of ascii(), or needing
to manually guess where the graph nodes/edges end and the rev
note portion begins.

This patch does not affect graph output or behavior in any way.

Differential Revision: https://phab.mercurial-scm.org/D3655