// Partly the same as RevisionDiffControl.cs ShowSelectedFileDiffAsync()
        private async Task ViewSelectedDiffAsync()
        {
            if (DiffFiles.SelectedItem == null || DiffFiles.Revision == null)
            {
                DiffText.Clear();
                return;
            }

            if (DiffFiles.SelectedItemParent?.Guid == GitRevision.CombinedDiffGuid)
            {
                var diffOfConflict = Module.GetCombinedDiffContent(DiffFiles.Revision, DiffFiles.SelectedItem.Name,
                                                                   DiffText.GetExtraDiffArguments(), DiffText.Encoding);

                if (string.IsNullOrWhiteSpace(diffOfConflict))
                {
                    diffOfConflict = Strings.UninterestingDiffOmitted;
                }

                DiffText.ViewPatch(text: diffOfConflict, openWithDifftool: null /* not implemented */);
                return;
            }

            await DiffText.ViewChangesAsync(DiffFiles.SelectedItemParent?.ObjectId, DiffFiles.Revision?.ObjectId, DiffFiles.SelectedItem, string.Empty,
                                            openWithDifftool : null /* use default */);
        }
        private async Task ShowSelectedFileDiffAsync()
        {
            if (DiffFiles.SelectedItem == null || DiffFiles.Revision == null)
            {
                DiffText.ViewPatch(null);
                return;
            }

            if (DiffFiles.SelectedItemParent?.Guid == DiffFiles.CombinedDiffGuid)
            {
                var diffOfConflict = Module.GetCombinedDiffContent(DiffFiles.Revision, DiffFiles.SelectedItem.Name,
                                                                   DiffText.GetExtraDiffArguments(), DiffText.Encoding);

                if (string.IsNullOrWhiteSpace(diffOfConflict))
                {
                    diffOfConflict = Strings.GetUninterestingDiffOmitted();
                }

                DiffText.ViewPatch(text: diffOfConflict, openWithDifftool: null /* not implemented */);
                return;
            }

            await DiffText.ViewChangesAsync(DiffFiles.SelectedItemParent?.Guid, DiffFiles.Revision?.Guid, DiffFiles.SelectedItem, string.Empty,
                                            openWithDifftool : () => firstToSelectedToolStripMenuItem.PerformClick());
        }
Exemple #3
0
        private async Task ShowSelectedFileDiffAsync()
        {
            if (DiffFiles.SelectedItem == null || DiffFiles.Revision == null)
            {
                DiffText.Clear();
                return;
            }

            if (DiffFiles.SelectedItemParent?.ObjectId == ObjectId.CombinedDiffId)
            {
                var diffOfConflict = Module.GetCombinedDiffContent(DiffFiles.Revision, DiffFiles.SelectedItem.Name,
                                                                   DiffText.GetExtraDiffArguments(), DiffText.Encoding);

                if (string.IsNullOrWhiteSpace(diffOfConflict))
                {
                    diffOfConflict = Strings.UninterestingDiffOmitted;
                }

                await DiffText.ViewPatchAsync(DiffFiles.SelectedItem.Name,
                                              text : diffOfConflict,
                                              openWithDifftool : () => firstToSelectedToolStripMenuItem.PerformClick(),
                                              isText : DiffFiles.SelectedItem.IsSubmodule);

                return;
            }

            await DiffText.ViewChangesAsync(DiffFiles.SelectedItemParent?.ObjectId, DiffFiles.Revision, DiffFiles.SelectedItem, string.Empty,
                                            openWithDifftool : () => firstToSelectedToolStripMenuItem.PerformClick());
        }
Exemple #4
0
 private async Task ViewSelectedDiffAsync()
 {
     GitRevision revision = DiffFiles.Revision;
     if (DiffFiles.SelectedItem != null && revision != null)
     {
         await DiffText.ViewChangesAsync(DiffFiles.SelectedItemParent?.Guid, revision.Guid, DiffFiles.SelectedItem, string.Empty,
             openWithDifftool: null /* use default */);
     }
 }
