Beispiel #1
0
        private string CreateTag(object sender, EventArgs e)
        {
            if (GitRevisions.GetSelectedRevisions().Count != 1)
            {
                MessageBox.Show(this, _noRevisionSelected.Text, _messageCaption.Text);
                return(string.Empty);
            }
            if (annotate.Checked)
            {
                if (string.IsNullOrEmpty(tagMessage.Text))
                {
                    MessageBox.Show(this, _noTagMessage.Text, _messageCaption.Text);
                    return(string.Empty);
                }

                File.WriteAllText(Module.WorkingDirGitDir() + "\\TAGMESSAGE", tagMessage.Text);
            }

            var s = Module.Tag(Tagname.Text, GitRevisions.GetSelectedRevisions()[0].Guid,
                               annotate.Checked, ForceTag.Checked);

            if (!string.IsNullOrEmpty(s))
            {
                MessageBox.Show(this, s, _messageCaption.Text);
            }
            Close();

            if (s.Contains("fatal:"))
            {
                return(string.Empty);
            }
            return(Tagname.Text);
        }
Beispiel #2
0
        private void CreateTagClick(object sender, EventArgs e)
        {
            try
            {
                if (GitRevisions.GetSelectedRevisions().Count != 1)
                {
                    MessageBox.Show(this, _noRevisionSelected.Text, _messageCaption.Text);
                    return;
                }
                if (annotate.Checked)
                {
                    if (string.IsNullOrEmpty(tagMessage.Text))
                    {
                        MessageBox.Show(this, _noTagMessage.Text, _messageCaption.Text);
                        return;
                    }

                    File.WriteAllText(Settings.Module.WorkingDirGitDir() + "\\TAGMESSAGE", tagMessage.Text);
                }


                var s = Settings.Module.Tag(Tagname.Text, GitRevisions.GetSelectedRevisions()[0].Guid,
                                            annotate.Checked);

                if (!string.IsNullOrEmpty(s))
                {
                    MessageBox.Show(this, s, _messageCaption.Text);
                }
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message);
            }
        }