Exemple #1
0
        internal LockStatusData GetLockStatusData(string fullPath)
        {
            lock (mLock)
            {
                if (mStatusByPathCache == null)
                {
                    mStatusByPathCache = BuildPathDictionary.ForPlatform <LockStatusData>();

                    mCurrentCancelToken.Cancel();
                    mCurrentCancelToken = new CancelToken();
                    AsyncCalculateStatus(mCurrentCancelToken);

                    return(null);
                }

                LockStatusData result;

                if (mStatusByPathCache.TryGetValue(fullPath, out result))
                {
                    return(result);
                }

                return(null);
            }
        }
        internal AssetStatus GetStatus(string fullPath)
        {
            if (!mIsGluonMode)
            {
                return(AssetStatus.UpToDate);
            }

            lock (mLock)
            {
                if (mStatusByPathCache == null)
                {
                    mStatusByPathCache = BuildPathDictionary.ForPlatform <AssetStatus>();

                    mCurrentCancelToken.Cancel();
                    mCurrentCancelToken = new CancelToken();
                    AsyncCalculateStatus(mCurrentCancelToken);

                    return(AssetStatus.UpToDate);
                }

                AssetStatus result;
                if (mStatusByPathCache.TryGetValue(fullPath, out result))
                {
                    return(result);
                }

                return(AssetStatus.UpToDate);
            }
        }
            internal static Dictionary <string, AssetStatus> ForOutOfDateItems(
                OutOfDateItems outOfDateItems,
                string wkPath)
            {
                Dictionary <string, AssetStatus> result =
                    BuildPathDictionary.ForPlatform <AssetStatus>();

                if (outOfDateItems == null)
                {
                    return(result);
                }

                foreach (OutOfDateItemsByMount diffs in
                         outOfDateItems.GetOutOfDateItemsByMountList())
                {
                    foreach (Difference diff in diffs.Changed)
                    {
                        if (diff is DiffXlinkChanged)
                        {
                            continue;
                        }

                        string path = GetPathForDiff(wkPath, diffs.Mount, diff.Path);
                        result.Add(path, AssetStatus.OutOfDate);
                    }

                    foreach (Difference diff in diffs.Deleted)
                    {
                        string path = GetPathForDiff(wkPath, diffs.Mount, diff.Path);
                        result.Add(path, AssetStatus.DeletedOnServer);
                    }
                }

                foreach (GluonFileConflict fileConflict in
                         outOfDateItems.GetFileConflicts())
                {
                    string path = GetPathForConflict(wkPath, fileConflict.CmPath);
                    result.Add(path, AssetStatus.Conflicted);
                }

                return(result);
            }
Exemple #4
0
            internal static Dictionary <string, LockStatusData> ForLocks(
                string wkPath,
                Dictionary <WorkspaceTreeNode, LockInfo> lockInfoByNode)
            {
                Dictionary <string, LockStatusData> result =
                    BuildPathDictionary.ForPlatform <LockStatusData>();

                LockOwnerNameResolver nameResolver = new LockOwnerNameResolver();

                foreach (WorkspaceTreeNode node in lockInfoByNode.Keys)
                {
                    LockStatusData lockStatusData = BuildLockStatusData(
                        node, lockInfoByNode[node], nameResolver);

                    string nodeWkPath = WorkspacePath.GetWorkspacePathFromCmPath(
                        wkPath,
                        WorkspaceNodeOperations.GetCmPath(node),
                        PathHelper.GetDirectorySeparatorChar(wkPath));

                    result.Add(nodeWkPath, lockStatusData);
                }

                return(result);
            }