private bool CheckForRemoteRevision(string filename) { if (string.IsNullOrEmpty(GitCommandHelpers.GetConflictedFileNames(filename)[2])) { string caption = string.Format(fileModifiedLocallyAndDelededRemotelyLong.Text, filename, GetLocalSideString(), GetRemoteSideString()); var frm = new FormModifiedDeletedCreated(string.Format(keepModifiedButtonText.Text + " ({0})", GetLocalSideString()), string.Format(deleteFileButtonText.Text + " ({0})", GetRemoteSideString()), keepBaseButtonText.Text, caption); frm.ShowDialog(); if (frm.KeepBase) //base { GitCommandHelpers.HandleConflictSelectBase(GetFileName()); } if (frm.KeepLocal) //delete { GitCommandHelpers.HandleConflictSelectLocal(GetFileName()); } if (frm.KeepRemote) //remote { GitCommandHelpers.RunCmd(Settings.GitCommand, "rm -- \"" + filename + "\""); } return(false); } return(true); }
private void ConflictedFiles_SelectionChanged(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; if (ConflictedFiles.SelectedRows.Count != 1) { baseFileName.Text = localFileName.Text = remoteFileName.Text = ""; return; } string filename = GetFileName(); string[] filenames = GitCommandHelpers.GetConflictedFileNames(filename); bool baseFileExists = !string.IsNullOrEmpty(filenames[0]); bool localFileExists = !string.IsNullOrEmpty(filenames[1]); bool remoteFileExists = !string.IsNullOrEmpty(filenames[2]); string remoteSide = GetRemoteSideString(); string localSide = GetLocalSideString(); if (baseFileExists && localFileExists && remoteFileExists) { conflictDescription.Text = string.Format(fileChangeLocallyAndRemotely.Text, localSide, remoteSide); } if (!baseFileExists && localFileExists && remoteFileExists) { conflictDescription.Text = string.Format(fileCreatedLocallyAndRemotely.Text, localSide, remoteSide); } if (baseFileExists && !localFileExists && remoteFileExists) { conflictDescription.Text = string.Format(fileDeletedLocallyAndModifiedRemotely.Text, localSide, remoteSide); } if (baseFileExists && localFileExists && !remoteFileExists) { conflictDescription.Text = string.Format(fileModifiedLocallyAndDelededRemotely.Text, localSide, remoteSide); } baseFileName.Text = (baseFileExists ? filenames[0] : noBase.Text); localFileName.Text = (localFileExists ? filenames[1] : deleted.Text); remoteFileName.Text = (remoteFileExists ? filenames[2] : deleted.Text); }