Example #1
0
        private static void Analyse()
        {
            var parser          = new CvsLogParser(m_config.Sandbox, m_config.CvsLogFileName, m_config.BranchMatcher);
            var builder         = new CommitBuilder(m_log, parser.Parse());
            var exclusionFilter = new ExclusionFilter(m_log, m_config);

            IEnumerable <Commit> commits = builder.GetCommits()
                                           .SplitMultiBranchCommits()
                                           .FilterCommitsOnExcludedBranches()
                                           .FilterExcludedFiles(exclusionFilter)
                                           .AddCommitsToFiles()
                                           .Verify(m_log)
                                           .ToListIfNeeded();

            // build lookup of all files
            var allFiles      = new FileCollection(parser.Files);
            var includedFiles = new FileCollection(parser.Files.Where(f => m_config.IncludeFile(f.Name)));

            WriteAllCommitsLog(commits);
            WriteExcludedFileLog(parser);

            var branchResolver = ResolveBranches(commits, includedFiles);

            commits = branchResolver.Commits;

            var tagResolver = ResolveTags(commits, includedFiles);

            commits = tagResolver.Commits;

            WriteTagLog("allbranches.log", branchResolver, parser.ExcludedBranches, m_config.BranchRename);
            WriteTagLog("alltags.log", tagResolver, parser.ExcludedTags, m_config.TagRename);
            WriteUserLog("allusers.log", commits);

            var streams = commits.SplitBranchStreams(branchResolver.ResolvedTags);

            // resolve merges
            var mergeResolver = new MergeResolver(m_log, streams);

            mergeResolver.Resolve();

            WriteBranchLogs(streams);

            // add any "head-only" files
            exclusionFilter.CreateHeadOnlyCommits(m_config.HeadOnlyBranches, streams, allFiles);

            // store data needed for import
            m_streams = streams;
        }
Example #2
0
        private static void WriteExcludedFileLog(CvsLogParser parser)
        {
            if (m_log.DebugEnabled)
            {
                var files = parser.Files
                            .Select(f => f.Name)
                            .Where(f => !m_config.IncludeFile(f))
                            .OrderBy(i => i, StringComparer.OrdinalIgnoreCase);

                m_log.WriteDebugFile("excluded_files.log", files);

                var headOnly = parser.Files
                               .Select(f => f.Name)
                               .Where(f => m_config.IsHeadOnly(f))
                               .OrderBy(i => i, StringComparer.OrdinalIgnoreCase);

                m_log.WriteDebugFile("headonly_files.log", headOnly);
            }
        }
Example #3
0
		private static void Analyse()
		{
			var parser = new CvsLogParser(m_config.Sandbox, m_config.CvsLogFileName, m_config.BranchMatcher);
			var builder = new CommitBuilder(m_log, parser.Parse());
			var exclusionFilter = new ExclusionFilter(m_log, m_config);

			IEnumerable<Commit> commits = builder.GetCommits()
					.SplitMultiBranchCommits()
					.FilterCommitsOnExcludedBranches()
					.FilterExcludedFiles(exclusionFilter)
					.AddCommitsToFiles()
					.Verify(m_log)
					.ToListIfNeeded();

			// build lookup of all files
			var allFiles = new FileCollection(parser.Files);
			var includedFiles = new FileCollection(parser.Files.Where(f => m_config.IncludeFile(f.Name)));

			WriteAllCommitsLog(commits);
			WriteExcludedFileLog(parser);

			var branchResolver = ResolveBranches(commits, includedFiles);
			commits = branchResolver.Commits;

			var tagResolver = ResolveTags(commits, includedFiles);
			commits = tagResolver.Commits;

			WriteTagLog("allbranches.log", branchResolver, parser.ExcludedBranches, m_config.BranchRename);
			WriteTagLog("alltags.log", tagResolver, parser.ExcludedTags, m_config.TagRename);
			WriteUserLog("allusers.log", commits);

			var streams = commits.SplitBranchStreams(branchResolver.ResolvedTags);

			// resolve merges
			var mergeResolver = new MergeResolver(m_log, streams);
			mergeResolver.Resolve();

			WriteBranchLogs(streams);

			// add any "head-only" files
			exclusionFilter.CreateHeadOnlyCommits(m_config.HeadOnlyBranches, streams, allFiles);

			// store data needed for import
			m_streams = streams;
		}
Example #4
0
		private static void WriteExcludedFileLog(CvsLogParser parser)
		{
			if (m_log.DebugEnabled)
			{
				var files = parser.Files
						.Select(f => f.Name)
						.Where(f => !m_config.IncludeFile(f))
						.OrderBy(i => i, StringComparer.OrdinalIgnoreCase);

				m_log.WriteDebugFile("excluded_files.log", files);

				var headOnly = parser.Files
						.Select(f => f.Name)
						.Where(f => m_config.IsHeadOnly(f))
						.OrderBy(i => i, StringComparer.OrdinalIgnoreCase);

				m_log.WriteDebugFile("headonly_files.log", headOnly);
			}
		}