Exemplo n.º 1
0
        private ContextMenuDiffToolInfo GetContextMenuDiffToolInfo()
        {
            var  parentIds     = DiffFiles.SelectedItems.FirstIds().ToList();
            bool firstIsParent = _revisionTester.AllFirstAreParentsToSelected(parentIds, _headRevision);
            bool localExists   = _revisionTester.AnyLocalFileExists(DiffFiles.SelectedItems.Select(i => i.Item));

            bool allAreNew     = DiffFiles.SelectedItems.All(i => i.Item.IsNew);
            bool allAreDeleted = DiffFiles.SelectedItems.All(i => i.Item.IsDeleted);

            return(new ContextMenuDiffToolInfo(
                       _headRevision,
                       parentIds,
                       allAreNew: allAreNew,
                       allAreDeleted: allAreDeleted,
                       firstIsParent: firstIsParent,
                       localExists: localExists));
        }
Exemplo n.º 2
0
        private ContextMenuDiffToolInfo GetContextMenuDiffToolInfo()
        {
            bool firstIsParent = _gitRevisionTester.AllFirstAreParentsToSelected(DiffFiles.SelectedItemParents, DiffFiles.Revision);
            bool localExists   = _gitRevisionTester.AnyLocalFileExists(DiffFiles.SelectedItemsWithParent.Select(i => i.Item));

            IEnumerable <string> selectedItemParentRevs = DiffFiles.SelectedItemParents.Select(i => i.Guid);
            bool allAreNew     = DiffFiles.SelectedItemsWithParent.All(i => i.Item.IsNew);
            bool allAreDeleted = DiffFiles.SelectedItemsWithParent.All(i => i.Item.IsDeleted);

            return(new ContextMenuDiffToolInfo(
                       DiffFiles.Revision,
                       selectedItemParentRevs,
                       allAreNew: allAreNew,
                       allAreDeleted: allAreDeleted,
                       firstIsParent: firstIsParent,
                       firstParentsValid: _revisionGrid.IsFirstParentValid(),
                       localExists: localExists));
        }
Exemplo n.º 3
0
        private ContextMenuDiffToolInfo GetContextMenuDiffToolInfo()
        {
            bool firstIsParent = _revisionTester.AllFirstAreParentsToSelected(DiffFiles.SelectedItemParents, DiffFiles.Revision);
            bool localExists   = _revisionTester.AnyLocalFileExists(DiffFiles.SelectedItemsWithParent.Select(i => i.Item));

            var  selectedItemParentRevs = DiffFiles.SelectedItemParents.Select(i => i.ObjectId).ToList();
            bool allAreNew     = DiffFiles.SelectedItemsWithParent.All(i => i.Item.IsNew);
            bool allAreDeleted = DiffFiles.SelectedItemsWithParent.All(i => i.Item.IsDeleted);

            return(new ContextMenuDiffToolInfo(
                       _headRevision,
                       selectedItemParentRevs,
                       allAreNew: allAreNew,
                       allAreDeleted: allAreDeleted,
                       firstIsParent: firstIsParent,
                       firstParentsValid: _firstParentIsValid,
                       localExists: localExists));
        }
Exemplo n.º 4
0
        private ContextMenuDiffToolInfo GetContextMenuDiffToolInfo()
        {
            bool firstIsParent = _revisionTester.AllFirstAreParentsToSelected(DiffFiles.SelectedItemParents, DiffFiles.Revision);
            bool localExists   = _revisionTester.AnyLocalFileExists(DiffFiles.SelectedItemsWithParent.Select(i => i.Item));

            IEnumerable <string> selectedItemParentRevs = DiffFiles.Revision.ParentGuids;
            bool allAreNew         = DiffFiles.SelectedItemsWithParent.All(i => i.Item.IsNew);
            bool allAreDeleted     = DiffFiles.SelectedItemsWithParent.All(i => i.Item.IsDeleted);
            var  revisions         = _revisionGrid.GetSelectedRevisions();
            bool firstParentsValid = revisions != null && revisions.Count > 1;

            var selectionInfo = new ContextMenuDiffToolInfo(_headRevision, selectedItemParentRevs,
                                                            allAreNew: allAreNew,
                                                            allAreDeleted: allAreDeleted,
                                                            firstIsParent: firstIsParent,
                                                            firstParentsValid: firstParentsValid,
                                                            localExists: localExists);

            return(selectionInfo);
        }
Exemplo n.º 5
0
        private ContextMenuDiffToolInfo GetContextMenuDiffToolInfo()
        {
            bool firstIsParent = _gitRevisionTester.AllFirstAreParentsToSelected(DiffFiles.SelectedItemParents, DiffFiles.Revision);
            bool localExists   = _gitRevisionTester.AnyLocalFileExists(DiffFiles.SelectedItemsWithParent.Select(i => i.Item));

            IEnumerable <string> selectedItemParentRevs = DiffFiles.SelectedItemParents.Select(i => i.Guid);
            bool allAreNew     = DiffFiles.SelectedItemsWithParent.All(i => i.Item.IsNew);
            bool allAreDeleted = DiffFiles.SelectedItemsWithParent.All(i => i.Item.IsDeleted);
            var  revisions     = _revisionGrid.GetSelectedRevisions();

            // Parents to First (A) are only known if A is explicitly selected (there is no explicit search for parents to parents of a single selected revision)
            bool firstParentsValid = revisions != null && revisions.Count > 1;

            var selectionInfo = new ContextMenuDiffToolInfo(DiffFiles.Revision, selectedItemParentRevs,
                                                            allAreNew: allAreNew,
                                                            allAreDeleted: allAreDeleted,
                                                            firstIsParent: firstIsParent,
                                                            firstParentsValid: firstParentsValid,
                                                            localExists: localExists);

            return(selectionInfo);
        }