[PATCH] graphlog: hide internal state of ascii() from users

Dennis Brakhane brakhane at googlemail.com
Fri Oct 2 18:38:31 UTC 2009


On Fri, Oct 2, 2009 at 10:00 AM, Peter Arrenbrecht
<peter.arrenbrecht at gmail.com> wrote:
>  def generate(ui, dag, displayer, showparents, edgefn):
> -    seen, base = [], [0, 0]
> +    seen, ctx = [], asciictx()
>     for rev, type, ctx, parents in dag:
>         char = ctx.node() in showparents and '@' or 'o'
>         displayer.show(ctx)
>         lines = displayer.hunk.pop(rev).split('\n')[:-1]
> -        ascii(ui, base, type, char, lines, edgefn(seen, rev, parents))
> +        ascii(ui, ctx, type, char, lines, edgefn(seen, rev, parents))

Am I missing something? To me it looks like ctx is identical to
dag[x][2]. If this
works, isn't the entire initialization unnecessary?




More information about the Mercurial-devel mailing list