示例#1
0
        public SvnItem(string fullPath, NoSccStatus status, SvnNodeKind nodeKind)
            : base(fullPath)
        {
            if (status == null)
            {
                throw new ArgumentNullException("status");
            }

            _enqueued = true;
            RefreshTo(status, nodeKind);
            _enqueued = false;
        }
示例#2
0
        public SvnItem(ISvnStatusCache context, string fullPath, NoSccStatus status, SvnNodeKind nodeKind)
            : base(fullPath)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            _context  = context;
            _enqueued = true;
            RefreshTo(status, nodeKind);
            _enqueued = false;
        }
示例#3
0
        void RefreshTo(NoSccStatus status, SvnNodeKind nodeKind)
        {
            _cookie      = NextCookie();
            _statusDirty = XBool.False;

            SvnItemState set   = SvnItemState.None;
            SvnItemState unset = SvnItemState.Modified | SvnItemState.Added | SvnItemState.HasCopyOrigin
                                 | SvnItemState.Deleted | SvnItemState.ContentConflicted | SvnItemState.Ignored
                                 | SvnItemState.Obstructed | SvnItemState.Replaced | SvnItemState.Versioned
                                 | SvnItemState.SvnDirty | SvnItemState.PropertyModified | SvnItemState.PropertiesConflicted | SvnItemState.Conflicted
                                 | SvnItemState.Obstructed | SvnItemState.MustLock | SvnItemState.IsWCRoot
                                 | SvnItemState.HasProperties | SvnItemState.HasLockToken | SvnItemState.HasCopyOrigin
                                 | SvnItemState.MovedHere;

            switch (status)
            {
            case NoSccStatus.NotExisting:
                SetState(set, SvnItemState.Exists | SvnItemState.ReadOnly | SvnItemState.IsDiskFile | SvnItemState.IsDiskFolder | SvnItemState.Versionable | unset);
                _status = SvnStatusData.NotExisting;
                break;

            case NoSccStatus.NotVersionable:
                unset |= SvnItemState.Versionable;
                goto case NoSccStatus.NotVersioned;     // fall through

            case NoSccStatus.NotVersioned:
                SetState(SvnItemState.Exists | set, SvnItemState.None | unset);
                _status = SvnStatusData.NotVersioned;
                break;

            case NoSccStatus.Unknown:
            default:
                SetDirty(set | unset);
                _statusDirty = XBool.True;
                break;
            }

            InitializeFromKind(nodeKind);
        }
 public SvnItem CreateItem(string fullPath, NoSccStatus status)
 {
     return(CreateItem(fullPath, status, SvnNodeKind.Unknown));
 }
 public SvnItem CreateItem(string fullPath, NoSccStatus status, SvnNodeKind nodeKind)
 {
     return(new SvnItem(fullPath, status, nodeKind));
 }
示例#6
0
 void ISvnItemUpdate.RefreshTo(NoSccStatus status, SvnNodeKind nodeKind)
 {
     Debug.Assert(status != NoSccStatus.Unknown);
     _ticked = false;
     RefreshTo(status, nodeKind);
 }
示例#7
0
        private void StatDirectory(string walkPath, GitDirectory directory, bool noWcAtAll)
        {
            // Note: There is a lock(_lock) around this in our caller

            bool        canRead;
            string      adminName   = GitClient.AdministrativeDirectoryName;
            NoSccStatus noSccStatus = noWcAtAll ? NoSccStatus.NotVersionable : NoSccStatus.NotVersioned;

            foreach (SccFileSystemNode node in SccFileSystemNode.GetDirectoryNodes(walkPath, out canRead))
            {
                if (string.Equals(node.Name, adminName, StringComparison.OrdinalIgnoreCase) || node.IsHiddenOrSystem)
                {
                    continue;
                }

                GitItem item;
                if (node.IsFile)
                {
                    if (!_map.TryGetValue(node.FullPath, out item))
                    {
                        StoreItem(CreateItem(node.FullPath, noSccStatus, SvnNodeKind.File));
                    }
                    else
                    {
                        IGitItemUpdate updateItem = item;
                        if (updateItem.ShouldRefresh())
                        {
                            updateItem.RefreshTo(noSccStatus, SvnNodeKind.File);
                        }
                    }
                }
                else
                {
                    if (!_map.TryGetValue(node.FullPath, out item))
                    {
                        StoreItem(CreateItem(node.FullPath, noSccStatus, SvnNodeKind.Directory));
                    }
                    // Don't clear state of a possible working copy
                }
            }

            if (canRead) // The directory exists
            {
                GitItem item;

                if (!_map.TryGetValue(walkPath, out item))
                {
                    StoreItem(CreateItem(walkPath, NoSccStatus.NotVersioned, SvnNodeKind.Directory));
                    // Mark it as existing if we are sure
                }
                else
                {
                    IGitItemUpdate updateItem = item;
                    if (updateItem.ShouldRefresh())
                    {
                        updateItem.RefreshTo(NoSccStatus.NotVersioned, SvnNodeKind.Directory);
                    }
                }
            }

            // Note: There is a lock(_lock) around this in our caller
        }
示例#8
0
 GitItem CreateItem(string fullPath, NoSccStatus status, SvnNodeKind nodeKind)
 {
     return(new GitItem(this, fullPath, status, nodeKind));
 }
示例#9
0
 void IGitItemUpdate.RefreshTo(NoSccStatus status, SvnNodeKind nodeKind)
 {
     RefreshTo(status, nodeKind);
 }