private void Revert_Click(object sender, EventArgs e) { List <string> argumentsList = new List <string>(); bool CanExecute = true; if (IsMerge) { if (ParentsList.SelectedItems.Count == 0) { MessageBox.Show(this, _noneParentSelectedText.Text, _noneParentSelectedTextCaption.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); CanExecute = false; } else { argumentsList.Add("-m " + (ParentsList.SelectedItems[0].Index + 1)); } } if (checkAddReference.Checked) { argumentsList.Add("-x"); } if (CanExecute) { FormProcess.ShowDialog(this, GitCommandHelpers.CherryPickCmd(Revision.Guid, AutoCommit.Checked, string.Join(" ", argumentsList.ToArray()))); MergeConflictHandler.HandleMergeConflicts(UICommands, this, AutoCommit.Checked); DialogResult = DialogResult.OK; Close(); } }
private void Revert_Click(object sender, EventArgs e) { var args = new ArgumentBuilder(); var canExecute = true; if (_isMerge) { if (ParentsList.SelectedItems.Count == 0) { MessageBox.Show(this, _noneParentSelectedText.Text, _noneParentSelectedTextCaption.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); canExecute = false; } else { args.Add("-m " + (ParentsList.SelectedItems[0].Index + 1)); } } if (checkAddReference.Checked) { args.Add("-x"); } if (canExecute) { FormProcess.ShowDialog(this, GitCommandHelpers.CherryPickCmd(Revision.ObjectId, AutoCommit.Checked, args.ToString())); MergeConflictHandler.HandleMergeConflicts(UICommands, this, AutoCommit.Checked); DialogResult = DialogResult.OK; Close(); } }
private void Revert_Click(object sender, EventArgs e) { var args = new ArgumentBuilder(); var canExecute = true; if (_isMerge) { if (ParentsList.SelectedItems.Count == 0) { MessageBox.Show(this, _noneParentSelectedText.Text, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); canExecute = false; } else { args.Add("-m " + (ParentsList.SelectedItems[0].Index + 1)); } } if (checkAddReference.Checked) { args.Add("-x"); } if (canExecute) { var command = GitCommandHelpers.CherryPickCmd(Revision.ObjectId, AutoCommit.Checked, args.ToString()); bool success = FormProcess.ShowDialog(this, process: null, arguments: command, Module.WorkingDir, input: null, useDialogSettings: true); if (!success) { return; } MergeConflictHandler.HandleMergeConflicts(UICommands, this, AutoCommit.Checked); DialogResult = DialogResult.OK; Close(); } }
private void Revert_Click(object sender, EventArgs e) { var args = new ArgumentBuilder(); var canExecute = true; if (_isMerge) { if (ParentsList.SelectedItems.Count == 0) { MessageBox.Show(this, _noneParentSelectedText.Text, TranslatedStrings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); canExecute = false; } else { args.Add("-m " + (ParentsList.SelectedItems[0].Index + 1)); } } if (checkAddReference.Checked) { args.Add("-x"); } if (canExecute && Revision is not null) { var command = GitCommandHelpers.CherryPickCmd(Revision.ObjectId, AutoCommit.Checked, args.ToString()); // Don't verify whether the command is successful. // If it fails, likely there is a conflict that needs to be resolved. FormProcess.ShowDialog(this, process: null, arguments: command, Module.WorkingDir, input: null, useDialogSettings: true); MergeConflictHandler.HandleMergeConflicts(UICommands, this, AutoCommit.Checked); DialogResult = DialogResult.OK; Close(); } }
private void Revert_Click(object sender, EventArgs e) { string arguments = ""; bool CanExecute = true; if (IsMerge) { if (ParentsList.SelectedItems.Count == 0) { MessageBox.Show(this, _noneParentSelectedText.Text, _noneParentSelectedTextCaption.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); CanExecute = false; } else { arguments = "-m " + (ParentsList.SelectedItems[0].Index + 1); } } if (CanExecute) { new FormProcess(GitCommandHelpers.CherryPickCmd(Revision.Guid, AutoCommit.Checked, arguments)).ShowDialog(this); MergeConflictHandler.HandleMergeConflicts(this); Close(); } }