예제 #1
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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        void IAssetMenuOperations.ShowDiff()
        {
            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 = Plastic.API.BuildDiffInfoForDiffWithPrevious(
                    selectedPath, symbolicName, selectedPath, extension, mWkInfo);
            },
                /*afterOperationDelegate*/ delegate
            {
                if (waiter.Exception != null)
                {
                    ExceptionsHandler.DisplayException(waiter.Exception);
                    return;
                }

                DiffOperation.DiffWithPrevious(
                    diffInfo,
                    null,
                    null);
            });
        }
예제 #4
0
 public AlignmentNode(DiffOperation operation, double similarity, int nodeCount, [CanBeNull] AlignmentNode next)
 {
     Operation  = operation;
     Similarity = similarity;
     NodeCount  = nodeCount;
     Next       = next;
 }
예제 #5
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);
        }
 /// <summary>
 /// Explodes the array and marks all indicies as the same operation
 /// </summary>
 /// <param name="array"></param>
 /// <param name="path"></param>
 /// <param name="op"></param>
 /// <param name="diffs"></param>
 private void AppendArrayChanges(Array array, string path, DiffOperation op, List <Diff> diffs)
 {
     for (int i = 0; i < array.Length; i++)
     {
         diffs.Add(new Diff(op, $"{path}[{i}]", array.GetValue(i).ToString()));
     }
 }
예제 #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);
        }
예제 #8
0
 public Diff(DiffOperation operation, string path, object curvalue = null, object prevvalue = null)
 {
     Operation     = operation;
     Property      = path ?? "";
     CurrentValue  = curvalue;
     PreviousValue = prevvalue;
 }
예제 #9
0
        private static RenameResult CreateSampleTextForDiffOp(string[] keys, DiffOperation diffOp)
        {
            var             renameResult   = new RenameResult();
            string          translatedText = LocalizationManager.Instance.GetTranslation("exampleTextWithInsertedWords");
            Regex           regex          = new Regex(@"{+\d+}+");
            MatchCollection matches        = regex.Matches(translatedText);
            List <Diff>     subStrings     = new List <Diff>();

            for (int i = 0; i < matches.Count; i++)
            {
                var match = matches[i];
                subStrings.Add(new Diff(translatedText.Substring(0, translatedText.IndexOf(match.Value)), DiffOperation.Equal));

                var stringToInsert = i >= 0 && i < keys.Length ? LocalizationManager.Instance.GetTranslation(keys[i]) : "modified";
                subStrings.Add(new Diff(stringToInsert, diffOp));
                translatedText = translatedText.Remove(0, translatedText.IndexOf(match.Value) + match.Value.Length);
            }

            foreach (Diff currentString in subStrings)
            {
                renameResult.Add(currentString);
            }

            return(renameResult);
        }
예제 #10
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);
        }
 public DiffSegment(DiffOperation operation, T item)
 {
     Operation = operation;
     Items     = new List <T> {
         item
     };
 }
예제 #12
0
 public DiffElement(int?elementIndexFromCollection1, Option <T> elementFromCollection1,
                    int?elementIndexFromCollection2, Option <T> elementFromCollection2, DiffOperation operation)
 {
     ElementIndexFromCollection1 = elementIndexFromCollection1;
     ElementFromCollection1      = elementFromCollection1;
     ElementIndexFromCollection2 = elementIndexFromCollection2;
     ElementFromCollection2      = elementFromCollection2;
     Operation = operation;
 }
예제 #13
0
        static bool IsApplicableDiffWorkspaceContent(
            PendingChangesTreeView treeView)
        {
            ChangeInfo selectedRow = GetSelectedChange(treeView);

            if (selectedRow == null)
                return false;

            return DiffOperation.IsApplicableDiffWorkspaceContent(selectedRow);
        }
예제 #14
0
 static void DiffYoursWithIncoming(
     IncomingChangeInfo incomingChange,
     WorkspaceInfo wkInfo)
 {
     DiffOperation.DiffYoursWithIncoming(
         wkInfo,
         incomingChange.GetMount(),
         incomingChange.GetRevision(),
         incomingChange.GetPath(),
         xDiffLauncher: null,
         imageDiffLauncher: null);
 }
예제 #15
0
        void IPendingChangesMenuOperations.Diff()
        {
            ChangeInfo selectedChange = PendingChangesSelection
                                        .GetSelectedChange(mPendingChangesTreeView);

            DiffOperation.DiffWorkspaceContent(
                mWkInfo,
                selectedChange,
                mPendingChanges.GetChangedForMoved(selectedChange),
                mProgressControls,
                null, null);
        }
예제 #16
0
        void IDiffTreeViewMenuOperations.Diff()
        {
            ClientDiffInfo clientDiffInfo =
                DiffSelection.GetSelectedDiff(mDiffTreeView);

            DiffOperation.DiffClientDiff(
                mWkInfo,
                clientDiffInfo.DiffWithMount.Mount.Mount,
                clientDiffInfo.DiffWithMount.Difference,
                xDiffLauncher: null,
                imageDiffLauncher: null);
        }
