From ccc75b2b18f2a4b2f7e5cc75144c2aaa4fc6d9d4 Mon Sep 17 00:00:00 2001 From: svkalinin Date: Fri, 21 Oct 2022 13:21:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B2=D0=B5=D1=82=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/git.tcl | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/git.tcl b/lib/git.tcl index 039b723..63ff71d 100644 --- a/lib/git.tcl +++ b/lib/git.tcl @@ -45,7 +45,7 @@ namespace eval Git { return $res } - proc Branches {opt} { + proc Branches {opt {ent ".branch.entBranch"}} { global cfgVariables activeProject set cmd exec set d [pwd] @@ -53,19 +53,22 @@ namespace eval Git { cd $activeProject } lappend cmd $cfgVariables(gitCommand) - lappend cmd "branch" # lappend cmd "-s" # lappend cmd "--" # lappend cmd $activeProject switch $opt { current { + lappend cmd "branch" lappend cmd "--show-current" } list { + lappend cmd "branch" lappend cmd "-l" } new { - lappend cmd "-c" + lappend cmd "checkout" + lappend cmd "-b" + puts "Branch [$ent get]" } } catch $cmd pipe @@ -395,7 +398,7 @@ namespace eval Git { } proc BranchDialog {x y} { - global editors lexers + global editors lexers newBranchName variable win # set txt $w.frmText.t set win .branch @@ -406,8 +409,14 @@ namespace eval Git { toplevel $win wm transient $win . wm overrideredirect $win 1 - ttk::button $win.bAdd -image new_14x14 -command "Git::Branch new" \ - -compound left -text "[::msgcat::mc "Add new branch"]" + ttk::button $win.bAdd -image new_14x14 -compound left -text "[::msgcat::mc "Add new branch"]" \ + -command { + grid forget .branch.lBox .branch.yscroll + grid .branch.entBranch + bind .branch "Git::Branches new .branch.entBranch; destroy .branch" + } + ttk::entry $win.entBranch -textvariable newBranchName + listbox $win.lBox -width 30 -border 2 -yscrollcommand "$win.yscroll set" -border 1 ttk::scrollbar $win.yscroll -orient vertical -command "$win.lBox yview" # pack $win.lBox -expand true -fill y -side left