Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
0327d27a
G
git
项目概览
李少辉-开发者
/
git
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
git
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0327d27a
编写于
5月 10, 2005
作者:
P
Paul Mackerras
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use a panedwindow
Make it cope with commits having parents that aren't listed.
上级
1db95b00
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
20 deletion
+32
-20
gitk
gitk
+32
-20
未找到文件。
gitk
浏览文件 @
0327d27a
...
...
@@ -7,6 +7,8 @@ exec wish "$0" -- "${1+$@}"
# and distributed under the terms of the GNU General Public Licence,
# either version 2, or
(
at your option
)
any later version.
# CVS $Revision: 1.2 $
set datemode 0
set boldnames 0
set revtreeargs
{}
...
...
@@ -63,7 +65,7 @@ proc getcommits {rargs} {
}
proc readcommit
{
id
}
{
global commitinfo
global commitinfo
commitsummary
set inhdr 1
set comment
{}
set headline
{}
...
...
@@ -103,23 +105,27 @@ proc readcommit {id} {
set comdate
[
clock format $comdate -format
"%Y-%m-%d %H:%M:%S"
]
}
set commitinfo
(
$id
)
[
list $comment $auname $audate $comname $comdate
]
return
[
list $headline $auname $audate
]
set commitsummary
(
$id
)
[
list $headline $auname $audate
]
}
proc makewindow
{}
{
global canv linespc charspc ctext
frame .clist
set canv .clist.canv
panedwindow .ctop -orient vertical
frame .ctop.clist
set canv .ctop.clist.canv
canvas $canv -height
[
expr 30 * $linespc + 4
]
-width
[
expr 90 * $charspc
]
\
-bg white -relief sunk -bd 1
\
-yscrollincr $linespc -yscrollcommand
".clist.csb set"
scrollbar .clist.csb -command
"
$canv
yview"
-highlightthickness 0
pack .clist.csb -side right -fill y
-yscrollincr $linespc -yscrollcommand
".c
top.c
list.csb set"
scrollbar .c
top.c
list.csb -command
"
$canv
yview"
-highlightthickness 0
pack .c
top.c
list.csb -side right -fill y
pack $canv -side bottom -fill both -expand 1
pack .clist -side top -fill both -expand 1
set ctext .ctext
.ctop add .ctop.clist
#pack .ctop.clist -side top -fill both -expand 1
set ctext .ctop.ctext
text $ctext -bg white
pack $ctext -side top -fill x -expand 1
.ctop add .ctop.ctext
#pack $ctext -side top -fill x -expand 1
pack .ctop -side top -fill both -expand 1
bind $canv <1>
{
selcanvline %x %y
}
bind $canv <B1-Motion>
{
selcanvline %x %y
}
...
...
@@ -160,7 +166,7 @@ proc drawgraph {start} {
global parents children nparents nchildren commits
global canv mainfont namefont canvx0 canvy0 linespc namex datex
global datemode cdate
global lineid linehtag linentag linedtag
global lineid linehtag linentag linedtag
commitsummary
set colors
{
green red blue magenta darkgrey brown orange
}
set ncolors
[
llength $colors
]
...
...
@@ -180,10 +186,16 @@ proc drawgraph {start} {
set nlines
[
llength $todo
]
set id
[
lindex $todo $level
]
set lineid
(
$lineno
)
$id
set actualparents
{}
foreach p $parents
(
$id
)
{
incr ncleft
(
$p
)
-1
if
{[
info exists ncleft
(
$p
)]}
{
incr ncleft
(
$p
)
-1
lappend actualparents $p
}
}
if
{
!
[
info exists commitsummary
(
$id
)]}
{
readcommit $id
}
set cinfo
[
readcommit $id
]
set x
[
expr $canvx0 + $level * $linespc
]
set y2
[
expr $canvy + $linespc
]
if
{
$linestarty
(
$level
)
< $canvy
}
{
...
...
@@ -197,9 +209,9 @@ proc drawgraph {start} {
-fill blue -outline black -width 1
]
$canv
raise $t
set xt
[
expr $canvx0 + $nlines * $linespc
]
set headline
[
lindex $c
info
0
]
set name
[
lindex $c
info
1
]
set date
[
lindex $c
info
2
]
set headline
[
lindex $c
ommitsummary
(
$id
)
0
]
set name
[
lindex $c
ommitsummary
(
$id
)
1
]
set date
[
lindex $c
ommitsummary
(
$id
)
2
]
set headline
[
truncatetofit $headline
[
expr $namex-$xt-$linespc
]
\
$mainfont
]
set linehtag
(
$lineno
)
[
$canv
create text $xt $canvy -anchor w
\
...
...
@@ -209,8 +221,8 @@ proc drawgraph {start} {
-text $name -font $namefont
]
set linedtag
(
$lineno
)
[
$canv
create text $datex $canvy -anchor w
\
-text $date -font $mainfont
]
if
{
!$datemode &&
$nparents
(
$id
)
== 1
}
{
set p
[
lindex $
parents
(
$id
)
0
]
if
{
!$datemode &&
[
llength $actualparents
]
== 1
}
{
set p
[
lindex $
actualparents
0
]
if
{
$ncleft
(
$p
)
== 0 &&
[
lsearch -exact $todo $p
]
< 0
}
{
set todo
[
lreplace $todo $level $level $p
]
set colormap
(
$p
)
$colormap
(
$id
)
...
...
@@ -240,7 +252,7 @@ proc drawgraph {start} {
}
set badcolors
[
list $colormap
(
$id
)]
foreach p $
parents
(
$id
)
{
foreach p $
actualparents
{
if
{[
info exists colormap
(
$p
)]}
{
lappend badcolors $colormap
(
$p
)
}
...
...
@@ -250,7 +262,7 @@ proc drawgraph {start} {
incr nullentry -1
}
set i $level
foreach p $
parents
(
$id
)
{
foreach p $
actualparents
{
set k
[
lsearch -exact $todo $p
]
if
{
$k
< 0
}
{
set todo
[
linsert $todo $i $p
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录