Esempio n. 1
0
 public void Reset()
 {
     using (var form = new FormResetCurrentBranch(UICommands, new GitRevision(FullPath)))
     {
         form.ShowDialog(TreeViewNode.TreeView);
     }
 }
Esempio n. 2
0
            public void Reset()
            {
                var objectId = Module.RevParse(FullPath);

                if (objectId == null)
                {
                    MessageBox.Show($"Branch \"{FullPath}\" could not be resolved.");
                }
                else
                {
                    using (var form = new FormResetCurrentBranch(UICommands, Module.GetRevision(objectId)))
                    {
                        form.ShowDialog(TreeViewNode.TreeView);
                    }
                }
            }
Esempio n. 3
0
        private void resetCurrentBranchOnThisCommitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_isDirtyDir)
            {
                if (MessageBox.Show(this, _continueResetCurrentBranchEvenWithChangesText.Text,
                                    _continueResetCurrentBranchCaptionText.Text,
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
                {
                    return;
                }
            }

            var gitRevision            = UICommands.Module.GetRevision(GetShaOfRefLine());
            var resetType              = _isDirtyDir ? FormResetCurrentBranch.ResetType.Soft : FormResetCurrentBranch.ResetType.Hard;
            var formResetCurrentBranch = new FormResetCurrentBranch(UICommands, gitRevision, resetType);
            var result = formResetCurrentBranch.ShowDialog(this);

            ShouldRefresh = result == DialogResult.OK;
        }
Esempio n. 4
0
        private void resetCurrentBranchOnThisCommitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_isDirtyDir)
            {
                if (MessageBox.Show(this, _continueResetCurrentBranchEvenWithChangesText.Text,
                                    _continueResetCurrentBranchCaptionText.Text,
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.No)
                {
                    return;
                }
            }

            var gitRevision = UICommands.Module.GetRevision(GetShaOfRefLine());
            var resetType   = _isDirtyDir ? FormResetCurrentBranch.ResetType.Soft : FormResetCurrentBranch.ResetType.Hard;

            UICommands.DoActionOnRepo(() =>
            {
                using (var form = new FormResetCurrentBranch(UICommands, gitRevision, resetType))
                {
                    return(form.ShowDialog(this) == DialogResult.OK);
                }
            });
        }
        private void ResetCurrentBranchToHereToolStripMenuItemClick(object sender, EventArgs e)
        {
            if (Revisions.RowCount <= LastRowIndex || LastRowIndex < 0)
                return;

            var frm = new FormResetCurrentBranch(UICommands, GetRevision(LastRowIndex));
            frm.ShowDialog(this);
        }