Example #1
0
        private VersionInfo[] GetItemsVersionInfo(List <FilePath> paths, bool getRemoteStatus, RecursionType recursive)
        {
            List <VersionInfo> infos = new List <VersionInfo>();
            var extendedItems        = cache.GetItems(paths, recursive);

            foreach (var item in extendedItems.Where(i => i.IsInWorkspace || (!i.IsInWorkspace && i.ChangeType.HasFlag(ChangeType.Delete))).Distinct())
            {
                infos.AddRange(GetItemVersionInfo(item, getRemoteStatus));
            }
            foreach (var path in paths)
            {
                var path1 = path;
                if (infos.All(i => path1.CanonicalPath != i.LocalPath.CanonicalPath))
                {
                    infos.Add(VersionInfo.CreateUnversioned(path1, FileHelper.HasFolder(path1)));
                }
            }
            return(infos.ToArray());
        }