示例#1
0
        private string CreateTag()
        {
            GitCreateTagArgs createTagArgs = new GitCreateTagArgs();

            createTagArgs.Revision = commitPickerSmallControl1.SelectedCommitHash;

            if (createTagArgs.Revision.IsNullOrEmpty())
            {
                MessageBox.Show(this, _noRevisionSelected.Text, _messageCaption.Text);
                return(string.Empty);
            }

            createTagArgs.TagName       = textBoxTagName.Text;
            createTagArgs.Force         = ForceTag.Checked;
            createTagArgs.OperationType = GetSelectedOperation(annotate.SelectedIndex);
            createTagArgs.TagMessage    = tagMessage.Text;
            createTagArgs.SignKeyId     = textBoxGpgKey.Text;

            IGitTagController _gitTagController = new GitTagController(UICommands, Module);

            if (!_gitTagController.CreateTag(createTagArgs, this))
            {
                return(string.Empty);
            }

            DialogResult = DialogResult.OK;
            return(textBoxTagName.Text);
        }
示例#2
0
        private string CreateTag()
        {
            string revision = commitPickerSmallControl1.SelectedCommitHash;

            if (revision.IsNullOrEmpty())
            {
                MessageBox.Show(this, _noRevisionSelected.Text, _messageCaption.Text);
                return(string.Empty);
            }

            IGitTagController _gitTagController = new GitTagController(Module);
            var s = _gitTagController.CreateTag(revision, textBoxTagName.Text, ForceTag.Checked, GetSelectedOperation(annotate.SelectedIndex), tagMessage.Text, textBoxGpgKey.Text);

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

            if (s.Contains("fatal:"))
            {
                return(string.Empty);
            }

            DialogResult = DialogResult.OK;
            return(textBoxTagName.Text);
        }
示例#3
0
        private int CreateLostFoundTags()
        {
            var selectedLostObjects = Warnings.Rows
                                      .Cast <DataGridViewRow>()
                                      .Select(row => row.Cells[columnIsLostObjectSelected.Index])
                                      .Where(cell => (bool?)cell.Value == true)
                                      .Select(cell => filteredLostObjects[cell.RowIndex])
                                      .ToList();

            if (selectedLostObjects.Count == 0)
            {
                MessageBox.Show(this, selectLostObjectsToRestoreMessage.Text, selectLostObjectsToRestoreCaption.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(0);
            }
            var currentTag = 0;
            IGitTagController _gitTagController = new GitTagController(UICommands, Module);

            foreach (var lostObject in selectedLostObjects)
            {
                currentTag++;
                GitCreateTagArgs createTagArgs = new GitCreateTagArgs();
                createTagArgs.Revision = lostObject.Hash;
                createTagArgs.TagName  = $"{RestoredObjectsTagPrefix}{currentTag}";
                _gitTagController.CreateTag(createTagArgs, this);
            }

            return(currentTag);
        }