Exemple #5
0
        private void ShowSelectedFileDiff()
        {
            if (DiffFiles.SelectedItem == null)
            {
                DiffText.Clear();
                return;
            }

            var baseCommit = (ckCompareToMergeBase.Checked ? _mergeBase : _baseRevision) ?? DiffFiles.SelectedItemParent;

            DiffText.ViewChangesAsync(baseCommit?.ObjectId, _headRevision, DiffFiles.SelectedItem, string.Empty);
        }
        private void ShowSelectedFileDiff()
        {
            if (DiffFiles.SelectedItem == null)
            {
                DiffText.ViewPatch(null);
                return;
            }

            var baseCommit = ckCompareToMergeBase.Checked ? _mergeBase : _baseRevision;

            var items = new List <GitRevision> {
                _headRevision, baseCommit
            };

            // TODO this can never be true
            if (items.Count == 1)
            {
                items.Add(DiffFiles.SelectedItemParent);
            }

            DiffText.ViewChangesAsync(items, DiffFiles.SelectedItem, string.Empty);
        }
Exemple #7
0
        private void ShowSelectedFileDiff()
        {
            if (DiffFiles.SelectedItem == null)
            {
                DiffText.ViewPatch(null);
                return;
            }

            var baseCommit = ckCompareToMergeBase.Checked ? _mergeBase : _baseRevision;

            var items = new List <GitRevision> {
                _headRevision, baseCommit
            };

            if (baseCommit == null)
            {
                // This should not happen
                items = new List <GitRevision> {
                    _headRevision, DiffFiles.SelectedItemParent
                };
            }

            DiffText.ViewChangesAsync(items, DiffFiles.SelectedItem, string.Empty);
        }
        private async Task ShowSelectedFileDiffAsync()
        {
            if (DiffFiles.SelectedItem == null || DiffFiles.Revision == null)
            {
                DiffText.ViewPatch("");
                return;
            }

            if (DiffFiles.SelectedItemParent?.Guid == DiffFiles.CombinedDiffGuid)
            {
                var diffOfConflict = Module.GetCombinedDiffContent(DiffFiles.Revision, DiffFiles.SelectedItem.Name,
                                                                   DiffText.GetExtraDiffArguments(), DiffText.Encoding);

                if (string.IsNullOrWhiteSpace(diffOfConflict))
                {
                    diffOfConflict = Strings.GetUninterestingDiffOmitted();
                }

                DiffText.ViewPatch(diffOfConflict);
                return;
            }

            await DiffText.ViewChangesAsync(DiffFiles.SelectedItemParent?.Guid, DiffFiles.Revision?.Guid, DiffFiles.SelectedItem, string.Empty);
        }
 private async Task ShowSelectedFileDiffAsync()
 {
     await DiffText.ViewChangesAsync(DiffFiles.SelectedItemParent?.ObjectId, DiffFiles.Revision, DiffFiles.SelectedItem,
                                     openWithDiffTool : () => firstToSelectedToolStripMenuItem.PerformClick());
 }
Exemple #10
0
 private async Task ViewSelectedDiffAsync()
 {
     await DiffText.ViewChangesAsync(DiffFiles.SelectedItemParent?.ObjectId, DiffFiles.Revision, DiffFiles.SelectedItem);
 }
Exemple #11
0
 private async Task ViewSelectedDiffAsync()
 {
     await DiffText.ViewChangesAsync(DiffFiles.SelectedItem);
 }
Exemple #12
0
 private void ShowSelectedFileDiff()
 {
     DiffText.ViewChangesAsync(DiffFiles.SelectedItem);
 }
Exemple #13
0
 private void ShowSelectedFileDiff()
 {
     DiffText.ViewChangesAsync(DiffFiles.SelectedItemParent?.ObjectId, _headRevision, DiffFiles.SelectedItem);
 }