internal static void MoveOnSourceControl(string srcPath, string dstPath) { mLog.DebugFormat("MoveOnSourceControl: {0} to {1}", srcPath, dstPath); try { string srcFullPath = Path.GetFullPath(srcPath); string dstFullPath = Path.GetFullPath(dstPath); MoveIfControlled( srcFullPath, dstFullPath, mPlasticAPI); MoveIfControlled( MetaPath.GetMetaPath(srcFullPath), MetaPath.GetMetaPath(dstFullPath), mPlasticAPI); } catch (Exception ex) { LogMoveException(srcPath, dstPath, ex); } finally { mCooldownAutorefreshAction.Ping(); } }
internal static string ForMetaChange( MergeChangeInfo change) { return(BuildCacheKey( change.CategoryType, MetaPath.GetMetaPath(change.GetPath()))); }
internal static void DeleteFromSourceControl(string path) { mLog.DebugFormat("DeleteFromSourceControl: {0}", path); try { string fullPath = Path.GetFullPath(path); DeleteIfControlled( fullPath, mPlasticAPI); DeleteIfControlled( MetaPath.GetMetaPath(fullPath), mPlasticAPI); } catch (Exception ex) { LogDeleteException(path, ex); } finally { mCooldownAutorefreshAction.Ping(); } }
static void CheckoutIfControlled(string[] paths, IPlasticAPI api) { List <string> fullPaths = new List <string>(); foreach (string path in paths) { string fullPath = Path.GetFullPath(path); string fullPathMeta = MetaPath.GetMetaPath(fullPath); if (api.GetWorkspaceTreeNode(fullPath) != null) { fullPaths.Add(fullPath); } if (api.GetWorkspaceTreeNode(fullPathMeta) != null) { fullPaths.Add(fullPathMeta); } } if (fullPaths.Count == 0) { return; } api.Checkout( fullPaths.ToArray(), CheckoutModifiers.None); }
internal static string ForMetaDiff( ClientDiffInfo diff) { return(BuildCacheKey( GetMergeCategory(diff), GetChangeCategory(diff), MetaPath.GetMetaPath(diff.DiffWithMount.Difference.Path))); }
internal List<string> GetExistingMeta(List<string> paths) { List<string> result = new List<string>(); foreach (string path in paths) { string metaPath = MetaPath.GetMetaPath(path); if (!mCache.Contains(metaPath)) continue; result.Add(metaPath); } return result; }
static void AddIfNotControlled( string[] paths, IPlasticAPI api) { List <string> fullPaths = new List <string>(); IgnoredFilesFilter ignoredFilter = new IgnoredFilesFilter( GlobalConfig.Instance); foreach (string path in paths) { string fullPath = Path.GetFullPath(path); string fullPathMeta = MetaPath.GetMetaPath(fullPath); if (api.GetWorkspaceFromPath(fullPath) == null) { return; } if (api.GetWorkspaceTreeNode(fullPath) == null && !ignoredFilter.IsIgnored(fullPath)) { fullPaths.Add(fullPath); } if (File.Exists(fullPathMeta) && api.GetWorkspaceTreeNode(fullPathMeta) == null && !ignoredFilter.IsIgnored(fullPath)) { fullPaths.Add(fullPathMeta); } } if (fullPaths.Count == 0) { return; } IList checkouts; api.Add( fullPaths.ToArray(), GetDefaultAddOptions(), out checkouts); }
void ResolveDirectoryConflict(IncomingChangeInfo conflict) { ConflictResolutionState state; if (!mConflictResolutionStates.TryGetValue(conflict.DirectoryConflict, out state)) { return; } List <DirectoryConflictResolutionData> conflictResolutions = new List <DirectoryConflictResolutionData>(); AddConflictResolution( conflict, state.ResolveAction, state.RenameValue, conflictResolutions); IncomingChangeInfo metaConflict = mIncomingChangesTreeView.GetMetaChange(conflict); if (metaConflict != null) { AddConflictResolution( metaConflict, state.ResolveAction, MetaPath.GetMetaPath(state.RenameValue), conflictResolutions); } if (state.IsApplyActionsForNextConflictsChecked) { foreach (IncomingChangeInfo otherConflict in mIncomingChangesTreeView.GetSelectedIncomingChanges()) { AddConflictResolution( otherConflict, state.ResolveAction, state.RenameValue, conflictResolutions); } } mMergeViewLogic.ResolveDirectoryConflicts(conflictResolutions); }
internal static List <string> ForOperation( IAssetSelection assetSelection, IAssetStatusCache assetStatusCache, AssetMenuOperations operation) { List <string> selectedPaths = AssetsSelection.GetSelectedPaths( assetSelection.GetSelectedAssets()); List <string> result = new List <string>(selectedPaths); foreach (string path in selectedPaths) { if (MetaPath.IsMetaPath(path)) { continue; } string metaPath = MetaPath.GetMetaPath(path); if (!File.Exists(metaPath)) { continue; } if (result.Contains(metaPath)) { continue; } if (!IsApplicableForOperation( metaPath, false, operation, assetStatusCache)) { continue; } result.Add(metaPath); } return(result); }
static void CheckoutIfControlledAndChanged(string[] paths, IPlasticAPI api) { List <string> fullPaths = new List <string>(); foreach (string path in paths) { string fullPath = Path.GetFullPath(path); string fullPathMeta = MetaPath.GetMetaPath(fullPath); WorkspaceTreeNode node = api.GetWorkspaceTreeNode(fullPath); WorkspaceTreeNode nodeMeta = api.GetWorkspaceTreeNode(fullPathMeta); if (node != null && ChangedFileChecker.IsChanged( node.LocalInfo, fullPath, false)) { fullPaths.Add(fullPath); } if (nodeMeta != null && ChangedFileChecker.IsChanged( nodeMeta.LocalInfo, fullPathMeta, false)) { fullPaths.Add(fullPathMeta); } } if (fullPaths.Count == 0) { return; } api.Checkout( fullPaths.ToArray(), CheckoutModifiers.None); }
internal bool HasMeta(string path) { return mCache.Contains(MetaPath.GetMetaPath(path)); }
internal static string ForMetaChange(ChangeInfo change) { return(BuildCacheKey( change.ChangeTypes, MetaPath.GetMetaPath(change.Path))); }