internal static void DiffSelectedChangesets(
            RepositorySpec repSpec,
            ChangesetInfo cset1,
            ChangesetInfo cset2,
            bool isGluonMode)
        {
            ChangesetInfo srcChangesetInfo;
            ChangesetInfo dstChangesetInfo;

            GetSrcAndDstCangesets(
                cset1,
                cset2,
                out srcChangesetInfo,
                out dstChangesetInfo);

            string srcChangesetFullSpec = GetChangesetFullSpec(
                repSpec, srcChangesetInfo.Id);

            string dstChangesetFullSpec = GetChangesetFullSpec(
                repSpec, dstChangesetInfo.Id);

            LaunchTool.OpenSelectedChangesetsDiffs(
                srcChangesetFullSpec,
                dstChangesetFullSpec,
                isGluonMode);
        }
Exemple #2
0
        void IHistoryViewMenuOperations.DiffWithPrevious()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    mRepSpec,
                    mIsGluonMode,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromDiffRevision,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromDiffRevision,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromDiffRevision))
            {
                return;
            }

            HistoryRevision revision = HistorySelection.
                                       GetSelectedHistoryRevision(mHistoryListView);

            DiffOperation.DiffWithPrevious(
                mWkInfo,
                mRepSpec,
                Path.GetFileName(mPath),
                string.Empty,
                revision.Id,
                mItemId,
                revision.ChangeSet,
                mProgressControls,
                null,
                null);
        }
Exemple #3
0
        static void DoLaunchButtons(
            string wkPath, bool isGluonMode)
        {
            //TODO: Codice - beta: hide the diff button until the behavior is implemented

            /*GUILayout.Button(PlasticLocalization.GetString(
             *  PlasticLocalization.Name.DiffWindowMenuItemDiff),
             *  EditorStyles.toolbarButton,
             *  GUILayout.Width(UnityConstants.REGULAR_BUTTON_WIDTH));*/

            if (isGluonMode)
            {
                if (DrawActionButton.For("Configure Gluon"))
                {
                    LaunchTool.OpenWorkspaceConfiguration(wkPath);
                }
            }
            else
            {
                if (DrawActionButton.For("Launch branch explorer"))
                {
                    LaunchTool.OpenBranchExplorer(wkPath);
                }
            }

            string openToolText = isGluonMode ?
                                  "Launch Gluon" : "Launch Plastic";

            if (DrawActionButton.For(openToolText))
            {
                LaunchTool.OpenGUIForMode(wkPath, isGluonMode);
            }
        }
        void IAssetMenuOperations.ShowHistory()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    mWkInfo,
                    mIsGluonMode,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromShowHistory,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromShowHistory,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromShowHistory))
            {
                return;
            }

            AssetList assetList = mAssetSelection.GetSelectedAssets();

            Asset selectedAsset = AssetsSelection.GetSelectedAsset(
                assetList);
            string selectedPath = AssetsSelection.GetSelectedPath(
                assetList);

            WorkspaceTreeNode node = PlasticGui.Plastic.API.
                                     GetWorkspaceTreeNode(selectedPath);

            mHistoryViewLauncher.ShowHistoryView(
                node.RepSpec,
                node.RevInfo.ItemId,
                selectedPath,
                selectedAsset.isFolder);
        }
Exemple #5
0
        static void ShowBranchesContextMenu(
            WorkspaceInfo wkInfo,
            ViewSwitcher viewSwitcher,
            bool isGluonMode)
        {
            GenericMenu menu = new GenericMenu();

            string branchesListView = PlasticLocalization.GetString(
                PlasticLocalization.Name.Branches);

            menu.AddItem(
                new GUIContent(branchesListView),
                false,
                () => OpenBranchListViewAndSendEvent(wkInfo, viewSwitcher));

            string branchExplorer = PlasticLocalization.GetString(
                PlasticLocalization.Name.BranchExplorerMenu);

            menu.AddItem(
                new GUIContent(branchExplorer),
                false,
                () => LaunchTool.OpenBranchExplorer(wkInfo, isGluonMode));

            menu.ShowAsContext();
        }
