Exemplo n.º 1
0
        private PendingChange UpdatePendingChange(SvnItem item)
        {
            PendingChange pc;
            string        file = item.FullPath;

            if (_pendingChanges.TryGetValue(file, out pc))
            {
                if (pc.Refresh(RefreshContext, item))
                {
                    if (!pc.IsClean)
                    {
                        RaiseChanged(pc);
                    }
                    else
                    {
                        pc = null;
                    }
                }
                else if (pc.IsClean)
                {
                    pc = null;
                }
            }
            else if (PendingChange.CreateIfPending(RefreshContext, item, out pc))
            {
                Debug.Assert(!_pendingChanges.Contains(pc), "Insane race condition triggered");

                if (!_pendingChanges.Contains(pc))
                {
                    _pendingChanges.Add(pc);
                }
            }

            return(pc);
        }
Exemplo n.º 2
0
        private void ItemRefresh(string file)
        {
            SvnItem item = Cache[file];

            file = item.FullPath; // Use existing normalization

            bool          inProject = item.InSolution;
            bool          inExtra   = _extraFiles.Contains(file);
            PendingChange pc;

            if (!inProject && !inExtra)
            {
                _pendingChanges.Remove(file);

                return;
            }
            else if (inProject && inExtra)
            {
                _extraFiles.Remove(file);
            }

            if (item == null)
            {
                return;
            }

            if (_pendingChanges.TryGetValue(file, out pc))
            {
                if (pc.Refresh(RefreshContext, item))
                {
                    if (pc.IsClean)
                    {
                        _pendingChanges.Remove(file);
                        _extraFiles.Remove(file);
                    }
                    else
                    {
                        RaiseChanged(pc);
                    }
                }
            }
            else if (PendingChange.CreateIfPending(RefreshContext, item, out pc))
            {
                _pendingChanges.Add(pc);
            }
        }