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); }
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); }
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); }); }
public AlignmentNode(DiffOperation operation, double similarity, int nodeCount, [CanBeNull] AlignmentNode next) { Operation = operation; Similarity = similarity; NodeCount = nodeCount; Next = next; }
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())); } }
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); }
public Diff(DiffOperation operation, string path, object curvalue = null, object prevvalue = null) { Operation = operation; Property = path ?? ""; CurrentValue = curvalue; PreviousValue = prevvalue; }
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); }
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 }; }
public DiffElement(int?elementIndexFromCollection1, Option <T> elementFromCollection1, int?elementIndexFromCollection2, Option <T> elementFromCollection2, DiffOperation operation) { ElementIndexFromCollection1 = elementIndexFromCollection1; ElementFromCollection1 = elementFromCollection1; ElementIndexFromCollection2 = elementIndexFromCollection2; ElementFromCollection2 = elementFromCollection2; Operation = operation; }
static bool IsApplicableDiffWorkspaceContent( PendingChangesTreeView treeView) { ChangeInfo selectedRow = GetSelectedChange(treeView); if (selectedRow == null) return false; return DiffOperation.IsApplicableDiffWorkspaceContent(selectedRow); }
static void DiffYoursWithIncoming( IncomingChangeInfo incomingChange, WorkspaceInfo wkInfo) { DiffOperation.DiffYoursWithIncoming( wkInfo, incomingChange.GetMount(), incomingChange.GetRevision(), incomingChange.GetPath(), xDiffLauncher: null, imageDiffLauncher: null); }
void IPendingChangesMenuOperations.Diff() { ChangeInfo selectedChange = PendingChangesSelection .GetSelectedChange(mPendingChangesTreeView); DiffOperation.DiffWorkspaceContent( mWkInfo, selectedChange, mPendingChanges.GetChangedForMoved(selectedChange), mProgressControls, null, null); }
void IDiffTreeViewMenuOperations.Diff() { ClientDiffInfo clientDiffInfo = DiffSelection.GetSelectedDiff(mDiffTreeView); DiffOperation.DiffClientDiff( mWkInfo, clientDiffInfo.DiffWithMount.Mount.Mount, clientDiffInfo.DiffWithMount.Difference, xDiffLauncher: null, imageDiffLauncher: null); }
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); }
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); }
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); } }
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); }
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); }
void IPendingChangesMenuOperations.Diff() { if (LaunchTool.ShowDownloadPlasticExeWindow(mIsGluonMode)) { return; } ChangeInfo selectedChange = PendingChangesSelection .GetSelectedChange(mPendingChangesTreeView); DiffOperation.DiffWorkspaceContent( mWkInfo, selectedChange, mPendingChanges.GetChangedForMoved(selectedChange), null, null, null); }
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); }
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); }
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)); } }
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); }
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); }
public PropertyDiff (DiffOperation Operation, string Name, string Text) { this.Operation = Operation; this.Name = Name; this.Text = Text; }