Exemple #6
0
        void IIncomingChangesViewMenuOperations.MergeContributors()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    mWkInfo,
                    false,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromMergeSelectedFiles,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromMergeSelectedFiles,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromMergeSelectedFiles))
            {
                return;
            }

            List <string> selectedPaths = IncomingChangesSelection.
                                          GetPathsFromSelectedFileConflictsIncludingMeta(
                mIncomingChangesTreeView);

            mMergeViewLogic.ProcessMerges(
                mWorkspaceWindow,
                mSwitcher,
                mGuiMessage,
                selectedPaths,
                MergeContributorType.MergeContributors,
                RefreshAsset.UnityAssetDatabase,
                null);
        }
Exemple #7
0
        void IHistoryViewMenuOperations.DiffSelectedRevisions()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    mRepSpec,
                    mIsGluonMode,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromDiffSelectedRevisions,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromDiffSelectedRevisions,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromDiffSelectedRevisions))
            {
                return;
            }

            List <HistoryRevision> revisions = HistorySelection.
                                               GetSelectedHistoryRevisions(mHistoryListView);

            bool areReversed = revisions[0].Id > revisions[1].Id;

            DiffOperation.DiffRevisions(
                mWkInfo,
                mRepSpec,
                Path.GetFileName(mPath),
                string.Empty,
                mItemId,
                revisions[(areReversed) ? 1 : 0],
                revisions[(areReversed) ? 0 : 1],
                mProgressControls,
                null,
                null);
        }
        internal static void Run(
            bool isGluonMode,
            ProgressControlsForViews progressControls)
        {
            ((IProgressControls)progressControls).ShowProgress(string.Empty);

            IThreadWaiter waiter = ThreadWaiter.GetWaiter();

            waiter.Execute(
                /*threadOperationDelegate*/ delegate
            {
                Process plasticProcess = LaunchTool.OpenConfigurationForMode(isGluonMode);

                if (plasticProcess != null)
                {
                    plasticProcess.WaitForExit();
                }
            },
                /*afterOperationDelegate*/ delegate
            {
                ((IProgressControls)progressControls).HideProgress();

                if (waiter.Exception == null)
                {
                    return;
                }

                ((IProgressControls)progressControls).ShowError(
                    waiter.Exception.Message);
            });
        }
        void PendingChangesViewMenu.IMetaMenuOperations.DiffMeta()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    mWkInfo,
                    mIsGluonMode,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromDiffWorkspaceContent,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromDiffWorkspaceContent,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromDiffWorkspaceContent))
            {
                return;
            }

            ChangeInfo selectedChange = PendingChangesSelection
                                        .GetSelectedChange(mPendingChangesTreeView);
            ChangeInfo selectedChangeMeta = mPendingChangesTreeView.GetMetaChange(
                selectedChange);

            ChangeInfo changedForMoved     = mPendingChanges.GetChangedForMoved(selectedChange);
            ChangeInfo changedForMovedMeta = (changedForMoved == null) ?
                                             null : mPendingChangesTreeView.GetMetaChange(changedForMoved);

            DiffOperation.DiffWorkspaceContent(
                mWkInfo,
                selectedChangeMeta,
                changedForMovedMeta,
                mProgressControls,
                null,
                null);
        }
        static void ProcessPendingChangesMenuOperation(
            PendingChangesMenuOperations operationToExecute,
            IPendingChangesMenuOperations pendingChangesMenuOperations,
            bool isGluonMode)
        {
            if (operationToExecute == PendingChangesMenuOperations.DiffWorkspaceContent)
            {
                if (LaunchTool.ShowDownloadPlasticExeWindow(isGluonMode))
                {
                    return;
                }

                pendingChangesMenuOperations.Diff();
                return;
            }

            if (operationToExecute == PendingChangesMenuOperations.Delete)
            {
                pendingChangesMenuOperations.Delete();
                return;
            }

            if (operationToExecute == PendingChangesMenuOperations.History)
            {
                pendingChangesMenuOperations.History();
                return;
            }
        }
