Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Update swedish translation.
  gitk: Updated German translation
  gitk: Fallback to selecting the head commit upon load
  gitk: Fixed automatic row selection during load
  gitk: Fixed broken exception handling in diff
  gitk: On Windows, use a Cygwin-specific flag for kill
  gitk: Arrange to kill diff-files & diff-index on quit
  gitk: Kill back-end processes on window close
This commit is contained in:
Junio C Hamano
2008-08-06 13:32:12 -07:00
3 changed files with 422 additions and 324 deletions

View File

@ -90,6 +90,15 @@ proc dorunq {} {
} }
} }
proc reg_instance {fd} {
global commfd leftover loginstance
set i [incr loginstance]
set commfd($i) $fd
set leftover($i) {}
return $i
}
proc unmerged_files {files} { proc unmerged_files {files} {
global nr_unmerged global nr_unmerged
@ -294,11 +303,11 @@ proc parseviewrevs {view revs} {
# Start off a git log process and arrange to read its output # Start off a git log process and arrange to read its output
proc start_rev_list {view} { proc start_rev_list {view} {
global startmsecs commitidx viewcomplete curview global startmsecs commitidx viewcomplete curview
global commfd leftover tclencoding global tclencoding
global viewargs viewargscmd viewfiles vfilelimit global viewargs viewargscmd viewfiles vfilelimit
global showlocalchanges commitinterest global showlocalchanges commitinterest
global viewactive loginstance viewinstances vmergeonly global viewactive viewinstances vmergeonly
global pending_select mainheadid global mainheadid
global vcanopt vflags vrevs vorigargs global vcanopt vflags vrevs vorigargs
set startmsecs [clock clicks -milliseconds] set startmsecs [clock clicks -milliseconds]
@ -354,10 +363,8 @@ proc start_rev_list {view} {
error_popup "[mc "Error executing git log:"] $err" error_popup "[mc "Error executing git log:"] $err"
return 0 return 0
} }
set i [incr loginstance] set i [reg_instance $fd]
set viewinstances($view) [list $i] set viewinstances($view) [list $i]
set commfd($i) $fd
set leftover($i) {}
if {$showlocalchanges && $mainheadid ne {}} { if {$showlocalchanges && $mainheadid ne {}} {
lappend commitinterest($mainheadid) {dodiffindex} lappend commitinterest($mainheadid) {dodiffindex}
} }
@ -367,36 +374,63 @@ proc start_rev_list {view} {
} }
filerun $fd [list getcommitlines $fd $i $view 0] filerun $fd [list getcommitlines $fd $i $view 0]
nowbusy $view [mc "Reading"] nowbusy $view [mc "Reading"]
if {$view == $curview} {
set pending_select $mainheadid
}
set viewcomplete($view) 0 set viewcomplete($view) 0
set viewactive($view) 1 set viewactive($view) 1
return 1 return 1
} }
proc stop_rev_list {view} { proc stop_instance {inst} {
global commfd viewinstances leftover global commfd leftover
foreach inst $viewinstances($view) { set fd $commfd($inst)
set fd $commfd($inst) catch {
catch { set pid [pid $fd]
set pid [pid $fd]
if {$::tcl_platform(platform) eq {windows}} {
exec kill -f $pid
} else {
exec kill $pid exec kill $pid
} }
catch {close $fd} }
nukefile $fd catch {close $fd}
unset commfd($inst) nukefile $fd
unset leftover($inst) unset commfd($inst)
unset leftover($inst)
}
proc stop_backends {} {
global commfd
foreach inst [array names commfd] {
stop_instance $inst
}
}
proc stop_rev_list {view} {
global viewinstances
foreach inst $viewinstances($view) {
stop_instance $inst
} }
set viewinstances($view) {} set viewinstances($view) {}
} }
proc getcommits {} { proc reset_pending_select {selid} {
global pending_select mainheadid
if {$selid ne {}} {
set pending_select $selid
} else {
set pending_select $mainheadid
}
}
proc getcommits {selid} {
global canv curview need_redisplay viewactive global canv curview need_redisplay viewactive
initlayout initlayout
if {[start_rev_list $curview]} { if {[start_rev_list $curview]} {
reset_pending_select $selid
show_status [mc "Reading commits..."] show_status [mc "Reading commits..."]
set need_redisplay 1 set need_redisplay 1
} else { } else {
@ -406,8 +440,8 @@ proc getcommits {} {
proc updatecommits {} { proc updatecommits {} {
global curview vcanopt vorigargs vfilelimit viewinstances global curview vcanopt vorigargs vfilelimit viewinstances
global viewactive viewcomplete loginstance tclencoding global viewactive viewcomplete tclencoding
global startmsecs commfd showneartags showlocalchanges leftover global startmsecs showneartags showlocalchanges
global mainheadid pending_select global mainheadid pending_select
global isworktree global isworktree
global varcid vposids vnegids vflags vrevs global varcid vposids vnegids vflags vrevs
@ -468,10 +502,8 @@ proc updatecommits {} {
if {$viewactive($view) == 0} { if {$viewactive($view) == 0} {
set startmsecs [clock clicks -milliseconds] set startmsecs [clock clicks -milliseconds]
} }
set i [incr loginstance] set i [reg_instance $fd]
lappend viewinstances($view) $i lappend viewinstances($view) $i
set commfd($i) $fd
set leftover($i) {}
fconfigure $fd -blocking 0 -translation lf -eofchar {} fconfigure $fd -blocking 0 -translation lf -eofchar {}
if {$tclencoding != {}} { if {$tclencoding != {}} {
fconfigure $fd -encoding $tclencoding fconfigure $fd -encoding $tclencoding
@ -479,7 +511,7 @@ proc updatecommits {} {
filerun $fd [list getcommitlines $fd $i $view 1] filerun $fd [list getcommitlines $fd $i $view 1]
incr viewactive($view) incr viewactive($view)
set viewcomplete($view) 0 set viewcomplete($view) 0
set pending_select $mainheadid reset_pending_select {}
nowbusy $view "Reading" nowbusy $view "Reading"
if {$showneartags} { if {$showneartags} {
getallcommits getallcommits
@ -491,6 +523,11 @@ proc reloadcommits {} {
global showneartags treediffs commitinterest cached_commitrow global showneartags treediffs commitinterest cached_commitrow
global targetid global targetid
set selid {}
if {$selectedline ne {}} {
set selid $currentid
}
if {!$viewcomplete($curview)} { if {!$viewcomplete($curview)} {
stop_rev_list $curview stop_rev_list $curview
} }
@ -509,7 +546,7 @@ proc reloadcommits {} {
catch {unset cached_commitrow} catch {unset cached_commitrow}
catch {unset targetid} catch {unset targetid}
setcanvscroll setcanvscroll
getcommits getcommits $selid
return 0 return 0
} }
@ -1469,8 +1506,15 @@ proc chewcommits {} {
global numcommits startmsecs global numcommits startmsecs
if {[info exists pending_select]} { if {[info exists pending_select]} {
set row [first_real_row] update
selectline $row 1 reset_pending_select {}
if {[commitinview $pending_select $curview]} {
selectline [rowofcommit $pending_select] 1
} else {
set row [first_real_row]
selectline $row 1
}
} }
if {$commitidx($curview) > 0} { if {$commitidx($curview) > 0} {
#set ms [expr {[clock clicks -milliseconds] - $startmsecs}] #set ms [expr {[clock clicks -milliseconds] - $startmsecs}]
@ -2103,6 +2147,7 @@ proc makewindow {} {
bind . <$M1B-minus> {incrfont -1} bind . <$M1B-minus> {incrfont -1}
bind . <$M1B-KP_Subtract> {incrfont -1} bind . <$M1B-KP_Subtract> {incrfont -1}
wm protocol . WM_DELETE_WINDOW doquit wm protocol . WM_DELETE_WINDOW doquit
bind . <Destroy> {stop_backends}
bind . <Button-1> "click %W" bind . <Button-1> "click %W"
bind $fstring <Key-Return> {dofind 1 1} bind $fstring <Key-Return> {dofind 1 1}
bind $sha1entry <Key-Return> gotocommit bind $sha1entry <Key-Return> gotocommit
@ -3300,10 +3345,7 @@ proc showview {n} {
run refill_reflist run refill_reflist
if {![info exists viewcomplete($n)]} { if {![info exists viewcomplete($n)]} {
if {$selid ne {}} { getcommits $selid
set pending_select $selid
}
getcommits
return return
} }
@ -3337,18 +3379,18 @@ proc showview {n} {
drawvisible drawvisible
if {$row ne {}} { if {$row ne {}} {
selectline $row 0 selectline $row 0
} elseif {$mainheadid ne {} && [commitinview $mainheadid $curview]} {
selectline [rowofcommit $mainheadid] 1
} elseif {!$viewcomplete($n)} { } elseif {!$viewcomplete($n)} {
if {$selid ne {}} { reset_pending_select $selid
set pending_select $selid
} else {
set pending_select $mainheadid
}
} else { } else {
set row [first_real_row] reset_pending_select {}
if {$row < $numcommits} {
selectline $row 0 if {[commitinview $pending_select $curview]} {
selectline [rowofcommit $pending_select] 1
} else {
set row [first_real_row]
if {$row < $numcommits} {
selectline $row 0
}
} }
} }
if {!$viewcomplete($n)} { if {!$viewcomplete($n)} {
@ -4011,6 +4053,7 @@ proc layoutmore {} {
} }
if {[info exists pending_select] && if {[info exists pending_select] &&
[commitinview $pending_select $curview]} { [commitinview $pending_select $curview]} {
update
selectline [rowofcommit $pending_select] 1 selectline [rowofcommit $pending_select] 1
} }
drawvisible drawvisible
@ -4048,10 +4091,11 @@ proc dodiffindex {} {
incr lserial incr lserial
set fd [open "|git diff-index --cached HEAD" r] set fd [open "|git diff-index --cached HEAD" r]
fconfigure $fd -blocking 0 fconfigure $fd -blocking 0
filerun $fd [list readdiffindex $fd $lserial] set i [reg_instance $fd]
filerun $fd [list readdiffindex $fd $lserial $i]
} }
proc readdiffindex {fd serial} { proc readdiffindex {fd serial inst} {
global mainheadid nullid nullid2 curview commitinfo commitdata lserial global mainheadid nullid nullid2 curview commitinfo commitdata lserial
set isdiff 1 set isdiff 1
@ -4062,7 +4106,7 @@ proc readdiffindex {fd serial} {
set isdiff 0 set isdiff 0
} }
# we only need to see one line and we don't really care what it says... # we only need to see one line and we don't really care what it says...
close $fd stop_instance $inst
if {$serial != $lserial} { if {$serial != $lserial} {
return 0 return 0
@ -4071,7 +4115,8 @@ proc readdiffindex {fd serial} {
# now see if there are any local changes not checked in to the index # now see if there are any local changes not checked in to the index
set fd [open "|git diff-files" r] set fd [open "|git diff-files" r]
fconfigure $fd -blocking 0 fconfigure $fd -blocking 0
filerun $fd [list readdifffiles $fd $serial] set i [reg_instance $fd]
filerun $fd [list readdifffiles $fd $serial $i]
if {$isdiff && ![commitinview $nullid2 $curview]} { if {$isdiff && ![commitinview $nullid2 $curview]} {
# add the line for the changes in the index to the graph # add the line for the changes in the index to the graph
@ -4088,7 +4133,7 @@ proc readdiffindex {fd serial} {
return 0 return 0
} }
proc readdifffiles {fd serial} { proc readdifffiles {fd serial inst} {
global mainheadid nullid nullid2 curview global mainheadid nullid nullid2 curview
global commitinfo commitdata lserial global commitinfo commitdata lserial
@ -4100,7 +4145,7 @@ proc readdifffiles {fd serial} {
set isdiff 0 set isdiff 0
} }
# we only need to see one line and we don't really care what it says... # we only need to see one line and we don't really care what it says...
close $fd stop_instance $inst
if {$serial != $lserial} { if {$serial != $lserial} {
return 0 return 0
@ -6430,9 +6475,10 @@ proc diffcmd {ids flags} {
proc gettreediffs {ids} { proc gettreediffs {ids} {
global treediff treepending global treediff treepending
if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return
set treepending $ids set treepending $ids
set treediff {} set treediff {}
if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return
fconfigure $gdtf -blocking 0 fconfigure $gdtf -blocking 0
filerun $gdtf [list gettreediffline $gdtf $ids] filerun $gdtf [list gettreediffline $gdtf $ids]
} }
@ -9945,4 +9991,4 @@ if {[info exists permviews]} {
addviewmenu $n addviewmenu $n
} }
} }
getcommits getcommits {}

View File

@ -7,19 +7,37 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: git-gui\n" "Project-Id-Version: git-gui\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-05-01 11:54+0200\n" "POT-Creation-Date: 2008-05-24 22:32+0200\n"
"PO-Revision-Date: 2008-05-02 21:12+0200\n" "PO-Revision-Date: 2008-05-24 22:40+0200\n"
"Last-Translator: Christian Stimming <stimming@tuhh.de>\n" "Last-Translator: Christian Stimming <stimming@tuhh.de>\n"
"Language-Team: German\n" "Language-Team: German\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: gitk:111 #: gitk:102
msgid "Error executing git rev-list:" msgid "Couldn't get list of unmerged files:"
msgstr "Fehler beim Ausführen von git-rev-list:" msgstr "Liste der nicht-zusammengeführten Dateien nicht gefunden:"
#: gitk:124 #: gitk:329
msgid "No files selected: --merge specified but no files are unmerged."
msgstr ""
"Keine Dateien ausgewählt: --merge angegeben, es existieren aber keine nicht-"
"zusammengeführten Dateien."
#: gitk:332
msgid ""
"No files selected: --merge specified but no unmerged files are within file "
"limit."
msgstr ""
"Keine Dateien ausgewähle: --merge angegeben, aber keine nicht-"
"zusammengeführten Dateien sind in der Dateiauswahl."
#: gitk:354
msgid "Error executing git log:"
msgstr "Fehler beim Ausführen von git-log:"
#: gitk:369
msgid "Reading" msgid "Reading"
msgstr "Lesen" msgstr "Lesen"
@ -56,7 +74,11 @@ msgstr "Datei"
msgid "Update" msgid "Update"
msgstr "Aktualisieren" msgstr "Aktualisieren"
#: gitk:664 #: gitk:1722
msgid "Reload"
msgstr "Neu laden"
#: gitk:1723
msgid "Reread references" msgid "Reread references"
msgstr "Zweige neu laden" msgstr "Zweige neu laden"
@ -112,7 +134,11 @@ msgstr "Tastenkürzel"
msgid "SHA1 ID: " msgid "SHA1 ID: "
msgstr "SHA1:" msgstr "SHA1:"
#: gitk:791 #: gitk:1831
msgid "Row"
msgstr "Zeile"
#: gitk:1862
msgid "Find" msgid "Find"
msgstr "Suche" msgstr "Suche"
@ -126,19 +152,19 @@ msgstr "vorige"
#: gitk:794 #: gitk:794
msgid "commit" msgid "commit"
msgstr "Version" msgstr "Version nach"
#: gitk:797 gitk:799 gitk:2356 gitk:2379 gitk:2403 gitk:4306 gitk:4369 #: gitk:797 gitk:799 gitk:2356 gitk:2379 gitk:2403 gitk:4306 gitk:4369
msgid "containing:" msgid "containing:"
msgstr "enthaltend:" msgstr "Beschreibung:"
#: gitk:800 gitk:1778 gitk:1783 gitk:2431 #: gitk:800 gitk:1778 gitk:1783 gitk:2431
msgid "touching paths:" msgid "touching paths:"
msgstr "Pfad betreffend:" msgstr "Dateien:"
#: gitk:801 gitk:2436 #: gitk:801 gitk:2436
msgid "adding/removing string:" msgid "adding/removing string:"
msgstr "Zeichenkette ändernd:" msgstr "Änderungen:"
#: gitk:810 gitk:812 #: gitk:810 gitk:812
msgid "Exact" msgid "Exact"
@ -253,23 +279,25 @@ msgstr "Diesen auch hervorheben"
msgid "Highlight this only" msgid "Highlight this only"
msgstr "Nur diesen hervorheben" msgstr "Nur diesen hervorheben"
#: gitk:1318 #: gitk:2162
msgid "External diff"
msgstr "Externer Vergleich"
#: gitk:2403
msgid "" msgid ""
"\n" "\n"
"Gitk - a commit viewer for git\n" "Gitk - a commit viewer for git\n"
"\n" "\n"
"Copyright © 2005-2006 Paul Mackerras\n" "Copyright © 2005-2008 Paul Mackerras\n"
"\n" "\n"
"Use and redistribute under the terms of the GNU General Public License" "Use and redistribute under the terms of the GNU General Public License"
msgstr "" msgstr ""
"\n" "\n"
"Gitk - eine Visualisierung der Git Historie\n" "Gitk - eine Visualisierung der Git Historie\n"
"\n" "\n"
"Copyright © 2005-2006 Paul Mackerras\n" "Copyright © 2005-2008 Paul Mackerras\n"
"\n" "\n"
"Benutzung und Weiterverbreitung gemäß den Bedingungen der GNU General Public " "Benutzung und Weiterverbreitung gemäß den Bedingungen der GNU General Public License"
"License\n"
" "
#: gitk:1326 gitk:1387 gitk:6582 #: gitk:1326 gitk:1387 gitk:6582
msgid "Close" msgid "Close"
@ -450,11 +478,11 @@ msgstr "Name"
msgid "Remember this view" msgid "Remember this view"
msgstr "Diese Ansicht speichern" msgstr "Diese Ansicht speichern"
#: gitk:1928 #: gitk:3126
msgid "Commits to include (arguments to git rev-list):" msgid "Commits to include (arguments to git log):"
msgstr "Versionen anzeigen (Argumente von git-rev-list):" msgstr "Versionen anzeigen (Argumente von git-log):"
#: gitk:1935 #: gitk:3133
msgid "Command to generate more commits to include:" msgid "Command to generate more commits to include:"
msgstr "Versionsliste durch folgendes Kommando erzeugen lassen:" msgstr "Versionsliste durch folgendes Kommando erzeugen lassen:"
@ -566,7 +594,11 @@ msgstr "Kinder"
msgid "Reset %s branch to here" msgid "Reset %s branch to here"
msgstr "Zweig »%s« hierher zurücksetzen" msgstr "Zweig »%s« hierher zurücksetzen"
#: gitk:6050 #: gitk:7204
msgid "Detached head: can't reset"
msgstr "Zweigspitze ist abgetrennt: Zurücksetzen nicht möglich"
#: gitk:7236
msgid "Top" msgid "Top"
msgstr "Oben" msgstr "Oben"
@ -798,7 +830,15 @@ msgstr "Naheliegende Überschriften anzeigen"
msgid "Limit diffs to listed paths" msgid "Limit diffs to listed paths"
msgstr "Vergleich nur für angezeigte Pfade" msgstr "Vergleich nur für angezeigte Pfade"
#: gitk:8045 #: gitk:9264
msgid "External diff tool"
msgstr "Externes Vergleich-(Diff-)Programm"
#: gitk:9266
msgid "Choose..."
msgstr "Wählen..."
#: gitk:9271
msgid "Colors: press to choose" msgid "Colors: press to choose"
msgstr "Farben: Klicken zum Wählen" msgstr "Farben: Klicken zum Wählen"
@ -873,22 +913,6 @@ msgstr "Mehrdeutige Angabe »%s«: Sowohl Version als auch Dateiname existiert."
msgid "Bad arguments to gitk:" msgid "Bad arguments to gitk:"
msgstr "Falsche Kommandozeilen-Parameter für gitk:" msgstr "Falsche Kommandozeilen-Parameter für gitk:"
#: gitk:8637 #: gitk:9915
msgid "Couldn't get list of unmerged files:"
msgstr "Liste der nicht-zusammengeführten Dateien nicht gefunden:"
#: gitk:8653
msgid "No files selected: --merge specified but no files are unmerged."
msgstr "Keine Dateien ausgewählt: --merge angegeben, es existieren aber keine nicht-zusammengeführten Dateien."
#: gitk:8656
msgid ""
"No files selected: --merge specified but no unmerged files are within file "
"limit."
msgstr ""
"Keine Dateien ausgewähle: --merge angegeben, aber keine nicht-"
"zusammengeführten Dateien sind in der Dateiauswahl."
#: gitk:8717
msgid "Command line" msgid "Command line"
msgstr "Kommandozeile" msgstr "Kommandozeile"

File diff suppressed because it is too large Load Diff