public void Reset() { using (var form = new FormResetCurrentBranch(UICommands, new GitRevision(FullPath))) { form.ShowDialog(TreeViewNode.TreeView); } }
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); } } }
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; }
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 = FormResetCurrentBranch.Create(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); }