summaryrefslogtreecommitdiff
path: root/lib/index.tcl
diff options
context:
space:
mode:
authorPratyush Yadav <me@yadavpratyush.com>2020-02-17 15:39:29 (GMT)
committerPratyush Yadav <me@yadavpratyush.com>2020-03-17 13:18:54 (GMT)
commit8a8efbe4140fd732e1890cbba6eaa85c0fac85e2 (patch)
tree35a1fdbfd785acc885d59072f195a766d6820718 /lib/index.tcl
parent0d2116c6441079a5a1091e4cf152fd9d5fa9811b (diff)
downloadgit-8a8efbe4140fd732e1890cbba6eaa85c0fac85e2.zip
git-8a8efbe4140fd732e1890cbba6eaa85c0fac85e2.tar.gz
git-8a8efbe4140fd732e1890cbba6eaa85c0fac85e2.tar.bz2
git-gui: reduce Tcl version requirement from 8.6 to 8.5
On some MacOS distributions like High Sierra, Tcl 8.5 is shipped by default. This makes git-gui error out at startup because of the version mismatch. The only part that requires Tcl 8.6 is SimpleChord, which depends on TclOO. So, don't use it and use our homegrown class.tcl instead. This means some slight syntax changes. Since class.tcl doesn't have an "unknown" method like TclOO does, we can't just call '$note', but have to use '$note activate' instead. The constructor now needs a proper namespace qualifier. Update the documentation to reflect the new syntax. As of now, the only part of git-gui that needs Tcl 8.5 is a call to 'apply' in lib/index.tcl::lambda. Keep using it until someone shows up shouting that their OS ships with 8.4 only. Then we would have to look into implementing it in pure Tcl. Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
Diffstat (limited to 'lib/index.tcl')
-rw-r--r--lib/index.tcl10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/index.tcl b/lib/index.tcl
index 1254145..1fc5b42 100644
--- a/lib/index.tcl
+++ b/lib/index.tcl
@@ -436,7 +436,7 @@ proc revert_helper {txt paths} {
#
# The asynchronous operations are each indicated below by a comment
# before the code block that starts the async operation.
- set after_chord [SimpleChord new {
+ set after_chord [SimpleChord::new {
if {[string trim $err] != ""} {
rescan_on_error $err
} else {
@@ -522,10 +522,11 @@ proc revert_helper {txt paths} {
]
if {$reply == 1} {
+ set note [$after_chord add_note]
checkout_index \
$txt \
$path_list \
- [$after_chord add_note] \
+ [list $note activate] \
$capture_error
}
}
@@ -567,14 +568,15 @@ proc revert_helper {txt paths} {
if {$reply == 1} {
$after_chord eval { set should_reshow_diff 1 }
- delete_files $untracked_list [$after_chord add_note]
+ set note [$after_chord add_note]
+ delete_files $untracked_list [list $note activate]
}
}
# Activate the common note. If no other notes were created, this
# completes the chord. If other notes were created, then this common
# note prevents a race condition where the chord might complete early.
- $after_common_note
+ $after_common_note activate
}
# Delete all of the specified files, performing deletion in batches to allow the