comparison contrib/hgk @ 24529:14873da80bc1

hgk: show secret changesets differently (shape and label)
author Andrew Shadura <andrew@shadura.me>
date Sun, 29 Mar 2015 18:44:53 +0200
parents c1fe7111b6bb
children 2ace3b77aaef
comparison
equal deleted inserted replaced
24528:b538ae24aa97 24529:14873da80bc1
389 set branch [join [lrange $line 1 end]] 389 set branch [join [lrange $line 1 end]]
390 } elseif {$tag == "bookmark"} { 390 } elseif {$tag == "bookmark"} {
391 set bookmark [join [lrange $line 1 end]] 391 set bookmark [join [lrange $line 1 end]]
392 } elseif {$tag == "obsolete"} { 392 } elseif {$tag == "obsolete"} {
393 set obsolete($id) "" 393 set obsolete($id) ""
394 } elseif {$tag == "phase"} {
395 set phase [lindex $line 1 end]
394 } 396 }
395 } 397 }
396 } else { 398 } else {
397 if {$comment == {}} { 399 if {$comment == {}} {
398 set headline [string trim $line] 400 set headline [string trim $line]
413 if {$comdate != {}} { 415 if {$comdate != {}} {
414 set cdate($id) $comdate 416 set cdate($id) $comdate
415 set comdate [clock format $comdate] 417 set comdate [clock format $comdate]
416 } 418 }
417 set commitinfo($id) [list $headline $auname $audate \ 419 set commitinfo($id) [list $headline $auname $audate \
418 $comname $comdate $comment $rev $branch $bookmark] 420 $comname $comdate $comment $rev $branch $bookmark $phase]
419 421
420 if {[info exists firstparents]} { 422 if {[info exists firstparents]} {
421 set i [lsearch $firstparents $id] 423 set i [lsearch $firstparents $id]
422 if {$i != -1} { 424 if {$i != -1} {
423 # remove the parent from firstparents, possible building 425 # remove the parent from firstparents, possible building
1147 incr lineno 1149 incr lineno
1148 set id [lindex $displist $level] 1150 set id [lindex $displist $level]
1149 set lastuse($id) $lineno 1151 set lastuse($id) $lineno
1150 set lineid($lineno) $id 1152 set lineid($lineno) $id
1151 set idline($id) $lineno 1153 set idline($id) $lineno
1154 set shape oval
1152 set ofill [expr {[info exists commitlisted($id)]? "blue": "white"}] 1155 set ofill [expr {[info exists commitlisted($id)]? "blue": "white"}]
1153 if {![info exists commitinfo($id)]} { 1156 if {![info exists commitinfo($id)]} {
1154 readcommit $id 1157 readcommit $id
1155 if {![info exists commitinfo($id)]} { 1158 if {![info exists commitinfo($id)]} {
1156 set commitinfo($id) {"No commit information available"} 1159 set commitinfo($id) {"No commit information available"}
1157 set nparents($id) 0 1160 set nparents($id) 0
1161 }
1162 } else {
1163 if {[lindex $commitinfo($id) 9] eq "secret"} {
1164 set shape rect
1158 } 1165 }
1159 } 1166 }
1160 if {[info exists obsolete($id)]} { 1167 if {[info exists obsolete($id)]} {
1161 set ofill darkgrey 1168 set ofill darkgrey
1162 } 1169 }
1184 set mainline($id) [trimdiagstart $mainline($id)] 1191 set mainline($id) [trimdiagstart $mainline($id)]
1185 } 1192 }
1186 } 1193 }
1187 drawlines $id 0 1194 drawlines $id 0
1188 set orad [expr {$linespc / 3}] 1195 set orad [expr {$linespc / 3}]
1189 set t [$canv create oval [expr $x - $orad] [expr $y1 - $orad] \ 1196 set t [$canv create $shape [expr $x - $orad] [expr $y1 - $orad] \
1190 [expr $x + $orad - 1] [expr $y1 + $orad - 1] \ 1197 [expr $x + $orad - 1] [expr $y1 + $orad - 1] \
1191 -fill $ofill -outline black -width 1] 1198 -fill $ofill -outline black -width 1]
1192 $canv raise $t 1199 $canv raise $t
1193 $canv bind $t <1> {selcanvline {} %x %y} 1200 $canv bind $t <1> {selcanvline {} %x %y}
1194 set xt [xcoord [llength $displist] $level $lineno] 1201 set xt [xcoord [llength $displist] $level $lineno]
2529 if {[info exists children($id)]} { 2536 if {[info exists children($id)]} {
2530 foreach c $children($id) { 2537 foreach c $children($id) {
2531 append comment "Child: [commit_descriptor $c]\n" 2538 append comment "Child: [commit_descriptor $c]\n"
2532 } 2539 }
2533 } 2540 }
2541
2542 if {[lindex $info 9] eq "secret"} {
2543 # for now, display phase for secret changesets only
2544 append comment "Phase: [lindex $info 9]\n"
2545 }
2546
2534 append comment "\n" 2547 append comment "\n"
2535 append comment [lindex $info 5] 2548 append comment [lindex $info 5]
2536 2549
2537 # make anything that looks like a SHA1 ID be a clickable link 2550 # make anything that looks like a SHA1 ID be a clickable link
2538 appendwithlinks $comment 2551 appendwithlinks $comment