Merge branch 'master' into dev

maint
Paul Mackerras 2009-09-05 17:34:03 +10:00
commit eae7d64a2d
3 changed files with 1093 additions and 622 deletions

178
gitk
View File

@ -189,7 +189,8 @@ proc parseviewargs {n arglist} {
"--until=*" - "--before=*" - "--max-age=*" - "--min-age=*" - "--until=*" - "--before=*" - "--max-age=*" - "--min-age=*" -
"--author=*" - "--committer=*" - "--grep=*" - "-[iE]" - "--author=*" - "--committer=*" - "--grep=*" - "-[iE]" -
"--remove-empty" - "--first-parent" - "--cherry-pick" - "--remove-empty" - "--first-parent" - "--cherry-pick" -
"-S*" - "--pickaxe-all" - "--pickaxe-regex" { "-S*" - "--pickaxe-all" - "--pickaxe-regex" -
"--simplify-by-decoration" {
# These mean that we get a subset of the commits # These mean that we get a subset of the commits
set filtered 1 set filtered 1
lappend glflags $arg lappend glflags $arg
@ -289,7 +290,7 @@ proc parseviewrevs {view revs} {
if {$sdm != 2} { if {$sdm != 2} {
lappend ret $id lappend ret $id
} else { } else {
lset ret end [lindex $ret end]...$id lset ret end $id...[lindex $ret end]
} }
lappend pos $id lappend pos $id
} }
@ -1678,6 +1679,7 @@ proc readrefs {} {
global tagids idtags headids idheads tagobjid global tagids idtags headids idheads tagobjid
global otherrefids idotherrefs mainhead mainheadid global otherrefids idotherrefs mainhead mainheadid
global selecthead selectheadid global selecthead selectheadid
global hideremotes


foreach v {tagids idtags headids idheads otherrefids idotherrefs} { foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
catch {unset $v} catch {unset $v}
@ -1690,7 +1692,7 @@ proc readrefs {} {
if {![string match "refs/*" $ref]} continue if {![string match "refs/*" $ref]} continue
set name [string range $ref 5 end] set name [string range $ref 5 end]
if {[string match "remotes/*" $name]} { if {[string match "remotes/*" $name]} {
if {![string match "*/HEAD" $name]} { if {![string match "*/HEAD" $name] && !$hideremotes} {
set headids($name) $id set headids($name) $id
lappend idheads($id) $name lappend idheads($id) $name
} }
@ -2213,7 +2215,7 @@ proc makewindow {} {
${NS}::label .bleft.mid.labeldiffcontext -text " [mc "Lines of context"]: " ${NS}::label .bleft.mid.labeldiffcontext -text " [mc "Lines of context"]: "
pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left
spinbox .bleft.mid.diffcontext -width 5 -font textfont \ spinbox .bleft.mid.diffcontext -width 5 -font textfont \
-from 1 -increment 1 -to 10000000 \ -from 0 -increment 1 -to 10000000 \
-validate all -validatecommand "diffcontextvalidate %P" \ -validate all -validatecommand "diffcontextvalidate %P" \
-textvariable diffcontextstring -textvariable diffcontextstring
.bleft.mid.diffcontext set $diffcontext .bleft.mid.diffcontext set $diffcontext
@ -2604,6 +2606,7 @@ proc savestuff {w} {
global cmitmode wrapcomment datetimeformat limitdiffs global cmitmode wrapcomment datetimeformat limitdiffs
global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor
global autoselect extdifftool perfile_attrs markbgcolor use_ttk global autoselect extdifftool perfile_attrs markbgcolor use_ttk
global hideremotes


if {$stuffsaved} return if {$stuffsaved} return
if {![winfo viewable .]} return if {![winfo viewable .]} return
@ -2623,6 +2626,7 @@ proc savestuff {w} {
puts $f [list set wrapcomment $wrapcomment] puts $f [list set wrapcomment $wrapcomment]
puts $f [list set autoselect $autoselect] puts $f [list set autoselect $autoselect]
puts $f [list set showneartags $showneartags] puts $f [list set showneartags $showneartags]
puts $f [list set hideremotes $hideremotes]
puts $f [list set showlocalchanges $showlocalchanges] puts $f [list set showlocalchanges $showlocalchanges]
puts $f [list set datetimeformat $datetimeformat] puts $f [list set datetimeformat $datetimeformat]
puts $f [list set limitdiffs $limitdiffs] puts $f [list set limitdiffs $limitdiffs]
@ -3781,17 +3785,36 @@ proc newview {ishighlight} {
} }


set known_view_options { set known_view_options {
{perm b . {} {mc "Remember this view"}} {perm b . {} {mc "Remember this view"}}
{args t50= + {} {mc "Commits to include (arguments to git log):"}} {reflabel l + {} {mc "References (space separated list):"}}
{all b * "--all" {mc "Use all refs"}} {refs t15 .. {} {mc "Branches & tags:"}}
{dorder b . {"--date-order" "-d"} {mc "Strictly sort by date"}} {allrefs b *. "--all" {mc "All refs"}}
{lright b . "--left-right" {mc "Mark branch sides"}} {branches b . "--branches" {mc "All (local) branches"}}
{since t15 + {"--since=*" "--after=*"} {mc "Since date:"}} {tags b . "--tags" {mc "All tags"}}
{until t15 . {"--until=*" "--before=*"} {mc "Until date:"}} {remotes b . "--remotes" {mc "All remote-tracking branches"}}
{limit t10 + "--max-count=*" {mc "Max count:"}} {commitlbl l + {} {mc "Commit Info (regular expressions):"}}
{skip t10 . "--skip=*" {mc "Skip:"}} {author t15 .. "--author=*" {mc "Author:"}}
{first b . "--first-parent" {mc "Limit to first parent"}} {committer t15 . "--committer=*" {mc "Committer:"}}
{cmd t50= + {} {mc "Command to generate more commits to include:"}} {loginfo t15 .. "--grep=*" {mc "Commit Message:"}}
{allmatch b .. "--all-match" {mc "Matches all Commit Info criteria"}}
{changes_l l + {} {mc "Changes to Files:"}}
{pickaxe_s r0 . {} {mc "Fixed String"}}
{pickaxe_t r1 . "--pickaxe-regex" {mc "Regular Expression"}}
{pickaxe t15 .. "-S*" {mc "Search string:"}}
{datelabel l + {} {mc "Commit Dates (\"2 weeks ago\", \"2009-03-17 15:27:38\", \"March 17, 2009 15:27:38\"):"}}
{since t15 .. {"--since=*" "--after=*"} {mc "Since:"}}
{until t15 . {"--until=*" "--before=*"} {mc "Until:"}}
{limit_lbl l + {} {mc "Limit and/or skip a number of revisions (positive integer):"}}
{limit t10 *. "--max-count=*" {mc "Number to show:"}}
{skip t10 . "--skip=*" {mc "Number to skip:"}}
{misc_lbl l + {} {mc "Miscellaneous options:"}}
{dorder b *. {"--date-order" "-d"} {mc "Strictly sort by date"}}
{lright b . "--left-right" {mc "Mark branch sides"}}
{first b . "--first-parent" {mc "Limit to first parent"}}
{smplhst b . "--simplify-by-decoration" {mc "Simple history"}}
{args t50 *. {} {mc "Additional arguments to git log:"}}
{allpaths path + {} {mc "Enter files and directories to include, one per line:"}}
{cmd t50= + {} {mc "Command to generate more commits to include:"}}
} }


proc encode_view_opts {n} { proc encode_view_opts {n} {
@ -3803,13 +3826,19 @@ proc encode_view_opts {n} {
if {$patterns eq {}} continue if {$patterns eq {}} continue
set pattern [lindex $patterns 0] set pattern [lindex $patterns 0]


set val $newviewopts($n,[lindex $opt 0])

if {[lindex $opt 1] eq "b"} { if {[lindex $opt 1] eq "b"} {
set val $newviewopts($n,[lindex $opt 0])
if {$val} { if {$val} {
lappend rargs $pattern lappend rargs $pattern
} }
} elseif {[regexp {^r(\d+)$} [lindex $opt 1] type value]} {
regexp {^(.*_)} [lindex $opt 0] uselessvar button_id
set val $newviewopts($n,$button_id)
if {$val eq $value} {
lappend rargs $pattern
}
} else { } else {
set val $newviewopts($n,[lindex $opt 0])
set val [string trim $val] set val [string trim $val]
if {$val ne {}} { if {$val ne {}} {
set pfix [string range $pattern 0 end-1] set pfix [string range $pattern 0 end-1]
@ -3817,6 +3846,7 @@ proc encode_view_opts {n} {
} }
} }
} }
set rargs [concat $rargs [shellsplit $newviewopts($n,refs)]]
return [concat $rargs [shellsplit $newviewopts($n,args)]] return [concat $rargs [shellsplit $newviewopts($n,args)]]
} }


@ -3824,14 +3854,22 @@ proc decode_view_opts {n view_args} {
global known_view_options newviewopts global known_view_options newviewopts


foreach opt $known_view_options { foreach opt $known_view_options {
set id [lindex $opt 0]
if {[lindex $opt 1] eq "b"} { if {[lindex $opt 1] eq "b"} {
# Checkboxes
set val 0
} elseif {[regexp {^r(\d+)$} [lindex $opt 1]]} {
# Radiobuttons
regexp {^(.*_)} $id uselessvar id
set val 0 set val 0
} else { } else {
# Text fields
set val {} set val {}
} }
set newviewopts($n,[lindex $opt 0]) $val set newviewopts($n,$id) $val
} }
set oargs [list] set oargs [list]
set refargs [list]
foreach arg $view_args { foreach arg $view_args {
if {[regexp -- {^-([0-9]+)$} $arg arg cnt] if {[regexp -- {^-([0-9]+)$} $arg arg cnt]
&& ![info exists found(limit)]} { && ![info exists found(limit)]} {
@ -3845,11 +3883,17 @@ proc decode_view_opts {n view_args} {
if {[info exists found($id)]} continue if {[info exists found($id)]} continue
foreach pattern [lindex $opt 3] { foreach pattern [lindex $opt 3] {
if {![string match $pattern $arg]} continue if {![string match $pattern $arg]} continue
if {[lindex $opt 1] ne "b"} { if {[lindex $opt 1] eq "b"} {
# Check buttons
set val 1
} elseif {[regexp {^r(\d+)$} [lindex $opt 1] match num]} {
# Radio buttons
regexp {^(.*_)} $id uselessvar id
set val $num
} else {
# Text input fields
set size [string length $pattern] set size [string length $pattern]
set val [string range $arg [expr {$size-1}] end] set val [string range $arg [expr {$size-1}] end]
} else {
set val 1
} }
set newviewopts($n,$id) $val set newviewopts($n,$id) $val
set found($id) 1 set found($id) 1
@ -3858,8 +3902,13 @@ proc decode_view_opts {n view_args} {
if {[info exists val]} break if {[info exists val]} break
} }
if {[info exists val]} continue if {[info exists val]} continue
lappend oargs $arg if {[regexp {^-} $arg]} {
lappend oargs $arg
} else {
lappend refargs $arg
}
} }
set newviewopts($n,refs) [shellarglist $refargs]
set newviewopts($n,args) [shellarglist $oargs] set newviewopts($n,args) [shellarglist $oargs]
} }


@ -3895,16 +3944,16 @@ proc vieweditor {top n title} {
global known_view_options NS global known_view_options NS


ttk_toplevel $top ttk_toplevel $top
wm title $top $title wm title $top [concat $title [mc "-- criteria for selecting revisions"]]
make_transient $top . make_transient $top .


# View name # View name
${NS}::frame $top.nfr ${NS}::frame $top.nfr
${NS}::label $top.nl -text [mc "Name"] ${NS}::label $top.nl -text [mc "View Name"]
${NS}::entry $top.name -width 20 -textvariable newviewname($n) ${NS}::entry $top.name -width 20 -textvariable newviewname($n)
pack $top.nfr -in $top -fill x -pady 5 -padx 3 pack $top.nfr -in $top -fill x -pady 5 -padx 3
pack $top.nl -in $top.nfr -side left -padx {0 30} pack $top.nl -in $top.nfr -side left -padx {0 5}
pack $top.name -in $top.nfr -side left pack $top.name -in $top.nfr -side left -padx {0 25}


# View options # View options
set cframe $top.nfr set cframe $top.nfr
@ -3923,14 +3972,28 @@ proc vieweditor {top n title} {
${NS}::frame $cframe ${NS}::frame $cframe
pack $cframe -in $top -fill x -pady 3 -padx 3 pack $cframe -in $top -fill x -pady 3 -padx 3
set cexpand [expr {$flags eq "*"}] set cexpand [expr {$flags eq "*"}]
} elseif {$flags eq ".." || $flags eq "*."} {
set cframe $top.fr$cnt
incr cnt
${NS}::frame $cframe
pack $cframe -in $top -fill x -pady 3 -padx [list 15 3]
set cexpand [expr {$flags eq "*."}]
} else { } else {
set lxpad 5 set lxpad 5
} }


if {$type eq "b"} { if {$type eq "l"} {
${NS}::label $cframe.l_$id -text $title
pack $cframe.l_$id -in $cframe -side left -pady [list 3 0] -anchor w
} elseif {$type eq "b"} {
${NS}::checkbutton $cframe.c_$id -text $title -variable newviewopts($n,$id) ${NS}::checkbutton $cframe.c_$id -text $title -variable newviewopts($n,$id)
pack $cframe.c_$id -in $cframe -side left \ pack $cframe.c_$id -in $cframe -side left \
-padx [list $lxpad 0] -expand $cexpand -anchor w -padx [list $lxpad 0] -expand $cexpand -anchor w
} elseif {[regexp {^r(\d+)$} $type type sz]} {
regexp {^(.*_)} $id uselessvar button_id
${NS}::radiobutton $cframe.c_$id -text $title -variable newviewopts($n,$button_id) -value $sz
pack $cframe.c_$id -in $cframe -side left \
-padx [list $lxpad 0] -expand $cexpand -anchor w
} elseif {[regexp {^t(\d+)$} $type type sz]} { } elseif {[regexp {^t(\d+)$} $type type sz]} {
${NS}::label $cframe.l_$id -text $title ${NS}::label $cframe.l_$id -text $title
${NS}::entry $cframe.e_$id -width $sz -background $bgcolor \ ${NS}::entry $cframe.e_$id -width $sz -background $bgcolor \
@ -3943,23 +4006,22 @@ proc vieweditor {top n title} {
-textvariable newviewopts($n,$id) -textvariable newviewopts($n,$id)
pack $cframe.l_$id -in $cframe -side top -pady [list 3 0] -anchor w pack $cframe.l_$id -in $cframe -side top -pady [list 3 0] -anchor w
pack $cframe.e_$id -in $cframe -side top -fill x pack $cframe.e_$id -in $cframe -side top -fill x
} elseif {$type eq "path"} {
${NS}::label $top.l -text $title
pack $top.l -in $top -side top -pady [list 3 0] -anchor w -padx 3
text $top.t -width 40 -height 5 -background $bgcolor -font uifont
if {[info exists viewfiles($n)]} {
foreach f $viewfiles($n) {
$top.t insert end $f
$top.t insert end "\n"
}
$top.t delete {end - 1c} end
$top.t mark set insert 0.0
}
pack $top.t -in $top -side top -pady [list 0 5] -fill both -expand 1 -padx 3
} }
} }


# Path list
${NS}::label $top.l \
-text [mc "Enter files and directories to include, one per line:"]
pack $top.l -in $top -side top -pady [list 7 0] -anchor w -padx 3
text $top.t -width 40 -height 5 -background $bgcolor -font uifont
if {[info exists viewfiles($n)]} {
foreach f $viewfiles($n) {
$top.t insert end $f
$top.t insert end "\n"
}
$top.t delete {end - 1c} end
$top.t mark set insert 0.0
}
pack $top.t -in $top -side top -pady [list 0 5] -fill both -expand 1 -padx 3
${NS}::frame $top.buts ${NS}::frame $top.buts
${NS}::button $top.buts.ok -text [mc "OK"] -command [list newviewok $top $n] ${NS}::button $top.buts.ok -text [mc "OK"] -command [list newviewok $top $n]
${NS}::button $top.buts.apply -text [mc "Apply (F5)"] -command [list newviewok $top $n 1] ${NS}::button $top.buts.apply -text [mc "Apply (F5)"] -command [list newviewok $top $n 1]
@ -7393,7 +7455,7 @@ proc diffcontextchange {n1 n2 op} {
global diffcontextstring diffcontext global diffcontextstring diffcontext


if {[string is integer -strict $diffcontextstring]} { if {[string is integer -strict $diffcontextstring]} {
if {$diffcontextstring > 0} { if {$diffcontextstring >= 0} {
set diffcontext $diffcontextstring set diffcontext $diffcontextstring
reselectline reselectline
} }
@ -7411,8 +7473,13 @@ proc getblobdiffs {ids} {
global ignorespace global ignorespace
global limitdiffs vfilelimit curview global limitdiffs vfilelimit curview
global diffencoding targetline diffnparents global diffencoding targetline diffnparents
global git_version


set cmd [diffcmd $ids "-p -C --cc --no-commit-id -U$diffcontext"] set textconv {}
if {[package vcompare $git_version "1.6.1"] >= 0} {
set textconv "--textconv"
}
set cmd [diffcmd $ids "-p $textconv -C --cc --no-commit-id -U$diffcontext"]
if {$ignorespace} { if {$ignorespace} {
append cmd " -w" append cmd " -w"
} }
@ -8015,6 +8082,11 @@ proc gotocommit {} {
} }
set id [lindex $matches 0] set id [lindex $matches 0]
} }
} else {
if {[catch {set id [exec git rev-parse --verify $sha1string]}]} {
error_popup [mc "Revision %s is not known" $sha1string]
return
}
} }
} }
if {[commitinview $id $curview]} { if {[commitinview $id $curview]} {
@ -8024,7 +8096,7 @@ proc gotocommit {} {
if {[regexp {^[0-9a-fA-F]{4,}$} $sha1string]} { if {[regexp {^[0-9a-fA-F]{4,}$} $sha1string]} {
set msg [mc "SHA1 id %s is not known" $sha1string] set msg [mc "SHA1 id %s is not known" $sha1string]
} else { } else {
set msg [mc "Tag/Head %s is not known" $sha1string] set msg [mc "Revision %s is not in the current view" $sha1string]
} }
error_popup $msg error_popup $msg
} }
@ -10514,6 +10586,7 @@ proc doprefs {} {
global oldprefs prefstop showneartags showlocalchanges global oldprefs prefstop showneartags showlocalchanges
global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
global tabstop limitdiffs autoselect extdifftool perfile_attrs global tabstop limitdiffs autoselect extdifftool perfile_attrs
global hideremotes


set top .gitkprefs set top .gitkprefs
set prefstop $top set prefstop $top
@ -10522,7 +10595,7 @@ proc doprefs {} {
return return
} }
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \ foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
limitdiffs tabstop perfile_attrs} { limitdiffs tabstop perfile_attrs hideremotes} {
set oldprefs($v) [set $v] set oldprefs($v) [set $v]
} }
ttk_toplevel $top ttk_toplevel $top
@ -10552,6 +10625,9 @@ proc doprefs {} {
${NS}::checkbutton $top.ntag -text [mc "Display nearby tags"] \ ${NS}::checkbutton $top.ntag -text [mc "Display nearby tags"] \
-variable showneartags -variable showneartags
grid x $top.ntag -sticky w grid x $top.ntag -sticky w
${NS}::checkbutton $top.hideremotes -text [mc "Hide remote refs"] \
-variable hideremotes
grid x $top.hideremotes -sticky w
${NS}::checkbutton $top.ldiff -text [mc "Limit diffs to listed paths"] \ ${NS}::checkbutton $top.ldiff -text [mc "Limit diffs to listed paths"] \
-variable limitdiffs -variable limitdiffs
grid x $top.ldiff -sticky w grid x $top.ldiff -sticky w
@ -10684,7 +10760,7 @@ proc prefscan {} {
global oldprefs prefstop global oldprefs prefstop


foreach v {maxwidth maxgraphpct showneartags showlocalchanges \ foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
limitdiffs tabstop perfile_attrs} { limitdiffs tabstop perfile_attrs hideremotes} {
global $v global $v
set $v $oldprefs($v) set $v $oldprefs($v)
} }
@ -10698,6 +10774,7 @@ proc prefsok {} {
global oldprefs prefstop showneartags showlocalchanges global oldprefs prefstop showneartags showlocalchanges
global fontpref mainfont textfont uifont global fontpref mainfont textfont uifont
global limitdiffs treediffs perfile_attrs global limitdiffs treediffs perfile_attrs
global hideremotes


catch {destroy $prefstop} catch {destroy $prefstop}
unset prefstop unset prefstop
@ -10743,6 +10820,9 @@ proc prefsok {} {
$limitdiffs != $oldprefs(limitdiffs)} { $limitdiffs != $oldprefs(limitdiffs)} {
reselectline reselectline
} }
if {$hideremotes != $oldprefs(hideremotes)} {
rereadrefs
}
} }


proc formatdate {d} { proc formatdate {d} {
@ -11038,7 +11118,7 @@ proc gitattr {path attr default} {
} else { } else {
set r "unspecified" set r "unspecified"
if {![catch {set line [exec git check-attr $attr -- $path]}]} { if {![catch {set line [exec git check-attr $attr -- $path]}]} {
regexp "(.*): encoding: (.*)" $line m f r regexp "(.*): $attr: (.*)" $line m f r
} }
set path_attr_cache($attr,$path) $r set path_attr_cache($attr,$path) $r
} }
@ -11066,7 +11146,7 @@ proc cache_gitattr {attr pathlist} {
set newlist [lrange $newlist $lim end] set newlist [lrange $newlist $lim end]
if {![catch {set rlist [eval exec git check-attr $attr -- $head]}]} { if {![catch {set rlist [eval exec git check-attr $attr -- $head]}]} {
foreach row [split $rlist "\n"] { foreach row [split $rlist "\n"] {
if {[regexp "(.*): encoding: (.*)" $row m path value]} { if {[regexp "(.*): $attr: (.*)" $row m path value]} {
if {[string index $path 0] eq "\""} { if {[string index $path 0] eq "\""} {
set path [encoding convertfrom [lindex $path 0]] set path [encoding convertfrom [lindex $path 0]]
} }
@ -11148,6 +11228,7 @@ set mingaplen 100
set cmitmode "patch" set cmitmode "patch"
set wrapcomment "none" set wrapcomment "none"
set showneartags 1 set showneartags 1
set hideremotes 0
set maxrefs 20 set maxrefs 20
set maxlinelen 200 set maxlinelen 200
set showlocalchanges 1 set showlocalchanges 1
@ -11295,6 +11376,7 @@ if {![info exists use_ttk]} {
set use_ttk [llength [info commands ::ttk::style]] set use_ttk [llength [info commands ::ttk::style]]
} }
set NS [expr {$use_ttk ? "ttk" : ""}] set NS [expr {$use_ttk ? "ttk" : ""}]
set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]


set runq {} set runq {}
set history {} set history {}

680
po/de.po

File diff suppressed because it is too large Load Diff

857
po/sv.po

File diff suppressed because it is too large Load Diff