0.9.5 release plans

Patrick Mézard pmezard at gmail.com
Tue Oct 16 16:36:08 CDT 2007


I am not fluent in tcl/tk, comments are welcome.

Georg-W. Koltermann a écrit :
> Am Montag, den 15.10.2007, 17:31 -0500 schrieb Matt Mackall:
 > diff -r 3b204881f959 -r 72281823e21d contrib/hgk
 > --- a/contrib/hgk	Mon Oct 15 12:57:01 2007 -0700
 > +++ b/contrib/hgk	Thu Apr 12 13:11:30 2007 +0200
 > @@ -338,7 +338,10 @@ proc parsecommit {id contents listed old
 >  }
 >
 >  proc readrefs {} {
 > -    global tagids idtags headids idheads tagcontents env
 > +    global tagids idtags headids idheads tagcontents env curid
 > +
 > +    set curid [exec hg id]

"[exec $env(HG) id]" would be better here.

Using "--id" may also be more safe.

 > @@ -755,6 +776,34 @@ Use and redistribute under the terms of
 >      pack $w.m -side top -fill x -padx 20 -pady 20
 >      button $w.ok -text Close -command "destroy $w"
 >      pack $w.ok -side bottom
 > +}
 > +
 > +set aunextcolor 0
 > +proc assignauthorcolor {name} {
 > +    global authorcolors aucolormap aunextcolor
 > +    if [info exists aucolormap($name)] return
 > +
 > +    for {set i 0} {$i < [llength $authorcolors]} {incr i} {
 > +	set col [lindex $authorcolors $i]
 > +	if {[llength $col] > 1} {
 > +	    set re [lindex $col 0]
 > +	    set c [lindex $col 1]
 > +	    if {[regexp -- $re $name]} {
 > +		set aucolormap($name) $c
 > +		return
 > +	    }
 > +	} else {
 > +	    set randomcolors [lrange $authorcolors $i end]
 > +	    break
 > +	}
 > +    }
 > +
 > +    set ncolors [llength $randomcolors]
 > +    set c [lindex $randomcolors $aunextcolor]
 > +    if {[incr aunextcolor] >= $ncolors} {
 > +	incr aunextcolor -1
 > +    }

Reusing old colors does not work for me. What about:
"""
set c [lindex $randomcolors [expr $aunextcolor % $ncolors]]
incr aunextcolor
"""
instead ?

Also, we should do something if there are no non-regexp entries in 
authorcolors. Looks like randomcolors would be empty and nothing would 
be drawn.

Otherwise, I really like the colorized output. I would prefer the 
currentid not to be underlined (web background, means clickable for me) 
but that's a detail.

--
Patrick Mézard


More information about the Mercurial-devel mailing list