Skip to content

Commit 35c9518

Browse files
committed
gitk: "fconfigure" is superseded by "chan configure"
"fconfigure" is obsoleted since Tcl 9 and superseded by "chan configure". "chan configure" is also works on Tcl 8.6. Signed-off-by: YOKOTA Hiroshi <[email protected]>
1 parent 9a51879 commit 35c9518

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

gitk

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,9 @@ proc start_rev_list {view} {
544544
if {$showlocalchanges && $viewmainheadid($view) ne {}} {
545545
interestedin $viewmainheadid($view) dodiffindex
546546
}
547-
fconfigure $fd -blocking 0 -translation lf -eofchar {}
547+
chan configure $fd -blocking 0 -translation lf -eofchar {}
548548
if {$tclencoding != {}} {
549-
fconfigure $fd -encoding $tclencoding
549+
chan configure $fd -encoding $tclencoding
550550
}
551551
filerun $fd [list getcommitlines $fd $i $view 0]
552552
nowbusy $view [mc "Reading"]
@@ -694,9 +694,9 @@ proc updatecommits {} {
694694
}
695695
set i [reg_instance $fd]
696696
lappend viewinstances($view) $i
697-
fconfigure $fd -blocking 0 -translation lf -eofchar {}
697+
chan configure $fd -blocking 0 -translation lf -eofchar {}
698698
if {$tclencoding != {}} {
699-
fconfigure $fd -encoding $tclencoding
699+
chan configure $fd -encoding $tclencoding
700700
}
701701
filerun $fd [list getcommitlines $fd $i $view 1]
702702
incr viewactive($view)
@@ -1560,7 +1560,7 @@ proc getcommitlines {fd inst view updating} {
15601560
set viewinstances($view) [lreplace $viewinstances($view) $i $i]
15611561
}
15621562
# set it blocking so we wait for the process to terminate
1563-
fconfigure $fd -blocking 1
1563+
chan configure $fd -blocking 1
15641564
if {[catch {close $fd} err]} {
15651565
set fv {}
15661566
if {$view != $curview} {
@@ -1774,9 +1774,9 @@ proc do_readcommit {id} {
17741774
# Invoke git-log to handle automatic encoding conversion
17751775
set fd [open [concat | git log --no-color --pretty=raw -1 $id] r]
17761776
# Read the results using i18n.logoutputencoding
1777-
fconfigure $fd -translation lf -eofchar {}
1777+
chan configure $fd -translation lf -eofchar {}
17781778
if {$tclencoding != {}} {
1779-
fconfigure $fd -encoding $tclencoding
1779+
chan configure $fd -encoding $tclencoding
17801780
}
17811781
set contents [read $fd]
17821782
close $fd
@@ -1910,7 +1910,7 @@ proc readrefs {} {
19101910
}
19111911
set refd [open [list | git show-ref -d] r]
19121912
if {$tclencoding != {}} {
1913-
fconfigure $refd -encoding $tclencoding
1913+
chan configure $refd -encoding $tclencoding
19141914
}
19151915
while {[gets $refd line] >= 0} {
19161916
if {[string index $line 40] ne " "} continue
@@ -3814,7 +3814,7 @@ proc external_diff {} {
38143814
file delete -force $diffdir
38153815
error_popup "$extdifftool: [mc "command failed:"] $err"
38163816
} else {
3817-
fconfigure $fl -blocking 0
3817+
chan configure $fl -blocking 0
38183818
filerun $fl [list delete_at_eof $fl $diffdir]
38193819
}
38203820
}
@@ -4043,7 +4043,7 @@ proc show_line_source {} {
40434043
return
40444044
}
40454045
nowbusy blaming [mc "Searching"]
4046-
fconfigure $f -blocking 0
4046+
chan configure $f -blocking 0
40474047
set i [reg_instance $f]
40484048
set blamestuff($i) {}
40494049
set blameinst $i
@@ -4072,7 +4072,7 @@ proc read_line_source {fd inst} {
40724072
unset commfd($inst)
40734073
unset blameinst
40744074
notbusy blaming
4075-
fconfigure $fd -blocking 1
4075+
chan configure $fd -blocking 1
40764076
if {[catch {close $fd} err]} {
40774077
error_popup [mc "Error running git blame: %s" $err]
40784078
return 0
@@ -4964,7 +4964,7 @@ proc do_file_hl {serial} {
49644964
}
49654965
set cmd [concat | git diff-tree -r -s --stdin $gdtargs]
49664966
set filehighlight [open $cmd r+]
4967-
fconfigure $filehighlight -blocking 0
4967+
chan configure $filehighlight -blocking 0
49684968
filerun $filehighlight readfhighlight
49694969
set fhl_list {}
49704970
drawvisible
@@ -5396,7 +5396,7 @@ proc get_viewmainhead {view} {
53965396
-- $vfilelimit($view)] r]
53975397
set j [reg_instance $rfd]
53985398
lappend viewinstances($view) $j
5399-
fconfigure $rfd -blocking 0
5399+
chan configure $rfd -blocking 0
54005400
filerun $rfd [list getviewhead $rfd $j $view]
54015401
set viewmainheadid($curview) {}
54025402
}
@@ -5466,7 +5466,7 @@ proc dodiffindex {} {
54665466
set cmd [concat $cmd -- $vfilelimit($curview)]
54675467
}
54685468
set fd [open $cmd r]
5469-
fconfigure $fd -blocking 0
5469+
chan configure $fd -blocking 0
54705470
set i [reg_instance $fd]
54715471
filerun $fd [list readdiffindex $fd $lserial $i]
54725472
}
@@ -5495,7 +5495,7 @@ proc readdiffindex {fd serial inst} {
54955495
set cmd [concat $cmd -- $vfilelimit($curview)]
54965496
}
54975497
set fd [open $cmd r]
5498-
fconfigure $fd -blocking 0
5498+
chan configure $fd -blocking 0
54995499
set i [reg_instance $fd]
55005500
filerun $fd [list readdifffiles $fd $serial $i]
55015501
@@ -7802,7 +7802,7 @@ proc gettree {id} {
78027802
set treepending $id
78037803
set treefilelist($id) {}
78047804
set treeidlist($id) {}
7805-
fconfigure $gtf -blocking 0 -translation binary
7805+
chan configure $gtf -blocking 0 -translation binary
78067806
filerun $gtf [list gettreeline $gtf $id]
78077807
}
78087808
} else {
@@ -7871,7 +7871,7 @@ proc showfile {f} {
78717871
return
78727872
}
78737873
}
7874-
fconfigure $bf -blocking 0 -encoding [get_path_encoding $f]
7874+
chan configure $bf -blocking 0 -encoding [get_path_encoding $f]
78757875
filerun $bf [list getblobline $bf $diffids]
78767876
$ctext config -state normal
78777877
clear_ctext $commentend
@@ -8065,7 +8065,7 @@ proc gettreediffs {ids} {
80658065
80668066
set treepending $ids
80678067
set treediff {}
8068-
fconfigure $gdtf -blocking 0 -translation binary
8068+
chan configure $gdtf -blocking 0 -translation binary
80698069
filerun $gdtf [list gettreediffline $gdtf $ids]
80708070
}
80718071
@@ -8185,7 +8185,7 @@ proc getblobdiffs {ids} {
81858185
error_popup [mc "Error getting diffs: %s" $err]
81868186
return
81878187
}
8188-
fconfigure $bdf -blocking 0 -translation binary -eofchar {}
8188+
chan configure $bdf -blocking 0 -translation binary -eofchar {}
81898189
set blobdifffd($ids) $bdf
81908190
initblobdiffvars
81918191
filerun $bdf [list getblobdiffline $bdf $diffids]
@@ -10379,7 +10379,7 @@ proc getallcommits {} {
1037910379
set cmd [concat $cmd --stdin "<<[join $ids "\\n"]"]
1038010380
}
1038110381
set fd [open $cmd r]
10382-
fconfigure $fd -blocking 0
10382+
chan configure $fd -blocking 0
1038310383
incr allcommits
1038410384
nowbusy allcommits
1038510385
filerun $fd [list getallclines $fd]
@@ -10487,7 +10487,7 @@ proc getallclines {fd} {
1048710487
}
1048810488
set cacheok 1
1048910489
if {[catch {
10490-
fconfigure $fd -blocking 1
10490+
chan configure $fd -blocking 1
1049110491
close $fd
1049210492
} err]} {
1049310493
# got an error reading the list of commits

0 commit comments

Comments
 (0)