Mercurial > hg
diff contrib/hgk @ 7039:aafe12bd7174
hgk: Display branch name for each head (issue 740)
In the graphical view, each head is decorated with an additonal tag
containing the branch name, if that head is not on the default branch.
author | Michael Sommerville <msommerville@gmail.com> |
---|---|
date | Mon, 15 Sep 2008 23:39:11 +0100 |
parents | 9b21faa6f013 |
children | db366ec8d0a4 |
line wrap: on
line diff
--- a/contrib/hgk Sat Sep 13 10:46:47 2008 -0500 +++ b/contrib/hgk Mon Sep 15 23:39:11 2008 +0100 @@ -370,6 +370,25 @@ lappend tagids($direct) $tag lappend idtags($tag) $direct } + + set status [catch {exec $env(HG) --config ui.report_untrusted=false heads} heads] + if { $status != 0 } { + puts $::errorInfo + if { ![string equal $::errorCode NONE] } { + exit 2 + } + } + regsub -all "\r\n" $heads "\n" heads + + set lines [split $heads "\n"] + foreach f $lines { + set match "" + regexp {changeset:\s+(\S+):(\S+)$} $f match id sha + if {$match != ""} { + lappend idheads($sha) $id + } + } + } proc readotherrefs {base dname excl} { @@ -1045,7 +1064,7 @@ } proc drawtags {id x xt y1} { - global idtags idheads idotherrefs + global idtags idheads idotherrefs commitinfo global linespc lthickness global canv mainfont idline rowtextx @@ -1057,8 +1076,11 @@ set ntags [llength $marks] } if {[info exists idheads($id)]} { - set marks [concat $marks $idheads($id)] - set nheads [llength $idheads($id)] + set headmark [lindex $commitinfo($id) 7] + if {$headmark ne "default"} { + lappend marks $headmark + set nheads 1 + } } if {[info exists idotherrefs($id)]} { set marks [concat $marks $idotherrefs($id)]