Exemple #11
0
        void DiffTreeViewMenu.IMetaMenuOperations.DiffMeta()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    mWkInfo,
                    mIsGluonMode,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromDiffRevision,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromDiffRevision,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromDiffRevision))
            {
                return;
            }

            ClientDiffInfo clientDiffInfo =
                DiffSelection.GetSelectedDiff(mDiffTreeView);

            ClientDiffInfo clientDiffInfoMeta =
                mDiffTreeView.GetMetaDiff(clientDiffInfo);

            DiffOperation.DiffClientDiff(
                mWkInfo,
                clientDiffInfoMeta.DiffWithMount.Mount.Mount,
                clientDiffInfoMeta.DiffWithMount.Difference,
                xDiffLauncher: null,
                imageDiffLauncher: null);
        }
Exemple #12
0
        static void DiffIncomingChanges(
            MergeChangeInfo incomingChange,
            WorkspaceInfo wkInfo)
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    wkInfo,
                    false,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromDiffIncomingChanges,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromDiffIncomingChanges,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromDiffIncomingChanges))
            {
                return;
            }

            DiffOperation.DiffRevisions(
                wkInfo,
                incomingChange.GetMount().RepSpec,
                incomingChange.GetBaseRevision(),
                incomingChange.GetRevision(),
                incomingChange.GetPath(),
                incomingChange.GetPath(),
                true,
                xDiffLauncher: null,
                imageDiffLauncher: null);
        }
Exemple #13
0
        void DiffChangesetMenu_Click()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(mIsGluonMode))
            {
                return;
            }

            mOperations.DiffChangeset();
        }
        void MergeSelectedFilesMenuItem_Click()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(false))
            {
                return;
            }

            mIncomingChangesViewMenuOperations.MergeContributors();
        }
Exemple #15
0
        void DiffWithPreviousMenuItem_Click()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(mIsGluonMode))
            {
                return;
            }

            mOperations.DiffWithPrevious();
        }
Exemple #16
0
        void DiffSelectedChangesetsMenuItem_Click()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(mIsGluonMode))
            {
                return;
            }

            mChangesetMenuOperations.DiffSelectedChangesets();
        }
Exemple #17
0
        void DiffSelectedRevisionsMenu_Click()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(mIsGluonMode))
            {
                return;
            }

            mOperations.DiffSelectedRevisions();
        }
Exemple #18
0
        void IMergeViewLauncher.MergeFromInterval(ObjectInfo objectInfo, ObjectInfo ancestorChangesetInfo, EnumMergeType mergeType)
        {
            if (mergeType == EnumMergeType.IncomingMerge)
            {
                ShowIncomingChangesView();
                mParentWindow.Repaint();
                return;
            }

            LaunchTool.OpenMerge(mWkInfo.ClientPath);
        }
Exemple #19
0
        void DiffSelectedChangesetsMenuItem_Click()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    mWkInfo,
                    mIsGluonMode,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromDiffSelectedChangesets,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromDiffSelectedChangesets,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromDiffSelectedChangesets))
            {
                return;
            }

            mChangesetMenuOperations.DiffSelectedChangesets();
        }
        static void DoActionButton(
            WorkspaceInfo workspaceInfo,
            GUIContent buttonContent,
            GUIStyle buttonStyle)
        {
            if (!GUILayout.Button(
                    buttonContent, buttonStyle,
                    GUILayout.ExpandHeight(true),
                    GUILayout.MinWidth(40)))
            {
                return;
            }

            LaunchTool.OpenBranchExplorer(workspaceInfo);
        }
Exemple #21
0
        static void ProcessMenuOperation(
            HistoryMenuOperations operationToExecute,
            IHistoryViewMenuOperations operations,
            bool isGluonMode)
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(isGluonMode))
            {
                return;
            }

            if (operationToExecute == HistoryMenuOperations.DiffWithPrevious)
            {
                operations.DiffWithPrevious();
                return;
            }
        }
Exemple #22
0
        static void DoNoConfigAvailableArea(bool isGluonMode)
        {
            string labelText =
                "No configuration found. Plastic SCM plugin is disabled. " +
                "Please configure it by clicking here.";

            string buttonText = isGluonMode ?
                                "Launch Gluon" : "Launch Plastic";

            DrawActionHelpBox.For(
                Images.GetWarnDialogIcon(),
                labelText, buttonText, delegate
            {
                LaunchTool.OpenConfigurationForMode(isGluonMode);
            });
        }
