Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
3de07118
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,发现更多精彩内容 >>
提交
3de07118
编写于
10月 23, 2007
作者:
P
Paul Mackerras
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into dev
上级
4570b7e9
bd8f677e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
115 addition
and
33 deletion
+115
-33
gitk
gitk
+115
-33
未找到文件。
gitk
浏览文件 @
3de07118
...
...
@@ -95,7 +95,7 @@ proc start_rev_list {view} {
set order
"--date-order"
}
if
{[
catch
{
set fd
[
open
[
concat | git log -z --pretty=raw $order --parents
\
set fd
[
open
[
concat | git log -
-no-color -
z --pretty=raw $order --parents
\
--boundary $viewargs
(
$view
)
"--"
$viewfiles
(
$view
)]
r
]
}
err
]}
{
error_popup
"Error executing git rev-list:
$err
"
...
...
@@ -946,6 +946,12 @@ proc makewindow {} {
}
else
{
bindall <ButtonRelease-4>
"allcanvs yview scroll -5 units"
bindall <ButtonRelease-5>
"allcanvs yview scroll 5 units"
if
{[
tk windowingsystem
]
eq
"aqua"
}
{
bindall <MouseWheel>
{
set delta
[
expr
{
-
(
%D
)}]
allcanvs yview scroll $delta units
}
}
}
bindall <2>
"canvscan mark %W %x %y"
bindall <B2-Motion>
"canvscan dragto %W %x %y"
...
...
@@ -1147,7 +1153,7 @@ proc savestuff {w} {
global stuffsaved findmergefiles maxgraphpct
global maxwidth showneartags showlocalchanges
global viewname viewfiles viewargs viewperm nextviewnum
global cmitmode wrapcomment datetimeformat
global cmitmode wrapcomment datetimeformat
limitdiffs
global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor
if
{
$stuffsaved
}
return
...
...
@@ -1166,6 +1172,7 @@ proc savestuff {w} {
puts $f
[
list set showneartags $showneartags
]
puts $f
[
list set showlocalchanges $showlocalchanges
]
puts $f
[
list set datetimeformat $datetimeformat
]
puts $f
[
list set limitdiffs $limitdiffs
]
puts $f
[
list set bgcolor $bgcolor
]
puts $f
[
list set fgcolor $fgcolor
]
puts $f
[
list set colors $colors
]
...
...
@@ -3813,34 +3820,23 @@ proc drawcommits {row {endrow {}}} {
drawcmitrow $r
if
{
$r
== $er
}
break
set nextid
[
lindex $displayorder
[
expr
{
$r
+ 1
}]]
if
{
$wasdrawn
&&
[
info exists iddrawn
(
$nextid
)]}
{
catch
{
unset prevlines
}
continue
}
if
{
$wasdrawn
&&
[
info exists iddrawn
(
$nextid
)]}
continue
drawparentlinks $id $r
if
{[
info exists lineends
(
$r
)]}
{
foreach lid $lineends
(
$r
)
{
unset prevlines
(
$lid
)
}
}
set rowids
[
lindex $rowidlist $r
]
foreach lid $rowids
{
if
{
$lid
eq
{}}
continue
if
{[
info exists lineend
(
$lid
)]
&& $lineend
(
$lid
)
> $r
}
continue
if
{
$lid
eq $id
}
{
# see if this is the first child of any of its parents
foreach p
[
lindex $parentlist $r
]
{
if
{[
lsearch -exact $rowids $p
]
< 0
}
{
# make this line extend up to the child
set le
[
drawlineseg $p $r $er 0
]
lappend lineends
(
$le
)
$p
set prevlines
(
$p
)
1
set lineend
(
$p
)
[
drawlineseg $p $r $er 0
]
}
}
}
elseif
{
!
[
info exists prevlines
(
$lid
)]}
{
set le
[
drawlineseg $lid $r $er 1
]
lappend lineends
(
$le
)
$lid
set prevlines
(
$lid
)
1
}
else
{
set lineend
(
$lid
)
[
drawlineseg $lid $r $er 1
]
}
}
}
...
...
@@ -5137,11 +5133,15 @@ proc mergediff {id l} {
global diffmergeid mdifffd
global diffids
global parentlist
global limitdiffs viewfiles curview
set diffmergeid $id
set diffids $id
# this doesn't seem to actually affect anything...
set cmd
[
concat | git diff-tree --no-commit-id --cc $id
]
if
{
$limitdiffs
&& $viewfiles
(
$curview
)
ne
{}}
{
set cmd
[
concat $cmd -- $viewfiles
(
$curview
)]
}
if
{[
catch
{
set mdf
[
open $cmd r
]}
err
]}
{
error_popup
"Error getting merge diffs:
$err
"
return
...
...
@@ -5241,9 +5241,31 @@ proc startdiff {ids} {
}
}
proc path_filter
{
filter name
}
{
foreach p $filter
{
set l
[
string length $p
]
if
{[
string compare -length $l $p $name
]
== 0 &&
([
string length $name
]
== $l ||
[
string index $name $l
]
eq
"/"
)}
{
return 1
}
}
return 0
}
proc addtocflist
{
ids
}
{
global treediffs cflist
add_flist $treediffs
(
$ids
)
global treediffs cflist viewfiles curview limitdiffs
if
{
$limitdiffs
&& $viewfiles
(
$curview
)
ne
{}}
{
set flist
{}
foreach f $treediffs
(
$ids
)
{
if
{[
path_filter $viewfiles
(
$curview
)
$f
]}
{
lappend flist $f
}
}
}
else
{
set flist $treediffs
(
$ids
)
}
add_flist $flist
getblobdiffs $ids
}
...
...
@@ -5350,8 +5372,13 @@ proc getblobdiffs {ids} {
global blobdifffd diffids env
global diffinhdr treediffs
global diffcontext
global limitdiffs viewfiles curview
if
{[
catch
{
set bdf
[
open
[
diffcmd $ids
"-p -C --no-commit-id -U
$diffcontext
"
]
r
]}
err
]}
{
set cmd
[
diffcmd $ids
"-p -C --no-commit-id -U
$diffcontext
"
]
if
{
$limitdiffs
&& $viewfiles
(
$curview
)
ne
{}}
{
set cmd
[
concat $cmd -- $viewfiles
(
$curview
)]
}
if
{[
catch
{
set bdf
[
open $cmd r
]}
err
]}
{
puts
"error getting diffs:
$err
"
return
}
...
...
@@ -5435,8 +5462,7 @@ proc getblobdiffline {bdf ids} {
set diffinhdr 0
}
elseif
{
$diffinhdr
}
{
if
{
!
[
string compare -length 12
"rename from "
$line
]
||
!
[
string compare -length 10
"copy from "
$line
]}
{
if
{
!
[
string compare -length 12
"rename from "
$line
]}
{
set fname
[
string range $line
[
expr 6 +
[
string first
" from "
$line
]
]
end
]
if
{[
string index $fname 0
]
eq
"
\"
"
}
{
set fname
[
lindex $fname 0
]
...
...
@@ -6973,7 +6999,7 @@ proc addnewchild {id p} {
global arcnos arcids arctags arcout arcend arcstart archeads growing
global seeds allcommits
if
{
!
[
info exists allcommits
]}
return
if
{
!
[
info exists allcommits
]
|| !
[
info exists arcnos
(
$p
)]
}
return
set allparents
(
$id
)
[
list $p
]
set allchildren
(
$id
)
{}
set arcnos
(
$id
)
{}
...
...
@@ -8007,7 +8033,7 @@ proc doprefs {} {
global maxwidth maxgraphpct
global oldprefs prefstop showneartags showlocalchanges
global bgcolor fgcolor ctext diffcolors selectbgcolor
global uifont tabstop
global uifont tabstop
limitdiffs
set top .gitkprefs
set prefstop $top
...
...
@@ -8015,7 +8041,8 @@ proc doprefs {} {
raise $top
return
}
foreach v
{
maxwidth maxgraphpct showneartags showlocalchanges
}
{
foreach v
{
maxwidth maxgraphpct showneartags showlocalchanges
\
limitdiffs tabstop
}
{
set oldprefs
(
$v
)
[
set $v
]
}
toplevel $top
...
...
@@ -8041,14 +8068,19 @@ proc doprefs {} {
label $top.ddisp -text
"Diff display options"
$top.ddisp configure -font uifont
grid $top.ddisp - -sticky w -pady 10
label $top.tabstopl -text
"Tab spacing"
-font optionfont
spinbox $top.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
grid x $top.tabstopl $top.tabstop -sticky w
frame $top.ntag
label $top.ntag.l -text
"Display nearby tags"
-font optionfont
checkbutton $top.ntag.b -variable showneartags
pack $top.ntag.b $top.ntag.l -side left
grid x $top.ntag -sticky w
label $top.tabstopl -text
"tabstop"
-font optionfont
spinbox $top.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
grid x $top.tabstopl $top.tabstop -sticky w
frame $top.ldiff
label $top.ldiff.l -text
"Limit diffs to listed paths"
-font optionfont
checkbutton $top.ldiff.b -variable limitdiffs
pack $top.ldiff.b $top.ldiff.l -side left
grid x $top.ldiff -sticky w
label $top.cdisp -text
"Colors: press to choose"
$top.cdisp configure -font uifont
...
...
@@ -8141,10 +8173,11 @@ proc setfg {c} {
}
proc prefscan
{}
{
global maxwidth maxgraphpct
global oldprefs prefstop showneartags showlocalchanges
global oldprefs prefstop
foreach v
{
maxwidth maxgraphpct showneartags showlocalchanges
}
{
foreach v
{
maxwidth maxgraphpct showneartags showlocalchanges
\
limitdiffs tabstop
}
{
global $v
set $v $oldprefs
(
$v
)
}
catch
{
destroy $prefstop
}
...
...
@@ -8156,6 +8189,7 @@ proc prefsok {} {
global maxwidth maxgraphpct
global oldprefs prefstop showneartags showlocalchanges
global fontpref mainfont textfont uifont
global limitdiffs
catch
{
destroy $prefstop
}
unset prefstop
...
...
@@ -8191,7 +8225,8 @@ proc prefsok {} {
if
{
$fontchanged
|| $maxwidth != $oldprefs
(
maxwidth
)
|| $maxgraphpct != $oldprefs
(
maxgraphpct
)}
{
redisplay
}
elseif
{
$showneartags
!= $oldprefs
(
showneartags
)}
{
}
elseif
{
$showneartags
!= $oldprefs
(
showneartags
)
||
$limitdiffs
!= $oldprefs
(
limitdiffs
)}
{
reselectline
}
}
...
...
@@ -8477,6 +8512,13 @@ proc tcl_encoding {enc} {
return
{}
}
# First check that Tcl/Tk is recent enough
if
{[
catch
{
package require Tk 8.4
}
err
]}
{
show_error
{}
.
"Sorry, gitk cannot run with this version of Tcl/Tk.
\n\
Gitk requires at least Tcl/Tk 8.4."
exit 1
}
# defaults...
set datemode 0
set wrcomcmd
"git diff-tree --stdin -p --pretty"
...
...
@@ -8511,6 +8553,7 @@ set showneartags 1
set maxrefs 20
set maxlinelen 200
set showlocalchanges 1
set limitdiffs 1
set datetimeformat
"%Y-%m-%d %H:%M:%S"
set colors
{
green red blue magenta darkgrey brown orange
}
...
...
@@ -8545,6 +8588,7 @@ if {![file isdirectory $gitdir]} {
exit 1
}
set mergeonly 0
set revtreeargs
{}
set cmdline_files
{}
set i 0
...
...
@@ -8552,6 +8596,10 @@ foreach arg $argv {
switch -- $arg
{
""
{
}
"-d"
{
set datemode 1
}
"--merge"
{
set mergeonly 1
lappend revtreeargs $arg
}
"--"
{
set cmdline_files
[
lrange $argv
[
expr
{
$i
+ 1
}]
end
]
break
...
...
@@ -8592,6 +8640,40 @@ if {$i >= [llength $argv] && $revtreeargs ne {}} {
}
}
if
{
$mergeonly
}
{
# find the list of unmerged files
set mlist
{}
set nr_unmerged 0
if
{[
catch
{
set fd
[
open
"| git ls-files -u"
r
]
}
err
]}
{
show_error
{}
.
"Couldn't get list of unmerged files:
$err
"
exit 1
}
while
{[
gets $fd line
]
>= 0
}
{
set i
[
string first
"
\t
"
$line
]
if
{
$i
< 0
}
continue
set fname
[
string range $line
[
expr
{
$i
+1
}]
end
]
if
{[
lsearch -exact $mlist $fname
]
>= 0
}
continue
incr nr_unmerged
if
{
$cmdline
_files eq
{}
||
[
path_filter $cmdline_files $fname
]}
{
lappend mlist $fname
}
}
catch
{
close $fd
}
if
{
$mlist
eq
{}}
{
if
{
$nr
_unmerged == 0
}
{
show_error
{}
.
"No files selected: --merge specified but
\
no files are unmerged."
}
else
{
show_error
{}
.
"No files selected: --merge specified but
\
no unmerged files are within file limit."
}
exit 1
}
set cmdline_files $mlist
}
set nullid
"0000000000000000000000000000000000000000"
set nullid2
"0000000000000000000000000000000000000001"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录