Фиксы и тесты работы с git
This commit is contained in:
parent
138dc7c247
commit
91fc22a121
1
TODO
1
TODO
|
@ -5,7 +5,6 @@
|
||||||
# Home page: https://nuk-svk.ru
|
# Home page: https://nuk-svk.ru
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
|
|
||||||
2. Подстветку текущей вкладки и элемента в дереве
|
2. Подстветку текущей вкладки и элемента в дереве
|
||||||
|
|
||||||
--- Ansible ---
|
--- Ansible ---
|
||||||
|
|
20
lib/git.tcl
20
lib/git.tcl
|
@ -299,11 +299,14 @@ namespace eval Git {
|
||||||
|
|
||||||
proc ListBoxPress {w} {
|
proc ListBoxPress {w} {
|
||||||
if {[$w.body.lBox curselection] ne ""} {
|
if {[$w.body.lBox curselection] ne ""} {
|
||||||
|
if {[llength [$w.body.lBox curselection]] == 1} {
|
||||||
set fileName [$w.body.lBox get [$w.body.lBox curselection]]
|
set fileName [$w.body.lBox get [$w.body.lBox curselection]]
|
||||||
|
} else {
|
||||||
|
set fileName [$w.body.lBox get [$w.body.lBox index active]]
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
# puts $values
|
|
||||||
$w.body.t delete 1.0 end
|
$w.body.t delete 1.0 end
|
||||||
set i 0
|
set i 0
|
||||||
foreach line [Git::Diff $fileName] {
|
foreach line [Git::Diff $fileName] {
|
||||||
|
@ -317,16 +320,19 @@ namespace eval Git {
|
||||||
}
|
}
|
||||||
proc CommitAdd {w} {
|
proc CommitAdd {w} {
|
||||||
global activeProject cfgVariables
|
global activeProject cfgVariables
|
||||||
set fileName [$w.body.lBox get [$w.body.lBox curselection]]
|
|
||||||
# puts $values
|
# puts $values
|
||||||
set cmd exec
|
set cmd exec
|
||||||
lappend cmd $cfgVariables(gitCommand)
|
lappend cmd $cfgVariables(gitCommand)
|
||||||
lappend cmd "add"
|
lappend cmd "add"
|
||||||
|
foreach itemNumber [$w.body.lBox curselection] {
|
||||||
|
set fileName [$w.body.lBox get $itemNumber]
|
||||||
lappend cmd [file join $activeProject $fileName]
|
lappend cmd [file join $activeProject $fileName]
|
||||||
|
$w.body.lBox delete $itemNumber
|
||||||
|
}
|
||||||
catch $cmd pipe
|
catch $cmd pipe
|
||||||
puts $cmd
|
puts $cmd
|
||||||
$w.body.lCommit insert end $fileName
|
$w.body.lCommit insert end $fileName
|
||||||
$w.body.lBox delete [$w.body.lBox curselection]
|
|
||||||
}
|
}
|
||||||
proc Key {k fr} {
|
proc Key {k fr} {
|
||||||
# puts [Editor::Key $k]
|
# puts [Editor::Key $k]
|
||||||
|
@ -531,7 +537,7 @@ namespace eval Git {
|
||||||
ttk::label $fr.body.lblUnindexed -justify left -padding {3 3} \
|
ttk::label $fr.body.lblUnindexed -justify left -padding {3 3} \
|
||||||
-text "[::msgcat::mc "Unindexed changes"]:"
|
-text "[::msgcat::mc "Unindexed changes"]:"
|
||||||
|
|
||||||
listbox $fr.body.lBox selectmode multiple -border 0 \
|
listbox $fr.body.lBox -selectmode extended -border 0 \
|
||||||
-yscrollcommand "$fr.body.yscroll set" -width 10
|
-yscrollcommand "$fr.body.yscroll set" -width 10
|
||||||
ttk::scrollbar $fr.body.yscroll -orient vertical -command "$fr.body.lBox yview"
|
ttk::scrollbar $fr.body.yscroll -orient vertical -command "$fr.body.lBox yview"
|
||||||
|
|
||||||
|
@ -549,7 +555,8 @@ namespace eval Git {
|
||||||
ttk::label $fr.body.lblCommitText -padding {3 3} \
|
ttk::label $fr.body.lblCommitText -padding {3 3} \
|
||||||
-text "[::msgcat::mc "Commit description"]:"
|
-text "[::msgcat::mc "Commit description"]:"
|
||||||
|
|
||||||
listbox $fr.body.lCommit -border 0 -yscrollcommand "$fr.body.vlCommit set"
|
listbox $fr.body.lCommit -selectmode multiple -border 0 \
|
||||||
|
-yscrollcommand "$fr.body.vlCommit set"
|
||||||
ttk::scrollbar $fr.body.vlCommit -orient vertical -command "$fr.body.lCommit yview"
|
ttk::scrollbar $fr.body.vlCommit -orient vertical -command "$fr.body.lCommit yview"
|
||||||
ttk::scrollbar $fr.body.vCommit -command "$fr.body.tCommit yview"
|
ttk::scrollbar $fr.body.vCommit -command "$fr.body.tCommit yview"
|
||||||
# ttk::scrollbar $fr.body.hCommit -orient horizontal -command "$fr.body.tCommit xview"
|
# ttk::scrollbar $fr.body.hCommit -orient horizontal -command "$fr.body.tCommit xview"
|
||||||
|
@ -630,7 +637,8 @@ namespace eval Git {
|
||||||
bind $fr.body.lBox <Return> "Git::CommitAdd $fr"
|
bind $fr.body.lBox <Return> "Git::CommitAdd $fr"
|
||||||
bind $fr.body.lBox <Double-Button-1> \
|
bind $fr.body.lBox <Double-Button-1> \
|
||||||
"catch {Git::CommitAdd $fr; $fr.body.t delete 0.0 end; $fr.body.tCommit delete 0.0 end}"
|
"catch {Git::CommitAdd $fr; $fr.body.t delete 0.0 end; $fr.body.tCommit delete 0.0 end}"
|
||||||
bind $fr.body.lBox <Button-1><ButtonRelease-1> "Git::ListBoxPress $fr"
|
# bind $fr.body.lBox <Button-1><ButtonPress-1> "Git::ListBoxPress $fr"
|
||||||
|
bind $fr.body.lBox <<ListboxSelect>> "Git::ListBoxPress $fr"
|
||||||
bind $fr.body.lBox <KeyRelease> "Git::Key %K $fr"
|
bind $fr.body.lBox <KeyRelease> "Git::Key %K $fr"
|
||||||
|
|
||||||
bind $fr.body.lLog <Double-Button-1> "Git::Show $fr"
|
bind $fr.body.lLog <Double-Button-1> "Git::Show $fr"
|
||||||
|
|
|
@ -10,7 +10,7 @@ exec wish "$0" -- "$@"
|
||||||
######################################################
|
######################################################
|
||||||
# Version: 2.0.0
|
# Version: 2.0.0
|
||||||
# Release: alpha
|
# Release: alpha
|
||||||
# Build: 16112022151647
|
# Build: 16112022152218
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
# определим текущую версию, релиз и т.д.
|
# определим текущую версию, релиз и т.д.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user