Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
 void IHistoryViewMenuOperations.OpenRevision()
 {
     OpenRevisionOperation.Open(
         mRepSpec,
         Path.GetFileName(mPath),
         HistorySelection.GetSelectedHistoryRevisions(
             mHistoryListView));
 }
Exemplo n.º 6
0
        void IHistoryViewMenuOperations.DiffChangeset()
        {
            HistoryRevision revision = HistorySelection.
                                       GetSelectedHistoryRevision(mHistoryListView);

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

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

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

            return(revision.ChangeSet);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 16
0
 List <RepObjectInfo> HistoryViewLogic.IHistoryView.GetSelectedRevisions()
 {
     return(HistorySelection.GetSelectedRepObjectInfos(mHistoryListView));
 }
Exemplo n.º 17
0
 void HistoryViewLogic.IHistoryView.SelectRevisions(
     List <RepObjectInfo> revisionsToSelect)
 {
     HistorySelection.SelectRevisions(
         mHistoryListView, revisionsToSelect);
 }