contrib/hgk
changeset 3089 d0fcce3728d1
parent 3056 3dab573a4330
child 3090 edefbb3a3b08
equal deleted inserted replaced
3079:bed7cb835d8d 3089:d0fcce3728d1
   174     set headline {}
   174     set headline {}
   175     set auname {}
   175     set auname {}
   176     set audate {}
   176     set audate {}
   177     set comname {}
   177     set comname {}
   178     set comdate {}
   178     set comdate {}
       
   179     set rev {}
   179     if {![info exists nchildren($id)]} {
   180     if {![info exists nchildren($id)]} {
   180 	set children($id) {}
   181 	set children($id) {}
   181 	set nchildren($id) 0
   182 	set nchildren($id) 0
   182 	set ncleft($id) 0
   183 	set ncleft($id) 0
   183     }
   184     }
   207 		    set auname [join [lrange $line 1 [expr {$x - 1}]]]
   208 		    set auname [join [lrange $line 1 [expr {$x - 1}]]]
   208 		} elseif {$tag == "committer"} {
   209 		} elseif {$tag == "committer"} {
   209 		    set x [expr {[llength $line] - 2}]
   210 		    set x [expr {[llength $line] - 2}]
   210 		    set comdate [lindex $line $x]
   211 		    set comdate [lindex $line $x]
   211 		    set comname [join [lrange $line 1 [expr {$x - 1}]]]
   212 		    set comname [join [lrange $line 1 [expr {$x - 1}]]]
       
   213 		} elseif {$tag == "revision"} {
       
   214 		    set rev [lindex $line 1]
   212 		}
   215 		}
   213 	    }
   216 	    }
   214 	} else {
   217 	} else {
   215 	    if {$comment == {}} {
   218 	    if {$comment == {}} {
   216 		set headline [string trim $line]
   219 		set headline [string trim $line]
   231     if {$comdate != {}} {
   234     if {$comdate != {}} {
   232 	set cdate($id) $comdate
   235 	set cdate($id) $comdate
   233 	set comdate [clock format $comdate -format "%Y-%m-%d %H:%M:%S"]
   236 	set comdate [clock format $comdate -format "%Y-%m-%d %H:%M:%S"]
   234     }
   237     }
   235     set commitinfo($id) [list $headline $auname $audate \
   238     set commitinfo($id) [list $headline $auname $audate \
   236 			     $comname $comdate $comment]
   239 			     $comname $comdate $comment $rev]
   237 }
   240 }
   238 
   241 
   239 proc readrefs {} {
   242 proc readrefs {} {
   240     global tagids idtags headids idheads tagcontents
   243     global tagids idtags headids idheads tagcontents
   241 
   244 
  2000 proc commit_descriptor {p} {
  2003 proc commit_descriptor {p} {
  2001     global commitinfo
  2004     global commitinfo
  2002     set l "..."
  2005     set l "..."
  2003     if {[info exists commitinfo($p)]} {
  2006     if {[info exists commitinfo($p)]} {
  2004 	set l [lindex $commitinfo($p) 0]
  2007 	set l [lindex $commitinfo($p) 0]
  2005     }
  2008 	set r [lindex $commitinfo($p) 6]
  2006     return "$p ($l)"
  2009     }
       
  2010     return "$r:$p ($l)"
  2007 }
  2011 }
  2008 
  2012 
  2009 # append some text to the ctext widget, and make any SHA1 ID
  2013 # append some text to the ctext widget, and make any SHA1 ID
  2010 # that we know about be a clickable link.
  2014 # that we know about be a clickable link.
  2011 proc appendwithlinks {text} {
  2015 proc appendwithlinks {text} {
  2105     $ctext delete 0.0 end
  2109     $ctext delete 0.0 end
  2106     set linknum 0
  2110     set linknum 0
  2107     $ctext mark set fmark.0 0.0
  2111     $ctext mark set fmark.0 0.0
  2108     $ctext mark gravity fmark.0 left
  2112     $ctext mark gravity fmark.0 left
  2109     set info $commitinfo($id)
  2113     set info $commitinfo($id)
       
  2114     $ctext insert end "Revision: [lindex $info 6]\n"
  2110     $ctext insert end "Author: [lindex $info 1]  [lindex $info 2]\n"
  2115     $ctext insert end "Author: [lindex $info 1]  [lindex $info 2]\n"
  2111     $ctext insert end "Committer: [lindex $info 3]  [lindex $info 4]\n"
  2116     $ctext insert end "Committer: [lindex $info 3]  [lindex $info 4]\n"
  2112     if {[info exists idtags($id)]} {
  2117     if {[info exists idtags($id)]} {
  2113 	$ctext insert end "Tags:"
  2118 	$ctext insert end "Tags:"
  2114 	foreach tag $idtags($id) {
  2119 	foreach tag $idtags($id) {