diff options
author | Pratyush Yadav <me@yadavpratyush.com> | 2020-02-17 16:39:29 +0100 |
---|---|---|
committer | Pratyush Yadav <me@yadavpratyush.com> | 2020-03-17 14:18:54 +0100 |
commit | 8a8efbe4140fd732e1890cbba6eaa85c0fac85e2 (patch) | |
tree | 35a1fdbfd785acc885d59072f195a766d6820718 /lib/index.tcl | |
parent | Merge branch 'zs/open-current-file' (diff) | |
download | git-8a8efbe4140fd732e1890cbba6eaa85c0fac85e2.tar.xz git-8a8efbe4140fd732e1890cbba6eaa85c0fac85e2.zip |
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 '')
-rw-r--r-- | lib/index.tcl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/index.tcl b/lib/index.tcl index 1254145634..1fc5b42300 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 |