Exemple #1
0
        public IEnumerable <IChangeReport> GetChangeRecords(Revision revision)
        {
            var changes = new List <IChangeReport>();

            revision.EnsureParentRevisionInfo();

            if (!revision.HasAtLeastOneParent)
            {
                //describe the contents of the initial checkin
                foreach (var fileInRevision in Repository.GetFilesInRevision(revision))
                {
                    CollectChangesInFile(fileInRevision, null, changes);
                }
            }

            else
            {
                IEnumerable <RevisionNumber> parentRevs = revision.GetLocalNumbersOfParents();
                foreach (RevisionNumber parentRev in parentRevs)
                {
                    foreach (var fileInRevision in Repository.GetFilesInRevision(revision)
                             .Where(fileInRevision => parentRevs.Count() == 1 ||
                                    fileInRevision.FullPath.ToLowerInvariant().EndsWith(".chorusnotes")))
                    {
                        CollectChangesInFile(fileInRevision, parentRev.LocalRevisionNumber, changes);
                    }
                }
                if (parentRevs.Count() > 1)
                {
                    changes = new List <IChangeReport>(changes.Distinct());
                }
            }

            return(changes);
        }