gitk: Fix "can't unset prevlines(...)" Tcl error
commite5ef6f952a13342065d44bab53999e8d8529cc3b
authorPaul Mackerras <paulus@samba.org>
Sun, 21 Oct 2007 02:58:42 +0000 (21 12:58 +1000)
committerPaul Mackerras <paulus@samba.org>
Sun, 21 Oct 2007 02:58:42 +0000 (21 12:58 +1000)
treeff949dc563c30998da2f48fbd3e915b52ea20087
parent3ebba3c724f77d149061c62f4414166649c2e56e
gitk: Fix "can't unset prevlines(...)" Tcl error

This fixes the error reported by Michele Ballabio, where gitk will
throw a Tcl error "can't unset prevlines(...)" when displaying a
commit that has a parent commit listed more than once, and the commit
is the first child of that parent.

The problem was basically that we had two variables, prevlines and
lineends, and were relying on the invariant that prevlines($id) was
set iff $id was in the lineends($r) list for some $r.  But having
a duplicate parent breaks that invariant since we end up with the
parent listed twice in lineends.

This fixes it by simplifying the logic to use only a single variable,
lineend.  It also rearranges things a little so that we don't try to
draw the line for the duplicated parent twice.

Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk