public string GetTabText() { var revisions = _revisionGrid.GetSelectedRevisions(); DiffText.SaveCurrentScrollPos(); DiffFiles.SetDiffs(revisions); if (_oldDiffItem != null && revisions.Count > 0 && revisions[0].Guid == _oldRevision) { DiffFiles.SelectedItem = _oldDiffItem; _oldDiffItem = null; _oldRevision = null; } switch (revisions.Count) { case 0: return(_diffNoSelection.Text); case 1: // diff "parent" --> "selected revision" return(_diffParentWithSelection.Text); case 2: // diff "first clicked revision" --> "second clicked revision" return(_diffTwoSelected.Text); } return(_diffNotSupported.Text); }
private void RevisionGridSelectionChanged(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; DiffFiles.GitItemStatuses = null; DiffFiles.SetDiffs(RevisionGrid.GetSelectedRevisions()); Cursor.Current = Cursors.Default; }
private void RevisionGridSelectionChanged(object sender, EventArgs e) { using (WaitCursorScope.Enter()) { DiffFiles.SetDiffs(RevisionGrid.GetSelectedRevisions()); } }
public CommitDiff() { InitializeComponent(); Translate(); DiffText.ExtraDiffArgumentsChanged += DiffText_ExtraDiffArgumentsChanged; DiffFiles.Focus(); DiffFiles.SetDiffs(); }
public void RefreshArtificial() { var revisions = _revisionGrid.GetSelectedRevisions(); if (revisions.Count > 0 && revisions[0].IsArtificial()) { DiffFiles.SetDiffs(revisions); } }
private void PopulateDiffFiles() { lblBaseCommit.Text = _baseCommitDisplayStr; lblHeadCommit.Text = _headCommitDisplayStr; DiffFiles.SetDiffs(ckCompareToMergeBase.Checked ? new[] { _headRevision, _mergeBase } : new[] { _headRevision, _baseRevision }); }
private FormCommitDiff(GitUICommands aCommands) : base(aCommands) { InitializeComponent(); Translate(); DiffText.ExtraDiffArgumentsChanged += DiffText_ExtraDiffArgumentsChanged; DiffFiles.Focus(); DiffFiles.SetDiffs(); }
public void DisplayDiffTab() { var revisions = _revisionGrid.GetSelectedRevisions(); DiffFiles.SetDiffs(revisions); if (_oldDiffItem != null && DiffFiles.Revision?.Guid == _oldRevision) { DiffFiles.SelectedItem = _oldDiffItem; _oldDiffItem = null; _oldRevision = null; } }
public CommitDiff() { InitializeComponent(); InitializeComplete(); DiffText.ExtraDiffArgumentsChanged += DiffText_ExtraDiffArgumentsChanged; DiffFiles.Focus(); DiffFiles.SetDiffs(); splitContainer1.SplitterDistance = DpiUtil.Scale(200); splitContainer2.SplitterDistance = DpiUtil.Scale(260); }
private void SetDiffs(IReadOnlyList <GitRevision> revisions) { GitItemStatus oldDiffItem = DiffFiles.SelectedItem; DiffFiles.SetDiffs(revisions, _revisionGrid.GetRevision); // Try to restore previous item if (oldDiffItem != null && DiffFiles.GitItemStatuses.Any(i => i.Name.Equals(oldDiffItem.Name))) { DiffFiles.SelectedItem = oldDiffItem; } }
private void SetDiffs(IReadOnlyList <GitRevision> revisions) { var item = DiffFiles.SelectedItem; var oldDiffItem = DiffFiles.FirstGroupItems.Contains(item) ? item : null; DiffFiles.SetDiffs(revisions, _revisionGrid.GetRevision); // Try to restore previous item if (oldDiffItem != null && DiffFiles.FirstGroupItems.Any(i => i.Name.Equals(oldDiffItem.Name))) { DiffFiles.SelectedItem = oldDiffItem; } }
public FormCommitDiff(GitUICommands aCommands, string revisionGuid) : this(aCommands) { // We cannot use the GitRevision from revision grid. When a filtered commit list // is shown (file history/normal filter) the parent guids are not the 'real' parents, // but the parents in the filtered list. GitRevision revision = Module.GetRevision(revisionGuid); if (revision != null) { DiffFiles.SetDiffs(revision); Text = "Diff - " + GitRevision.ToShortSha(revision.Guid) + " - " + revision.AuthorDate + " - " + revision.Author + " - " + Module.WorkingDir;; } }
private void PopulateDiffFiles() { lblBaseCommit.Text = _baseCommitDisplayStr; lblHeadCommit.Text = _headCommitDisplayStr; DiffFiles.SetDiffs(ckCompareToMergeBase.Checked ? new[] { _headRevision, _mergeBase } : new[] { _headRevision, _baseRevision }); // Bug in git-for-windows: Comparing working directory to any branch, fails, due to -R // I.e., git difftool --gui --no-prompt --dir-diff -R HEAD fails, but // git difftool --gui --no-prompt --dir-diff HEAD succeeds // Thus, we disable comparing "from" working directory. var enableDifftoolDirDiff = _baseRevision?.Guid != GitRevision.WorkTreeGuid; btnCompareDirectoriesWithDiffTool.Enabled = enableDifftoolDirDiff; }
private void PopulateDiffFiles() { lblBaseCommit.Text = _baseCommitDisplayStr; lblHeadCommit.Text = _headCommitDisplayStr; if (ckCompareToMergeBase.Checked) { DiffFiles.SetDiffs(new List <GitRevision> { _headRevision, _mergeBase }); } else { DiffFiles.SetDiffs(new List <GitRevision> { _headRevision, _baseRevision }); } }
private void PopulateDiffFiles() { lblLeftCommit.Text = _leftDisplayStr; lblRightCommit.Text = _rightDisplayStr; if (ckCompareToMergeBase.Checked) { DiffFiles.SetDiffs(new List <GitRevision> { _rightRevision, _mergeBase }); } else { DiffFiles.SetDiffs(new List <GitRevision> { _rightRevision, _leftRevision }); } }
public void SetRevision([CanBeNull] ObjectId objectId, [CanBeNull] string fileToSelect) { // We cannot use the GitRevision from revision grid. When a filtered commit list // is shown (file history/normal filter) the parent guids are not the 'real' parents, // but the parents in the filtered list. GitRevision revision = Module.GetRevision(objectId); if (revision != null) { DiffFiles.SetDiffs(new[] { revision }); if (fileToSelect != null) { var itemToSelect = DiffFiles.AllItems.FirstOrDefault(i => i.Name == fileToSelect); if (itemToSelect != null) { DiffFiles.SelectedItem = itemToSelect; } } commitInfo.Revision = revision; Text = "Diff - " + revision.ObjectId.ToShortString() + " - " + revision.AuthorDate + " - " + revision.Author + " - " + Module.WorkingDir; } }