0.9.5 release plans

Georg-W. Koltermann gwk.rko at googlemail.com
Tue Oct 16 17:05:15 CDT 2007


Am Dienstag, den 16.10.2007, 23:36 +0200 schrieb Patrick Mézard:
> 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.

Yup, got that from Steve Borho as well.

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

? If I try 'hg --id' on the command line I get 'option --id not
recognized'.

> 
>  > @@ -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 ?

That's different.  My intention was to reuse the /last/ color in the
list.  E.g. if the last color was black, all further authors would be
left black, when the color list is exhausted.

> 
> 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.

So how about using a fixed value like black when the color list is
exhausted (or initially empty)?  May also be easier to convey in the
doc, and probably there's not too much value in having this value
configurable.

--
Regards,
Georg (needs to go to sleep now).




More information about the Mercurial-devel mailing list