예제 #17
0
 static void DiffIncomingChanges(
     IncomingChangeInfo incomingChange,
     WorkspaceInfo wkInfo)
 {
     DiffOperation.DiffRevisions(
         wkInfo,
         incomingChange.GetMount().RepSpec,
         incomingChange.GetBaseRevision(),
         incomingChange.GetRevision(),
         incomingChange.GetPath(),
         incomingChange.GetPath(),
         true,
         xDiffLauncher: null,
         imageDiffLauncher: null);
 }
예제 #18
0
        void DiffTreeViewMenu.IMetaMenuOperations.DiffMeta()
        {
            ClientDiffInfo clientDiffInfo =
                DiffSelection.GetSelectedDiff(mDiffTreeView);

            ClientDiffInfo clientDiffInfoMeta =
                mDiffTreeView.GetMetaDiff(clientDiffInfo);

            DiffOperation.DiffClientDiff(
                mWkInfo,
                clientDiffInfoMeta.DiffWithMount.Mount.Mount,
                clientDiffInfoMeta.DiffWithMount.Difference,
                xDiffLauncher: null,
                imageDiffLauncher: null);
        }
예제 #19
0
파일: HistoryTab.cs 프로젝트: Buster-00/Q_G
        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);
        }
        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);
        }
        private char GetDiffOperationSymbol(DiffOperation operation)
        {
            switch (operation)
            {
            case DiffOperation.Copied:
                return(' ');

            case DiffOperation.Added:
                return('+');

            case DiffOperation.Deleted:
                return('-');

            default:
                throw new ArgumentOutOfRangeException(nameof(operation), operation, null);
            }
        }
예제 #22
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);
        }
예제 #23
0
        void PendingChangesViewMenu.IMetaMenuOperations.DiffMeta()
        {
            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);
        }
예제 #24
0
        void IPendingChangesMenuOperations.Diff()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(mIsGluonMode))
            {
                return;
            }

            ChangeInfo selectedChange = PendingChangesSelection
                                        .GetSelectedChange(mPendingChangesTreeView);

            DiffOperation.DiffWorkspaceContent(
                mWkInfo,
                selectedChange,
                mPendingChanges.GetChangedForMoved(selectedChange),
                null,
                null,
                null);
        }
예제 #25
0
파일: HistoryTab.cs 프로젝트: Buster-00/Q_G
        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);
        }
예제 #26
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);
            });
        }
        static void DiffIncomingChanges(
            IncomingChangeInfo incomingChange,
            WorkspaceInfo wkInfo)
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(true))
            {
                return;
            }

            DiffOperation.DiffRevisions(
                wkInfo,
                incomingChange.GetMount().RepSpec,
                incomingChange.GetBaseRevision(),
                incomingChange.GetRevision(),
                incomingChange.GetPath(),
                incomingChange.GetPath(),
                true,
                xDiffLauncher: null,
                imageDiffLauncher: null);
        }
예제 #28
0
        private static void ConsolidateRemainderOfStringIntoRenameResult(
            RenameResult renameResult,
            string originalString,
            int indexToStartFrom,
            DiffOperation diffOpIfDifferent)
        {
            var remainderOfOldString = originalString.Substring(indexToStartFrom, originalString.Length - indexToStartFrom);

            if (renameResult.Count > 0 && renameResult[renameResult.Count - 1].Operation == diffOpIfDifferent)
            {
                // last diff in the sequence matches the desired diff for the remainder of the string. Consolidate them
                var previousDiff = renameResult[renameResult.Count - 1];
                renameResult[renameResult.Count - 1] = new Diff(
                    string.Concat(previousDiff.Result, remainderOfOldString),
                    previousDiff.Operation);
            }
            else
            {
                renameResult.Add(new Diff(remainderOfOldString, diffOpIfDifferent));
            }
        }
예제 #29
0
        static void DiffYoursWithIncoming(
            IncomingChangeInfo incomingChange,
            WorkspaceInfo wkInfo)
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    wkInfo,
                    true,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromDiffYoursWithIncoming,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromDiffYoursWithIncoming,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromDiffYoursWithIncoming))
            {
                return;
            }

            DiffOperation.DiffYoursWithIncoming(
                wkInfo,
                incomingChange.GetMount(),
                incomingChange.GetRevision(),
                incomingChange.GetPath(),
                xDiffLauncher: null,
                imageDiffLauncher: null);
        }
예제 #30
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);
        }
예제 #31
0
		public PropertyDiff (DiffOperation Operation, string Name, string Text)
		{
			this.Operation = Operation;
			this.Name = Name;
			this.Text = Text;
		}