Exemple #23
0
        void IDiffTreeViewMenuOperations.Diff()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(mIsGluonMode))
            {
                return;
            }

            ClientDiffInfo clientDiffInfo =
                DiffSelection.GetSelectedDiff(mDiffTreeView);

            DiffOperation.DiffClientDiff(
                mWkInfo,
                clientDiffInfo.DiffWithMount.Mount.Mount,
                clientDiffInfo.DiffWithMount.Difference,
                xDiffLauncher: null,
                imageDiffLauncher: null);
        }
Exemple #24
0
        internal static void DiffChangeset(
            RepositorySpec repSpec,
            long changesetId,
            bool isGluonMode)
        {
            if (changesetId == -1)
            {
                return;
            }

            string changesetFullSpec = GetChangesetFullSpec(
                repSpec, changesetId);

            LaunchTool.OpenChangesetDiffs(
                changesetFullSpec,
                isGluonMode);
        }
Exemple #25
0
        internal static void DiffBranch(
            RepositorySpec repSpec,
            ChangesetExtendedInfo changesetExtendedInfo,
            bool isGluonMode)
        {
            if (changesetExtendedInfo == null)
            {
                return;
            }

            string branchFullSpec = GetBranchFullSpec(
                repSpec, changesetExtendedInfo);

            LaunchTool.OpenBranchDiffs(
                branchFullSpec,
                isGluonMode);
        }
        static void DiffYoursWithIncoming(
            IncomingChangeInfo incomingChange,
            WorkspaceInfo wkInfo)
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(true))
            {
                return;
            }

            DiffOperation.DiffYoursWithIncoming(
                wkInfo,
                incomingChange.GetMount(),
                incomingChange.GetRevision(),
                incomingChange.GetPath(),
                xDiffLauncher: null,
                imageDiffLauncher: null);
        }
        void IPendingChangesMenuOperations.Diff()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(mIsGluonMode))
            {
                return;
            }

            ChangeInfo selectedChange = PendingChangesSelection
                                        .GetSelectedChange(mPendingChangesTreeView);

            DiffOperation.DiffWorkspaceContent(
                mWkInfo,
                selectedChange,
                mPendingChanges.GetChangedForMoved(selectedChange),
                null,
                null,
                null);
        }
Exemple #28
0
        void IHistoryViewMenuOperations.DiffChangeset()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    mRepSpec,
                    mIsGluonMode,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromDiffChangeset,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromDiffChangeset,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromDiffChangeset))
            {
                return;
            }

            HistoryRevision revision = HistorySelection.
                                       GetSelectedHistoryRevision(mHistoryListView);

            LaunchDiffOperations.DiffChangeset(
                mRepSpec, revision.ChangeSet, mIsGluonMode);
        }
        void IncomingChangesViewMenu.IMetaMenuOperations.DiffYoursWithIncoming()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(true))
            {
                return;
            }

            IncomingChangeInfo incomingChange = IncomingChangesSelection.
                                                GetSingleSelectedIncomingChange(mIncomingChangesTreeView);

            if (incomingChange == null)
            {
                return;
            }

            DiffYoursWithIncoming(
                mIncomingChangesTreeView.GetMetaChange(incomingChange),
                mWkInfo);
        }
Exemple #30
0
        void IAssetMenuOperations.ShowDiff()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    mWkInfo,
                    mIsGluonMode,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromShowDiff,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromFromShowDiff,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromFromShowDiff))
            {
                return;
            }

            string selectedPath = AssetsSelection.GetSelectedPath(
                mAssetSelection.GetSelectedAssets());

            DiffInfo diffInfo = null;

            IThreadWaiter waiter = ThreadWaiter.GetWaiter(10);

            waiter.Execute(
                /*threadOperationDelegate*/ delegate
            {
                string symbolicName = GetSymbolicName(selectedPath);
                string extension    = Path.GetExtension(selectedPath);

                diffInfo = PlasticGui.Plastic.API.BuildDiffInfoForDiffWithPrevious(
                    selectedPath, symbolicName, selectedPath, extension, mWkInfo);
            },
                /*afterOperationDelegate*/ delegate
            {
                if (waiter.Exception != null)
                {
                    ExceptionsHandler.DisplayException(waiter.Exception);
                    return;
                }

                DiffOperation.DiffWithPrevious(
                    diffInfo,
                    null,
                    null);
            });
        }