예제 #1
0
        /// <summary>
        /// Creates and executes a commit script based on the currently selected repository.
        /// </summary>
        private void ButtonCommitChanges_Click(object sender, EventArgs e)
        {
            string commitmsg = TextBoxCommitMessage.Text;

            if (commitmsg.Equals("") || commitmsg.Equals(ApplicationConstant.COMMIT_GREYTEXT))
            {
                DialogUtil.Message("Commit Error", "Please add a commit message before committing.");
                return;
            }

            RepoDetails repo = ReposConfig.GetInstance().GetSelected();

            if (repo == null)
            {
                DialogUtil.Message("Commit Error", "Please select a repository to commit to.");
                return;
            }

            ScriptBuilder.CommitScript(repo, TextBoxCommitMessage.Text);
            Executable exe = new Executable("expect.exe", "commit.lua").Start();

            exe.WaitForExit();

            TextBoxCommitMessage.Text = ""; // will not show greytext
            TextBoxCommitMessage_Validate(TextBoxCommitMessage, e);
            EventManager.Fire(EventCode.REFRESH_CHANGES);
        }