Exemple #1
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);
        }
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
        void IHistoryViewMenuOperations.SaveRevisionAs()
        {
            TrackFeatureUseEvent.For(
                PlasticGui.Plastic.API.GetRepositorySpec(mWkInfo),
                TrackFeatureUseEvent.Features.SaveRevisionFromFileHistory);

            HistoryRevision revision = HistorySelection.
                                       GetSelectedHistoryRevision(mHistoryListView);

            string defaultFileName = DefaultRevisionName.Get(
                Path.GetFileName(mPath), revision.ChangeSet);

            string destinationPath = SaveAction.GetDestinationPath(
                mWkInfo.ClientPath, mPath, defaultFileName);

            if (string.IsNullOrEmpty(destinationPath))
            {
                return;
            }

            SaveRevisionOperation.SaveRevision(
                mRepSpec,
                destinationPath,
                revision,
                mProgressControls);
        }
Exemple #4
0
        void IHistoryViewMenuOperations.RevertToThisRevision()
        {
            HistoryRevision revision = HistorySelection.
                                       GetSelectedHistoryRevision(mHistoryListView);

            string fullPath = GetFullPath(mWkInfo.ClientPath, mPath);

            if (mIsGluonMode)
            {
                HistoryDescriptor historyDescriptor = new HistoryDescriptor(
                    mRepSpec, fullPath, mItemId, revision.Id, mIsDirectory);

                GluonRevertOperation.RevertToThisRevision(
                    mWkInfo,
                    mViewHost,
                    mProgressControls,
                    historyDescriptor,
                    revision,
                    mGuiMessage,
                    RefreshAsset.UnityAssetDatabase);
                return;
            }

            RevertOperation.RevertToThisRevision(
                mWkInfo,
                mProgressControls,
                mWorkspaceWindow,
                mRepSpec,
                revision,
                fullPath,
                mGuiMessage,
                mNewIncomingChangesUpdater,
                RefreshAsset.UnityAssetDatabase);
        }
Exemple #5
0
 void IHistoryViewMenuOperations.OpenRevision()
 {
     OpenRevisionOperation.Open(
         mRepSpec,
         Path.GetFileName(mPath),
         HistorySelection.GetSelectedHistoryRevisions(
             mHistoryListView));
 }
Exemple #6
0
        void IHistoryViewMenuOperations.DiffChangeset()
        {
            HistoryRevision revision = HistorySelection.
                                       GetSelectedHistoryRevision(mHistoryListView);

            LaunchDiffOperations.DiffChangeset(
                mRepSpec, revision.ChangeSet, mIsGluonMode);
        }
Exemple #7
0
 SelectedHistoryGroupInfo IHistoryViewMenuOperations.GetSelectedHistoryGroupInfo()
 {
     return(SelectedHistoryGroupInfo.BuildFromSelection(
                HistorySelection.GetSelectedRepObjectInfos(mHistoryListView),
                HistorySelection.GetSelectedHistoryRevisions(mHistoryListView),
                mHistoryListView.GetLoadedRevisionId(),
                mIsDirectory));
 }
Exemple #8
0
        void IHistoryViewMenuOperations.OpenRevisionWith()
        {
            List <HistoryRevision> revisions = HistorySelection.
                                               GetSelectedHistoryRevisions(mHistoryListView);

            OpenRevisionOperation.OpenWith(
                mRepSpec,
                FileSystemOperation.GetExePath(),
                Path.GetFileName(mPath),
                revisions);
        }
Exemple #9
0
        long HistoryListViewMenu.IMenuOperations.GetSelectedChangesetId()
        {
            HistoryRevision revision = HistorySelection.
                                       GetSelectedHistoryRevision(mHistoryListView);

            if (revision == null)
            {
                return(-1);
            }

            return(revision.ChangeSet);
        }
Exemple #10
0
        void IHistoryViewMenuOperations.DiffWithPrevious()
        {
            HistoryRevision revision = HistorySelection.
                                       GetSelectedHistoryRevision(mHistoryListView);

            DiffOperation.DiffWithPrevious(
                mWkInfo,
                mRepSpec,
                Path.GetFileName(mPath),
                string.Empty,
                revision.Id,
                mItemId,
                revision.ChangeSet,
                mProgressControls,
                null,
                null);
        }
Exemple #11
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);
        }
Exemple #12
0
        void IHistoryViewMenuOperations.DiffSelectedRevisions()
        {
            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);
        }
Exemple #13
0
        void IHistoryViewMenuOperations.DiffWithPrevious()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(mIsGluonMode))
            {
                return;
            }

            HistoryRevision revision = HistorySelection.
                                       GetSelectedHistoryRevision(mHistoryListView);

            DiffOperation.DiffWithPrevious(
                mWkInfo,
                mRepSpec,
                Path.GetFileName(mPath),
                string.Empty,
                revision.Id,
                mItemId,
                revision.ChangeSet,
                mProgressControls,
                null,
                null);
        }
Exemple #14
0
        void IHistoryViewMenuOperations.SaveRevisionAs()
        {
            HistoryRevision revision = HistorySelection.
                                       GetSelectedHistoryRevision(mHistoryListView);

            string defaultFileName = DefaultRevisionName.Get(
                Path.GetFileName(mPath), revision.ChangeSet);

            string destinationPath = SaveAction.GetDestinationPath(
                mWkInfo.ClientPath, mPath, defaultFileName);

            if (string.IsNullOrEmpty(destinationPath))
            {
                return;
            }

            SaveRevisionOperation.SaveRevision(
                mRepSpec,
                destinationPath,
                revision,
                mProgressControls);
        }
Exemple #15
0
        void IHistoryViewMenuOperations.DiffSelectedRevisions()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(mIsGluonMode))
            {
                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);
        }
Exemple #16
0
 List <RepObjectInfo> HistoryViewLogic.IHistoryView.GetSelectedRevisions()
 {
     return(HistorySelection.GetSelectedRepObjectInfos(mHistoryListView));
 }
Exemple #17
0
 void HistoryViewLogic.IHistoryView.SelectRevisions(
     List <RepObjectInfo> revisionsToSelect)
 {
     HistorySelection.SelectRevisions(
         mHistoryListView, revisionsToSelect);
 }