index d151ddb078b7f1bd7669f6e7dc8744483e770786..1a7887b2528140d63b84a72843c0d0ef64f56538 100755 (executable)
--- a/gitk
+++ b/gitk
incr viewactive($view)
set viewcomplete($view) 0
reset_pending_select {}
- nowbusy $view "Reading"
+ nowbusy $view [mc "Reading"]
if {$showneartags} {
getallcommits
}
}
}
+ if {[info exists geometry(state)] && $geometry(state) eq "zoomed"} {
+ wm state . $geometry(state)
+ }
+
if {[tk windowingsystem] eq {aqua}} {
set M1B M1
set ::BM "3"
bindkey d "$ctext yview scroll 18 units"
bindkey u "$ctext yview scroll -18 units"
bindkey / {focus $fstring}
+ bindkey <Key-KP_Divide> {focus $fstring}
bindkey <Key-Return> {dofind 1 1}
bindkey ? {dofind -1 1}
bindkey f nextfile
puts $f [list set perfile_attrs $perfile_attrs]
puts $f "set geometry(main) [wm geometry .]"
+ puts $f "set geometry(state) [wm state .]"
puts $f "set geometry(topwidth) [winfo width .tf]"
puts $f "set geometry(topheight) [winfo height .tf]"
puts $f "set geometry(pwsash0) \"[.tf.histframe.pwclist sash coord 0]\""
set difftofile [external_diff_get_one_file $diffidto $flist_menu_file $diffdir]
if {$difffromfile ne {} && $difftofile ne {}} {
- set cmd [concat | [shellsplit $extdifftool] \
- [list $difffromfile $difftofile]]
- if {[catch {set fl [open $cmd r]} err]} {
+ set cmd [list [shellsplit $extdifftool] $difffromfile $difftofile]
+ if {[catch {set fl [open |$cmd r]} err]} {
file delete -force $diffdir
error_popup "$extdifftool: [mc "command failed:"] $err"
} else {
set newviewopts($curview,perm) $viewperm($curview)
set newviewopts($curview,cmd) $viewargscmd($curview)
decode_view_opts $curview $viewargs($curview)
- vieweditor $top $curview "Gitk: edit view $viewname($curview)"
+ vieweditor $top $curview "[mc "Gitk: edit view"] $viewname($curview)"
}
proc vieweditor {top n title} {
}
}
+proc appendshortlink {id {pre {}} {post {}}} {
+ global ctext linknum
+
+ $ctext insert end $pre
+ $ctext tag delete link$linknum
+ $ctext insert end [string range $id 0 7] link$linknum
+ $ctext insert end $post
+ setlink $id link$linknum
+ incr linknum
+}
+
proc makelink {id} {
global pendinglinks
global patchids
if {![info exists patchids($id)]} {
- set x [exec git diff-tree -p --root $id | git patch-id]
- set patchids($id) [lindex $x 0]
+ set cmd [diffcmd [list $id] {-p --root}]
+ # trim off the initial "|"
+ set cmd [lrange $cmd 1 end]
+ if {[catch {
+ set x [eval exec $cmd | git patch-id]
+ set patchids($id) [lindex $x 0]
+ }]} {
+ set patchids($id) "error"
+ }
}
return $patchids($id)
}
clear_ctext
init_flist {}
for {set i 0} {$i < 100} {incr i} {
- set shorta [string range $a 0 7]
- set shortb [string range $b 0 7]
set skipa 0
set skipb 0
if {[llength $parents($curview,$a)] > 1} {
- appendwithlinks [mc "Skipping merge commit %s\n" $shorta] {}
+ appendshortlink $a [mc "Skipping merge commit "] "\n"
set skipa 1
} else {
set patcha [getpatchid $a]
}
if {[llength $parents($curview,$b)] > 1} {
- appendwithlinks [mc "Skipping merge commit %s\n" $shortb] {}
+ appendshortlink $b [mc "Skipping merge commit "] "\n"
set skipb 1
} else {
set patchb [getpatchid $b]
if {!$skipa && !$skipb} {
set heada [lindex $commitinfo($a) 0]
set headb [lindex $commitinfo($b) 0]
+ if {$patcha eq "error"} {
+ appendshortlink $a [mc "Error getting patch ID for "] \
+ [mc " - stopping\n"]
+ break
+ }
+ if {$patchb eq "error"} {
+ appendshortlink $b [mc "Error getting patch ID for "] \
+ [mc " - stopping\n"]
+ break
+ }
if {$patcha eq $patchb} {
if {$heada eq $headb} {
- appendwithlinks [mc "Commit %s == %s %s\n" \
- $shorta $shortb $heada] {}
+ appendshortlink $a [mc "Commit "]
+ appendshortlink $b " == " " $heada\n"
} else {
- appendwithlinks [mc "Commit %s %s\n" $shorta $heada] {}
- appendwithlinks [mc " is the same patch as\n"] {}
- appendwithlinks [mc " %s %s\n" $shortb $headb] {}
+ appendshortlink $a [mc "Commit "] " $heada\n"
+ appendshortlink $b [mc " is the same patch as\n "] \
+ " $headb\n"
}
set skipa 1
set skipb 1
} else {
$ctext insert end "\n"
- appendwithlinks [mc "Commit %s %s\n" $shorta $heada] {}
- appendwithlinks [mc " differs from\n"] {}
- appendwithlinks [mc " %s %s\n" $shortb $headb] {}
- appendwithlinks [mc "- stopping\n"]
+ appendshortlink $a [mc "Commit "] " $heada\n"
+ appendshortlink $b [mc " differs from\n "] \
+ " $headb\n"
+ $ctext insert end [mc "- stopping\n"]
break
}
}
if {$skipa} {
if {[llength $children($curview,$a)] != 1} {
$ctext insert end "\n"
- appendwithlinks [mc "Commit %s has %s children - stopping\n" \
- $shorta [llength $children($curview,$a)]] {}
+ appendshortlink $a [mc "Commit "] \
+ [mc " has %s children - stopping\n" \
+ [llength $children($curview,$a)]]
break
}
set a [lindex $children($curview,$a) 0]
}
if {$skipb} {
if {[llength $children($curview,$b)] != 1} {
- appendwithlinks [mc "Commit %s has %s children - stopping\n" \
- $shortb [llength $children($curview,$b)]] {}
+ appendshortlink $b [mc "Commit "] \
+ [mc " has %s children - stopping\n" \
+ [llength $children($curview,$b)]]
break
}
set b [lindex $children($curview,$b) 0]
proc choose_extdiff {} {
global extdifftool
- set prog [tk_getOpenFile -title "External diff tool" -multiple false]
+ set prog [tk_getOpenFile -title [mc "External diff tool"] -multiple false]
if {$prog ne {}} {
set extdifftool $prog
}
# wait for the window to become visible
tkwait visibility .
wm title . "[file tail $argv0]: [file tail [pwd]]"
+update
readrefs
if {$cmdline_files ne {} || $revtreeargs ne {} || $revtreeargscmd ne {}} {